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