]> Creatis software - creaTools.git/blob - CMakeLists.txt
win64
[creaTools.git] / CMakeLists.txt
1 # ---------------------------------------------------------------------
2 #
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitementde 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 # Configure Dart testing support.  This should be done before any
32 # MESSAGE(FATAL_ERROR ...) commands are invoked.
33 IF(INCLUDE_CTEST)
34   INCLUDE(CTest)
35   ENABLE_TESTING()
36 ENDIF(INCLUDE_CTEST)
37 IF(BUILD_TESTING)
38   SET(BUILDNAME "${BUILDNAME}" CACHE STRING "Name of build on the dashboard")
39   MARK_AS_ADVANCED(BUILDNAME)
40 ENDIF(BUILD_TESTING)
41 #-----------------------------------------------------------------------------
42
43 #==================================
44 # The project version
45 SET(PROJECT_MAJOR_VERSION 2)
46 SET(PROJECT_MINOR_VERSION 6)
47 SET(PROJECT_BUILD_VERSION 5)
48 #==================================
49
50 # JPR 4 mars 2011
51 set (CMAKE_MODULE_PATH ${CMAKE_INSTALL_PREFIX}/share/cmake/Module)
52
53 #==================================
54 # Find crea
55 SET(CREA_VERBOSE_CMAKE TRUE)
56
57 #--EED--
58 #FIND_PACKAGE(crea REQUIRED)
59 #IF (crea_FOUND)
60 #  INCLUDE(${crea_USE_FILE})
61 #ENDIF(crea_FOUND)
62
63 #==================================
64
65 #==================================
66 # Do not allow to build inside the source tree
67 #--EED--
68 #CREA_PREVENT_IN_SOURCE_BUILD()
69 #==================================
70
71 #==================================
72 # Libraries/tools used
73 # Note : Set USE_CREA to ON
74 #  if you need to LINK against crea
75 #  (and not only use its macros)
76 SET(USE_CREA      OFF)
77 SET(USE_GDCM      OFF)
78 SET(USE_GDCM_VTK  OFF)
79 SET(USE_GDCM2     OFF)
80 SET(USE_WXWIDGETS OFF)
81 SET(USE_KWWIDGETS OFF)
82 SET(USE_VTK       OFF)
83 SET(USE_ITK       OFF)
84 SET(USE_BOOST     OFF)
85 SET(USE_DOXYGEN   OFF)
86 SET(USE_LATEX     OFF)
87 SET(USE_TTH       OFF)
88 #--EED--
89 #CREA_FIND_AND_USE_LIBRARIES()
90 #==================================
91
92 #==================================
93 # Where to put executables and libs
94 SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR})
95 SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR})
96 MARK_AS_ADVANCED(
97   CMAKE_BACKWARDS_COMPATIBILITY
98   EXECUTABLE_OUTPUT_PATH
99   LIBRARY_OUTPUT_PATH
100   )
101 #==================================
102
103
104 MACRO (TODAY RESULT)
105     IF (WIN32)
106         EXECUTE_PROCESS(COMMAND "cmd" " /C date /T" OUTPUT_VARIABLE ${RESULT})
107         string(REGEX REPLACE "(..)/(..)/..(..).*" "\\1/\\2/\\3" ${RESULT} ${${RESULT}})
108     ELSEIF(UNIX)
109         EXECUTE_PROCESS(COMMAND "date" "+%d/%m/%Y" OUTPUT_VARIABLE ${RESULT})
110         string(REGEX REPLACE "(..)/(..)/..(..).*" "\\1/\\2/\\3" ${RESULT} ${${RESULT}})
111     ELSE (WIN32)
112         MESSAGE(SEND_ERROR "date not implemented")
113         SET(${RESULT} 000000)
114     ENDIF (WIN32)
115 ENDMACRO (TODAY)
116
117
118 TODAY(CREATOOLS_COMPILATION_DATE)
119
120
121 ##         Project: @CMAKE_PROJECT_NAME@
122 ##         Version: @PROJECT_MAJOR_VERSION@.@PROJECT_MINOR_VERSION@.@PROJECT_BUILD_VERSION@
123 ##        Platform: @CREATOOLS_PLATFORM@
124 ##      Build Type: @CREATOOLS_BUILDTYPE@
125 ##Compilation date: @CREATOOLS_COMPILATION_DATE@
126  CONFIGURE_FILE(
127     ${CMAKE_CURRENT_SOURCE_DIR}/Version.txt.in
128     ${${CMAKE_PROJECT_NAME}_BINARY_DIR}/Version.txt
129     @ONLY IMMEDIATE
130     )
131
132 ## export creatoolsMajorVersion=@PROJECT_MAJOR_VERSION@
133 ## export creatoolsMinorVersion=@PROJECT_MINOR_VERSION@
134 ## export creatoolsBuildVersion=@PROJECT_BUILD_VERSION@
135 ## export creatoolsDate=@CREATOOLS_COMPILATION_DATE@
136  CONFIGURE_FILE(
137     ${CMAKE_CURRENT_SOURCE_DIR}/Version.sh.in
138     ${${CMAKE_PROJECT_NAME}_BINARY_DIR}/Version.sh
139     @ONLY IMMEDIATE
140     )
141
142 #==================================
143 # Subdirs
144 #ADD_SUBDIRECTORY(appli)
145 #ADD_SUBDIRECTORY(lib)
146 ADD_SUBDIRECTORY(install)
147 #==================================
148 #==================================