]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/CMakeLists.txt
ViewerNV 2D with color Transfer Function
[creaMaracasVisu.git] / lib / maracasVisuLib / CMakeLists.txt
1 #----------------------------------------------------------------------------
2 # SET THE NAME OF YOUR LIBRARY
3
4
5 SET ( LIBRARY_NAME   creaMaracasVisu  )
6 #----------------------------------------------------------------------------
7
8 #----------------------------------------------------------------------------
9 # CREATES A USER OPTION IN CMAKE
10 OPTION ( BUILD_${LIBRARY_NAME}  "Build ${LIBRARY_NAME} library ?" ON)
11
12 OPTION ( EXPORTS_MaracasKernel  "Build ${LIBRARY_NAME} library ?" ON)
13 IF (EXPORTS_MaracasKernel)
14         SET(MaracasKernel_EXPORTS)
15         ADD_DEFINITIONS (-DMaracasKernel_EXPORTS)
16 ENDIF(EXPORTS_MaracasKernel)
17
18 #----------------------------------------------------------------------------
19 IF ( BUILD_${LIBRARY_NAME} )
20 #----------------------------------------------------------------------------
21
22   #----------------------------------------------------------------------------
23   # BUILD LIBRARY
24   #----------------------------------------------------------------------------
25 #jhcl-Start===========================================================================
26   INCLUDE_DIRECTORIES(
27     include
28     src
29         #${MARACAS_SOURCE_DIR}/src/axe3DVTK
30         #  ${MARACAS_SOURCE_DIR}/src/interface
31     src/kernel
32         #${MARACAS_SOURCE_DIR}/src/SnakeIsoContour+Deriche
33     src/interface/wxWindows
34     src/interface/wxWindows/Contour
35     src/interface/wxWindows/widgets
36     src/interface/wxWindows/widgets/pPlotter
37         src/interface/wxWindows/widgets/manualContour
38         ../../../
39 )
40         #message(jhcl\n\n ${crea_LIBRARIES})
41         #INCLUDE(include/Modules/MARACAS_Find_LIBIDO.cmake)
42         #SET(CREA_LIBRARIES C:/creaBin/Debug/crea.lib)
43         #FIND_PACKAGE(crea)
44 #jhcl-End===========================================================================
45   #----------------------------------------------------------------------------
46   # LIBRARY HEADERS (TO BE INSTALLED)
47   # EITHER LIST ALL .h IN CURRENT DIR USING NEXT LINE:
48   #FILE(GLOB ${LIBRARY_NAME}_HEADERS "*.h")
49   # OR MANUALLY LIST YOUR HEADERS WITH NEXT COMMAND
50   
51   FILE(GLOB ${LIBRARY_NAME}_HEADERS_WXWIN "src/interface/wxWindows/*.h")
52   FILE(GLOB ${LIBRARY_NAME}_SOURCES_WXWIN src/interface/wxWindows/*.cxx src/interface/wxWindows/*.cpp src/interface/wxWindows/*.cc)
53   
54   FILE(GLOB ${LIBRARY_NAME}_HEADERS_CONTOUR "src/interface/wxWindows/Contour/*.h")
55   FILE(GLOB ${LIBRARY_NAME}_SOURCES_CONTOUR src/interface/wxWindows/Contour/*.cxx src/interface/wxWindows/Contour/*.cpp src/interface/wxWindows/Contour/*.cc)
56
57   FILE(GLOB ${LIBRARY_NAME}_HEADERS_ThresholdImageView "src/interface/wxWindows/widgets/ThresholdImageView/*.h")
58   FILE(GLOB ${LIBRARY_NAME}_SOURCES_ThresholdImageView src/interface/wxWindows/widgets/ThresholdImageView/*.cxx src/interface/wxWindows/widgets/ThresholdImageView/*.cpp src/interface/wxWindows/widgets/ThresholdImageView/*.cc)
59   
60   FILE(GLOB ${LIBRARY_NAME}_HEADERS_WIDGETS "src/interface/wxWindows/widgets/*.h")
61   FILE(GLOB ${LIBRARY_NAME}_SOURCES_WIDGETS src/interface/wxWindows/widgets/*.cxx src/interface/wxWindows/widgets/*.cpp src/interface/wxWindows/widgets/*.cc)
62   
63   FILE(GLOB ${LIBRARY_NAME}_HEADERS_PPLOTTER "src/interface/wxWindows/widgets/pPlotter/*.h")
64   FILE(GLOB ${LIBRARY_NAME}_SOURCES_PPLOTTER src/interface/wxWindows/widgets/pPlotter/*.cxx src/interface/wxWindows/widgets/pPlotter/*.cpp src/interface/wxWindows/widgets/pPlotter/*.cc)
65   
66   FILE(GLOB ${LIBRARY_NAME}_HEADERS_MANUAL_CONTOUR "src/interface/wxWindows/widgets/manualContour/*.h")
67   FILE(GLOB ${LIBRARY_NAME}_SOURCES_MANUAL_CONTOUR src/interface/wxWindows/widgets/manualContour/*.cpp )
68   
69   FILE(GLOB ${LIBRARY_NAME}_HEADERS_KERNEL "src/kernel/*.h")
70   FILE(GLOB ${LIBRARY_NAME}_SOURCES_KERNEL src/kernel/*.cxx src/kernel/*.cpp src/kernel/*.cc)
71   
72     
73   SET ( ${LIBRARY_NAME}_HEADERS
74         ${${LIBRARY_NAME}_HEADERS_WXWIN}        
75         ${${LIBRARY_NAME}_HEADERS_CONTOUR}
76         ${${LIBRARY_NAME}_HEADERS_ThresholdImageView}
77         ${${LIBRARY_NAME}_HEADERS_WIDGETS}    
78         ${${LIBRARY_NAME}_HEADERS_PPLOTTER}
79         ${${LIBRARY_NAME}_HEADERS_MANUAL_CONTOUR}  
80         include/matrix.h
81         ${${LIBRARY_NAME}_HEADERS_KERNEL}
82   )
83   #----------------------------------------------------------------------------
84
85   #----------------------------------------------------------------------------
86   # LIBRARY SOURCES (TO BE COMPILED)
87   # EITHER LIST ALL .cxx, *.cpp, *.cc IN CURRENT DIR USING NEXT LINE:
88   #FILE(GLOB ${LIBRARY_NAME}_SOURCES *.cxx *.cpp *.cc)
89   # OR MANUALLY LIST YOUR FILES WITH NEXT COMMAND (WITHOUT EXTENSION)
90   
91   SET ( ${LIBRARY_NAME}_SOURCES 
92         ${${LIBRARY_NAME}_SOURCES_WXWIN}        
93         ${${LIBRARY_NAME}_SOURCES_CONTOUR}
94         ${${LIBRARY_NAME}_SOURCES_ThresholdImageView}
95         ${${LIBRARY_NAME}_SOURCES_WIDGETS}
96         ${${LIBRARY_NAME}_SOURCES_PPLOTTER}
97         ${${LIBRARY_NAME}_SOURCES_MANUAL_CONTOUR}       
98         ${${LIBRARY_NAME}_SOURCES_KERNEL}
99   )
100   #----------------------------------------------------------------------------
101 #jhcl-Start===========================================================================
102 #message(jhcl4${LIBIDO_LIBRARIES})
103 #jhcl-End===========================================================================
104           
105   #----------------------------------------------------------------------------
106   # LIBRARY DEPENDENCIES (LIBRARIES TO LINK WITH)
107   SET ( ${LIBRARY_NAME}_LINK_LIBRARIES
108                 ${crea_LIBRARIES}
109         ${WXWIDGETS_LIBRARIES}
110         ${VTK_LIBRARIES}
111         ${ITK_LIBRARIES}
112 #        ${GDCM_LIBRARIES}
113     #    ${BOOST_LIBRARIES}
114         #jhcl-Start===========================================================================
115                 
116                 ${LIBIDO_LIBRARIES}
117                 ${CREA_LIBRARIES}
118         #${BOOST_LIBRARIES}
119         #jhcl-End===========================================================================
120     )
121   #----------------------------------------------------------------------------
122
123   
124   #----------------------------------------------------------------------------
125   # MACRO WHICH DOES ALL THE JOB : BUILD AND INSTALL
126 #JHCL 
127   #CREA_ADD_LIBRARY( ${LIBRARY_NAME} )
128 #JHCL
129
130 # Ya esta hecho arriba
131 # SET(LIBRARY_NAME ******NOMBRE*******)
132
133   IF(CREA_VERBOSE_CMAKE)
134     MESSAGE(STATUS "** Creating library ${LIBRARY_NAME}")
135     MESSAGE(STATUS "   Headers  : ${${LIBRARY_NAME}_HEADERS}")
136     MESSAGE(STATUS "   Sources  : ${${LIBRARY_NAME}_SOURCES}")
137     MESSAGE(STATUS "   Link libs: ${${LIBRARY_NAME}_LINK_LIBRARIES}")
138   ENDIF(CREA_VERBOSE_CMAKE)
139
140
141   
142   # CREATE THE TARGET  
143   ADD_LIBRARY (${LIBRARY_NAME} ${${LIBRARY_NAME}_SHARED} ${${LIBRARY_NAME}_SOURCES} ${${LIBRARY_NAME}_HEADERS})
144
145   # LINK
146   TARGET_LINK_LIBRARIES(${LIBRARY_NAME} ${${LIBRARY_NAME}_LINK_LIBRARIES})
147
148  # Sets the settings for macro CREA_ADVANCED_INSTALL_LIBRARY_FOR_CMAKE
149   SET(${LIBRARY_NAME}_INSTALL_FOLDER ${LIBRARY_NAME})
150   SET(${LIBRARY_NAME}_LIBRARIES ${LIBRARY_NAME})
151  
152 #  FILE(RELATIVE_PATH
153  #   ${LIBRARY_NAME}_BUILD_TREE_RELATIVE_INCLUDE_PATHS
154  #   ${PROJECT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}
155  #   )
156
157 SET(${LIBRARY_NAME}_BUILD_TREE_RELATIVE_INCLUDE_PATHS
158 #lib/THIS_DIR/toto
159 #lib/THIS_DIR/other_headers
160     lib/maracasVisuLib/src
161         #${MARACAS_SOURCE_DIR}/src/axe3DVTK
162         #  ${MARACAS_SOURCE_DIR}/src/interface
163     lib/maracasVisuLib/src/kernel
164         #${MARACAS_SOURCE_DIR}/src/SnakeIsoContour+Deriche
165     lib/maracasVisuLib/src/interface/wxWindows
166     lib/maracasVisuLib/src/interface/wxWindows/Contour
167     lib/maracasVisuLib/src/interface/wxWindows/widgets
168     lib/maracasVisuLib/src/interface/wxWindows/widgets/pPlotter
169         lib/maracasVisuLib/src/interface/wxWindows/widgets/manualContour
170         lib/maracasVisuLib/../../../
171 )
172 IF ( ${PROJECT_BINARY_DIR} STREQUAL ${EXECUTABLE_OUTPUT_PATH} )
173   SET(CILFC_EXECUTABLE_OUTPUT_REL_PATH ".")
174 ELSE ( ${PROJECT_BINARY_DIR} STREQUAL ${EXECUTABLE_OUTPUT_PATH} )
175   FILE(RELATIVE_PATH 
176     CILFC_EXECUTABLE_OUTPUT_REL_PATH
177     ${PROJECT_BINARY_DIR} ${EXECUTABLE_OUTPUT_PATH})
178 ENDIF ( ${PROJECT_BINARY_DIR} STREQUAL ${EXECUTABLE_OUTPUT_PATH} )
179
180 IF(UNIX)
181   SET(${LIBRARY_NAME}_BUILD_TREE_RELATIVE_LIBRARY_PATHS
182     ${CILFC_EXECUTABLE_OUTPUT_REL_PATH})
183   SET(${LIBRARY_NAME}_INSTALL_TREE_RELATIVE_LIBRARY_PATHS lib)
184 ELSE(UNIX)
185   SET(${LIBRARY_NAME}_BUILD_TREE_RELATIVE_LIBRARY_PATHS
186     ${CILFC_EXECUTABLE_OUTPUT_REL_PATH})
187   SET(${LIBRARY_NAME}_INSTALL_TREE_RELATIVE_LIBRARY_PATHS bin)
188 ENDIF(UNIX)
189   SET(${LIBRARY_NAME}_INSTALL_TREE_RELATIVE_INCLUDE_PATHS include/${LIBRARY_NAME})
190   SET(${LIBRARY_NAME}_HAS_ADDITIONAL_CONFIG_FILE FALSE)
191 # SET(${LIBRARY_NAME}_ADDITIONAL_CONFIG_FILE
192 #   ${PROJECT_SOURCE_DIR}/src/AdditionalcreaImageIOConfig.cmake.in)
193 # SET(${LIBRARY_NAME}_ADDITIONAL_USE_FILE
194 #  ${PROJECT_SOURCE_DIR}/src/AdditionalUsecreaImageIO.cmake.in)
195
196 # Invoke the advanced macro
197 CREA_ADVANCED_INSTALL_LIBRARY_FOR_CMAKE(${LIBRARY_NAME})
198
199 # INSTALLS LIBRARY
200 INSTALL(
201   FILES ${${LIBRARY_NAME}_HEADERS}
202   DESTINATION ${${LIBRARY_NAME}_INSTALL_TREE_RELATIVE_INCLUDE_PATHS}
203   ) 
204 IF(WIN32)       
205   INSTALL(
206     TARGETS ${LIBRARY_NAME}
207     DESTINATION bin)
208 ELSE(WIN32)
209   INSTALL(
210     TARGETS ${LIBRARY_NAME}
211     DESTINATION lib)
212 ENDIF(WIN32)
213
214
215   
216   
217   
218   #----------------------------------------------------------------------------
219
220
221   #---------------------------------------------------------------------------
222 ENDIF ( BUILD_${LIBRARY_NAME} )