]> Creatis software - bbtk.git/blob - kernel/cmake/BBTKFindLibraries.cmake
BUG windows
[bbtk.git] / kernel / cmake / BBTKFindLibraries.cmake
1 #-----------------------------------------------------------------------------
2 #OPTION(USE_VTK "Build VTK-based black boxes" OFF)
3 IF(USE_VTK)
4   # Search VTK
5   FIND_PACKAGE(VTK)
6   # If vtk found
7   IF(VTK_FOUND)
8     MESSAGE ( STATUS "VTK FOUND - VERSION = ${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}.${VTK_BUILD_VERSION}")
9     INCLUDE(${VTK_USE_FILE})
10     ADD_DEF( _USE_VTK_ )
11     SET(BBTK_VTK_LIBRARIES
12       #     vtkCommon 
13       vtkImaging  vtkGraphics vtkRendering vtkFiltering vtkCommon vtkWidgets
14       vtkVolumeRendering
15       # LG : removed vtkIO because conflict with itktiff lib in ITKIO 
16       ) 
17     MARK_AS_ADVANCED(VTK_DIR)
18   ELSE(VTK_FOUND)
19      message(FATAL_ERROR "VTK_DIR not found")
20   ENDIF(VTK_FOUND)
21 ENDIF(USE_VTK)
22 #-----------------------------------------------------------------------------
23
24
25 #-----------------------------------------------------------------------------
26 #OPTION(USE_ITK "Build ITK-based black boxes" OFF)
27 IF(USE_ITK)
28   # Search ITK
29   FIND_PACKAGE(ITK)
30   # If itk found
31   IF(ITK_FOUND)
32      MESSAGE ( STATUS "ITK FOUND - VERSION = ${ITK_VERSION_MAJOR}.${ITK_VERSION_MINOR}.${ITK_VERSION_PATCH}")
33     INCLUDE(${ITK_USE_FILE})
34     ADD_DEF( _USE_ITK_ )
35     SET(BBTK_ITK_LIBRARIES
36       ITKCommon ITKIO ITKBasicFilters ITKAlgorithms
37       )  
38     MARK_AS_ADVANCED(ITK_DIR)
39    # images compilation option 
40     OPTION ( itk_IMAGE_DIM_2 "itk : Compile 2D images" ON)
41     OPTION ( itk_IMAGE_DIM_3 "itk : Compile 3D images" ON)
42     OPTION ( itk_IMAGE_DIM_4 "itk : Compile 4D images" ON)
43     OPTION ( itk_IMAGE_TYPE_CHAR "itk : Compile char images" ON)
44     OPTION ( itk_IMAGE_TYPE_UCHAR "itk : Compile unsigned char images" ON)
45     OPTION ( itk_IMAGE_TYPE_SHORT "itk : Compile short images" ON)
46     OPTION ( itk_IMAGE_TYPE_USHORT "itk : Compile unsigned short images" ON)
47     OPTION ( itk_IMAGE_TYPE_INT "itk : Compile int images" ON)
48     OPTION ( itk_IMAGE_TYPE_UINT "itk : Compile unsigned int images" ON)
49     OPTION ( itk_IMAGE_TYPE_FLOAT "itk : Compile float images" ON)
50     OPTION ( itk_IMAGE_TYPE_DOUBLE "itk : Compile double images" ON)
51     
52     IF ( itk_IMAGE_DIM_2 ) 
53       ADD_DEF( BBTK_ITK_IMAGE_DIM_2 )
54     ENDIF ( itk_IMAGE_DIM_2 )
55     
56     IF ( itk_IMAGE_DIM_3 ) 
57       ADD_DEF( BBTK_ITK_IMAGE_DIM_3 )
58     ENDIF ( itk_IMAGE_DIM_3 )
59     
60     IF ( itk_IMAGE_DIM_4 ) 
61       ADD_DEF( BBTK_ITK_IMAGE_DIM_4 )
62     ENDIF ( itk_IMAGE_DIM_4 )
63
64     IF ( itk_IMAGE_TYPE_CHAR ) 
65       ADD_DEF( BBTK_ITK_IMAGE_TYPE_int8_t )
66     ENDIF ( itk_IMAGE_TYPE_CHAR )
67
68     IF ( itk_IMAGE_TYPE_UCHAR ) 
69       ADD_DEF( BBTK_ITK_IMAGE_TYPE_uint8_t )
70     ENDIF ( itk_IMAGE_TYPE_UCHAR )
71     
72     IF ( itk_IMAGE_TYPE_SHORT ) 
73       ADD_DEF( BBTK_ITK_IMAGE_TYPE_int16_t )
74     ENDIF ( itk_IMAGE_TYPE_SHORT )
75     
76     IF ( itk_IMAGE_TYPE_USHORT ) 
77       ADD_DEF( BBTK_ITK_IMAGE_TYPE_uint16_t )
78     ENDIF ( itk_IMAGE_TYPE_USHORT )
79     
80     IF ( itk_IMAGE_TYPE_INT ) 
81       ADD_DEF( BBTK_ITK_IMAGE_TYPE_int32_t )
82     ENDIF ( itk_IMAGE_TYPE_INT )
83     
84     IF ( itk_IMAGE_TYPE_UINT ) 
85       ADD_DEF( BBTK_ITK_IMAGE_TYPE_uint32_t )
86     ENDIF ( itk_IMAGE_TYPE_UINT )
87     
88     IF ( itk_IMAGE_TYPE_FLOAT ) 
89       ADD_DEF( BBTK_ITK_IMAGE_TYPE_float )
90     ENDIF ( itk_IMAGE_TYPE_FLOAT )
91     
92     IF ( itk_IMAGE_TYPE_DOUBLE ) 
93       ADD_DEF( BBTK_ITK_IMAGE_TYPE_double )
94     ENDIF ( itk_IMAGE_TYPE_DOUBLE )
95   ELSE(ITK_FOUND)
96      message(FATAL_ERROR "ITK_DIR not found")
97   ENDIF(ITK_FOUND)
98 ENDIF(USE_ITK)
99 #-----------------------------------------------------------------------------
100
101 #-----------------------------------------------------------------------------
102 #OPTION(USE_GDCM "Build GDCM-based black boxes" OFF)
103 IF(USE_GDCM)
104   # Search GDCM
105   FIND_PACKAGE(GDCM)
106   # If gdcm found
107   IF(GDCM_FOUND)
108     INCLUDE(${GDCM_USE_FILE})
109     ADD_DEF( _USE_GDCM_ )
110     
111     SET(BBTK_GDCM_LIBRARIES
112 # TO DO : USE GDCM LINK LIBRARIES !!!
113       libgdcm libgdcmjpeg8 libgdcmjpeg12libgdcmjpeg16
114       )
115   ENDIF(GDCM_FOUND)
116 ENDIF(USE_GDCM)
117 #-----------------------------------------------------------------------------
118
119 #-----------------------------------------------------------------------------
120 IF(USE_WXWIDGETS)
121   INCLUDE(${BBTK_CMAKE_DIR}/BBTKWxWidgets.cmake)
122   BBTK_FIND_WXWIDGETS()
123   BBTK_USE_WXWIDGETS()
124 ENDIF(USE_WXWIDGETS)
125 #-----------------------------------------------------------------------------
126
127
128
129 #-----------------------------------------------------------------------------
130 IF(USE_DOXYGEN) 
131   FIND_PACKAGE(Doxygen REQUIRED)
132 #  MESSAGE(STATUS "Looking for doxygen... - found ${DOXYGEN}")
133   #  IF(DOXYGEN)
134 #    
135 #  ELSE(DOXYGEN)
136 #    MESSAGE(FATAL_ERROR "Doxygen not found. Required to build the doxygen documentation")
137 #  ENDIF(DOXYGEN)
138 ENDIF(USE_DOXYGEN)
139 #-----------------------------------------------------------------------------
140
141
142 #-----------------------------------------------------------------------------
143 IF(USE_LATEX) 
144   FIND_PACKAGE(LATEX REQUIRED)
145   MESSAGE(STATUS "Looking for latex... - found ${LATEX_COMPILER}")
146 ENDIF(USE_LATEX) 
147 #-----------------------------------------------------------------------------
148
149 #-----------------------------------------------------------------------------
150 IF(USE_TTH) 
151   FIND_FILE(LATEX_tth_CONVERTER NAME tth tth.exe PATHS . c:/Creatis/tth_exe/ ~/Creatis/tth ~/Creatis/tth_linux)
152   IF (NOT LATEX_tth_CONVERTER)
153     MESSAGE(FATAL_ERROR "TTH not found (LATEX_tth_CONVERTER). Required to build the HTML documentation from tex source")
154   ELSE (NOT LATEX_tth_CONVERTER)
155     MESSAGE(STATUS "Looking for tth... - found ${LATEX_tth_CONVERTER}")
156   ENDIF(NOT LATEX_tth_CONVERTER)
157   MARK_AS_ADVANCED(LATEX_tth_CONVERTER)
158 ENDIF(USE_TTH)
159 #-----------------------------------------------------------------------------