]> Creatis software - crea.git/blob - install/CMakeLists.txt
Feature #1711 CreaDevManager application implementation
[crea.git] / install / CMakeLists.txt
1 # ---------------------------------------------------------------------
2 #
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image 
4 #                        pour la Sant�)
5 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
6 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
7 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
8 #
9 #  This software is governed by the CeCILL-B license under French law and 
10 #  abiding by the rules of distribution of free software. You can  use, 
11 #  modify and/ or redistribute the software under the terms of the CeCILL-B 
12 #  license as circulated by CEA, CNRS and INRIA at the following URL 
13 #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html 
14 #  or in the file LICENSE.txt.
15 #
16 #  As a counterpart to the access to the source code and  rights to copy,
17 #  modify and redistribute granted by the license, users are provided only
18 #  with a limited warranty  and the software's author,  the holder of the
19 #  economic rights,  and the successive licensors  have only  limited
20 #  liability. 
21 #
22 #  The fact that you are presently reading this means that you have had
23 #  knowledge of the CeCILL-B license and that you accept its terms.
24 # ------------------------------------------------------------------------ */ 
25
26
27 #-----------------------------------------------------------------------------
28 # Code installing the files needed to find the library
29 # with the cmake command FIND_PACKAGE
30 # Uses CREA_ADVANCED_INSTALL_LIBRARY_FOR_CMAKE macro
31 #-----------------------------------------------------------------------------
32
33 #-----------------------------------------------------------------------------
34 # - Set the variable LIBRARY_NAME to the name of your library
35 SET(LIBRARY_NAME crea)
36
37 SET(${LIBRARY_NAME}_INSTALL_FOLDER crea)
38 SET(${LIBRARY_NAME}_LIBRARIES crea)
39
40 SET(${LIBRARY_NAME}_BUILD_TREE_RELATIVE_INCLUDE_PATHS src)
41
42 IF(UNIX)
43   SET(${LIBRARY_NAME}_BUILD_TREE_RELATIVE_LIBRARY_PATHS 
44     .) # ${EXECUTABLE_OUTPUT_REL_PATH})
45 ELSE(UNIX)
46   SET(${LIBRARY_NAME}_BUILD_TREE_RELATIVE_LIBRARY_PATHS
47      .    )
48 #    Debug
49 #    Release)
50 ENDIF(UNIX)
51
52 SET(${LIBRARY_NAME}_INSTALL_TREE_RELATIVE_INCLUDE_PATHS include/crea)
53 SET(${LIBRARY_NAME}_INSTALL_TREE_RELATIVE_LIBRARY_PATHS ${CREA_LIB_PATH})
54
55 # OPTIONAL 
56 # - Set the version of your library
57 # SET YOUR LIB VERSION
58 #SET(${LIBRARY_NAME}_MAJOR_VERSION 1)
59 #SET(${LIBRARY_NAME}_MINOR_VERSION 0)
60 #SET(${LIBRARY_NAME}_BUILD_VERSION 0)
61 # REQUIRED BUILD FLAGS
62 #SET(${LIBRARY_NAME}_REQUIRED_C_FLAGS "")
63 #SET(${LIBRARY_NAME}_REQUIRED_CXX_FLAGS "")
64 #SET(${LIBRARY_NAME}_REQUIRED_LINK_FLAGS "")
65 # ADDITIONAL CONFIG FILE
66 SET(${LIBRARY_NAME}_HAS_ADDITIONAL_CONFIG_FILE TRUE)
67 SET(${LIBRARY_NAME}_ADDITIONAL_CONFIG_FILE 
68   ${PROJECT_SOURCE_DIR}/AdditionalcreaConfig.cmake.in)
69 SET(${LIBRARY_NAME}_ADDITIONAL_USE_FILE 
70   ${PROJECT_SOURCE_DIR}/AdditionalUsecrea.cmake.in)
71
72 # Invoke the macro
73 CREA_ADVANCED_INSTALL_LIBRARY_FOR_CMAKE(${LIBRARY_NAME})
74 #-----------------------------------------------------------------------------
75
76 #-----------------------------------------------------------------------------
77 # CreaDevManager Data
78 #-----------------------------------------------------------------------------
79 IF (WIN32)
80   SET(INSTALL_DATA_DIR "bin/data")
81 ELSE (WIN32)
82   SET(INSTALL_DATA_DIR "share/creaDevManager/data")
83 ENDIF (WIN32)
84
85 #-- data --
86 SET(DATA_DIR ${PROJECT_SOURCE_DIR}/data )
87 FILE(GLOB DATA_FILES "${DATA_DIR}/*.*")
88 FOREACH( iLST  ${DATA_FILES} )
89    INSTALL( 
90          FILES ${iLST}
91          DESTINATION ${INSTALL_DATA_DIR}
92    )
93 ENDFOREACH(iLST)
94
95 #-----------------------------------------------------------------------------
96 # CPACK+NSIS PACKAGING
97 #-----------------------------------------------------------------------------
98
99 #---Documentation-------------
100 #http://www.cmake.org/Wiki/CMake:Packaging_With_CPack
101 #http://www.cmake.org/Wiki/CMake:CPackConfiguration
102 #http://www.cmake.org/Wiki/CMake:Install_Commands
103
104
105 INCLUDE(InstallRequiredSystemLibraries)
106
107 SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "crea - CREATIS")
108 SET(CPACK_PACKAGE_VENDOR "CREATIS")
109 SET(CPACK_PACKAGE_DESCRIPTION_FILE "${PROJECT_SOURCE_DIR}/README.txt")
110 SET(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE.txt")
111 SET(CPACK_PACKAGE_VERSION_MAJOR ${crea_MAJOR_VERSION})
112 SET(CPACK_PACKAGE_VERSION_MINOR ${crea_MINOR_VERSION})
113 SET(CPACK_PACKAGE_VERSION_PATCH ${crea_BUILD_VERSION})
114
115 IF(WIN32)
116         SET(CPACK_PACKAGE_INSTALL_DIRECTORY "CreaTools\\\\crea-${crea_MAJOR_VERSION}.${crea_MINOR_VERSION}.${crea_BUILD_VERSION}")
117 ELSE(WIN32)
118         SET(CPACK_PACKAGE_INSTALL_DIRECTORY "CreaTools/crea-${crea_MAJOR_VERSION}.${crea_MINOR_VERSION}.${crea_BUILD_VERSION}")
119 ENDIF(WIN32)
120
121 IF(WIN32 AND NOT UNIX)
122   # There is a bug in NSI that does not handle full unix paths properly. Make
123   # sure there is at least one set of four (4) backlasshes.
124 #EED  SET(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/kernel/install/gnome/bbi-icon2.bmp")
125 #  SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin/BBI_EXE.exe")
126   SET(CPACK_NSIS_DISPLAY_NAME "crea")
127   SET(CPACK_NSIS_HELP_LINK "http://www.creatis.insa-lyon.fr/site/en/CreatoolsCrea")
128   SET(CPACK_NSIS_URL_INFO_ABOUT "http://www.creatis.insa-lyon.fr/site/en/CreatoolsCrea")
129   SET(CPACK_NSIS_CONTACT "info-dev@creatis.insa-lyon.fr")
130   SET(CPACK_NSIS_MODIFY_PATH ON)
131 ELSE(WIN32 AND NOT UNIX)
132 #  SET(CPACK_STRIP_FILES "bin/bbi")
133   SET(CPACK_SOURCE_STRIP_FILES "")
134 ENDIF(WIN32 AND NOT UNIX)
135 SET(CPACK_PACKAGE_EXECUTABLES "creaNewProject" "New project")
136
137   
138
139 INCLUDE(CPack)
140