]> Creatis software - creaTools.git/blob - CMakeLists.txt
Feuture: Version.txt Description of the compilation type
[creaTools.git] / 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 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
25
26 ###################################
27 PROJECT(creaTools)
28 ###################################
29
30 #==================================
31 # The project version
32 SET(PROJECT_MAJOR_VERSION 2)
33 SET(PROJECT_MINOR_VERSION 2)
34 SET(PROJECT_BUILD_VERSION 0)
35 #==================================
36
37 # JPR 4 mars 2011
38 set (CMAKE_MODULE_PATH ${CMAKE_INSTALL_PREFIX}/share/cmake/Module)
39
40 #==================================
41 # Find crea
42 SET(CREA_VERBOSE_CMAKE TRUE)
43
44 #--EED--
45 #FIND_PACKAGE(crea REQUIRED)
46 #IF (crea_FOUND)
47 #  INCLUDE(${crea_USE_FILE})
48 #ENDIF(crea_FOUND)
49
50 #==================================
51
52 #==================================
53 # Do not allow to build inside the source tree
54 #--EED--
55 #CREA_PREVENT_IN_SOURCE_BUILD()
56 #==================================
57
58 #==================================
59 # Libraries/tools used
60 # Note : Set USE_CREA to ON
61 #  if you need to LINK against crea
62 #  (and not only use its macros)
63 SET(USE_CREA      OFF)
64 SET(USE_GDCM      OFF)
65 SET(USE_GDCM_VTK  OFF)
66 SET(USE_GDCM2     OFF)
67 SET(USE_WXWIDGETS OFF)
68 SET(USE_KWWIDGETS OFF)
69 SET(USE_VTK       OFF)
70 SET(USE_ITK       OFF)
71 SET(USE_BOOST     OFF)
72 SET(USE_DOXYGEN   OFF)
73 SET(USE_LATEX     OFF)
74 SET(USE_TTH       OFF)
75 #--EED--
76 #CREA_FIND_AND_USE_LIBRARIES()
77 #==================================
78
79 #==================================
80 # Where to put executables and libs
81 SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR})
82 SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR})
83 MARK_AS_ADVANCED(
84   CMAKE_BACKWARDS_COMPATIBILITY
85   EXECUTABLE_OUTPUT_PATH
86   LIBRARY_OUTPUT_PATH
87   )
88 #==================================
89
90
91 MACRO (TODAY RESULT)
92     IF (WIN32)
93         EXECUTE_PROCESS(COMMAND "cmd" " /C date /T" OUTPUT_VARIABLE ${RESULT})
94         string(REGEX REPLACE "(..)/(..)/..(..).*" "\\1/\\2/\\3" ${RESULT} ${${RESULT}})
95     ELSEIF(UNIX)
96         EXECUTE_PROCESS(COMMAND "date" "+%d/%m/%Y" OUTPUT_VARIABLE ${RESULT})
97         string(REGEX REPLACE "(..)/(..)/..(..).*" "\\1/\\2/\\3" ${RESULT} ${${RESULT}})
98     ELSE (WIN32)
99         MESSAGE(SEND_ERROR "date not implemented")
100         SET(${RESULT} 000000)
101     ENDIF (WIN32)
102 ENDMACRO (TODAY)
103
104
105 TODAY(CREATOOLS_COMPILATION_DATE)
106
107
108 ##         Project: @CMAKE_PROJECT_NAME@
109 ##         Version: @PROJECT_MAJOR_VERSION@.@PROJECT_MINOR_VERSION@.@PROJECT_BUILD_VERSION@
110 ##        Platform: @CREATOOLS_PLATFORM@
111 ##      Build Type: @CREATOOLS_BUILDTYPE@
112 ##Compilation date: @CREATOOLS_COMPILATION_DATE@
113  CONFIGURE_FILE(
114     ${CMAKE_CURRENT_SOURCE_DIR}/Version.txt.in
115     ${${CMAKE_PROJECT_NAME}_BINARY_DIR}/Version.txt
116     @ONLY IMMEDIATE
117     )
118
119
120 #==================================
121 # Subdirs
122 #ADD_SUBDIRECTORY(appli)
123 #ADD_SUBDIRECTORY(lib)
124 ADD_SUBDIRECTORY(install)
125 #==================================
126 #==================================