]> Creatis software - bbtk.git/blob - kernel/cmake/BBTKFindLibraries.cmake
#3479 Bug compilation windows dlfcn.h include
[bbtk.git] / kernel / cmake / BBTKFindLibraries.cmake
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  # Previous Authors : Laurent Guigues, Jean-Pierre Roux
7  # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
8  #
9  #  This software is governed by the CeCILL-B license under French law and
10  #  abiding by the rules of distribution of free software. You can  use,
11  #  modify and/ or redistribute the software under the terms of the CeCILL-B
12  #  license as circulated by CEA, CNRS and INRIA at the following URL
13  #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
14  #  or in the file LICENSE.txt.
15  #
16  #  As a counterpart to the access to the source code and  rights to copy,
17  #  modify and redistribute granted by the license, users are provided only
18  #  with a limited warranty  and the software's author,  the holder of the
19  #  economic rights,  and the successive licensors  have only  limited
20  #  liability.
21  #
22  #  The fact that you are presently reading this means that you have had
23  #  knowledge of the CeCILL-B license and that you accept its terms.
24  # ------------------------------------------------------------------------ */
25
26
27
28 #-----------------------------------------------------------------------------
29 MESSAGE ( STATUS "")
30 MESSAGE ( STATUS "=======================================")
31 MESSAGE ( STATUS "     LOOKING FOR LIBRARIES NEEDED")
32 MESSAGE ( STATUS "=======================================")
33 MESSAGE ( STATUS "")
34 #-----------------------------------------------------------------------------
35
36 #-----------------------------------------------------------------------------
37 # 11/12/08 : BBTK IS NOW BASED ON crea
38 SET(CREA_VERBOSE_CMAKE TRUE)
39 FIND_PACKAGE(crea REQUIRED )
40 set(crea_BUILD_SETTINGS_FILE OFF)
41 IF (crea_FOUND)
42   INCLUDE(${crea_USE_FILE} )
43 ENDIF(crea_FOUND)
44 #-----------------------------------------------------------------------------
45
46
47 #-----------------------------------------------------------------------------
48 # USE SHIPPED BOOST ?
49 IF(BBTK_KERNEL OR BBTK_CORE_PACKAGE)
50
51 #IF(BBTK_USE_SHIPPED_BOOST)
52
53 #  MESSAGE ( STATUS "=======================================")
54 #  MESSAGE ( STATUS "bbtk uses shipped boost C++ library (${BBTK_SHIPPED_BOOST})")
55 #  INCLUDE_DIRECTORIES( 
56 #    ${PROJECT_SOURCE_DIR}/kernel/src/ThirdParty/${BBTK_SHIPPED_BOOST})
57
58   # TO DO : CLEANLY BLOCK auto_link.hpp INCLUSION 
59   #CREA_DEFINE(BOOST_SIGNALS_NO_LIB)
60 #  SET(BBTK_BOOST_LIBRARIES
61 #    bbtk_boost_signals
62 #    )  
63   
64 #ELSE(BBTK_USE_SHIPPED_BOOST)
65   SET(USE_BOOST ON CACHE BOOL "Use boost C++ library" FORCE)
66 #  SET(BBTK_BOOST_LIBRARIES
67 #    boost_signals
68 #    )
69 #ENDIF(BBTK_USE_SHIPPED_BOOST)
70
71 ENDIF(BBTK_KERNEL OR BBTK_CORE_PACKAGE)
72 #-----------------------------------------------------------------------------
73
74
75
76 #-----------------------------------------------------------------------------
77 CREA_FIND_AND_USE_LIBRARIES()
78 #-----------------------------------------------------------------------------
79
80 #-----------------------------------------------------------------------------
81 MESSAGE(STATUS "=======================================")
82 MESSAGE(STATUS "")
83 MESSAGE(STATUS "=======================================") 
84 MESSAGE(STATUS "   ... ALL NEEDED LIBRARIES FOUND")
85 MESSAGE(STATUS "=======================================")
86 MESSAGE(STATUS "")
87 #-----------------------------------------------------------------------------
88
89
90 #-----------------------------------------------------------------------------
91 # bbtk library dependencies
92 #-----------------------------------------------------------------------------
93
94 #-----------------------------------------------------------------------------
95 # WXWIDGETS
96 IF(BBTK_USE_WXWIDGETS)
97   SET(BBTK_LINK_LIBRARIES
98     ${BBTK_LINK_LIBRARIES}
99     ${WXWIDGETS_LIBRARIES}
100     )
101 ENDIF(BBTK_USE_WXWIDGETS)
102 #-----------------------------------------------------------------------------
103
104 #-----------------------------------------------------------------------------
105 # KWWIDGETS
106 IF(BBTK_USE_KWWIDGETS)
107   SET(BBTK_LINK_LIBRARIES
108     ${BBTK_LINK_LIBRARIES}
109     ${KWWIDGETS_LIBRARIES} 
110     )
111 ENDIF(BBTK_USE_KWWIDGETS)
112 #-----------------------------------------------------------------------------
113
114 #-----------------------------------------------------------------------------
115 # QT
116 IF(BBTK_USE_QT)
117   SET(BBTK_LINK_LIBRARIES
118     ${BBTK_LINK_LIBRARIES}
119     ${QT_LIBRARIES} 
120     )
121 ENDIF(BBTK_USE_QT)
122 #-----------------------------------------------------------------------------
123
124 #-----------------------------------------------------------------------------
125 # BOOST 
126 SET(BBTK_LINK_LIBRARIES
127   ${BBTK_LINK_LIBRARIES}
128   ${BBTK_BOOST_LIBRARIES} 
129   ) 
130 #-----------------------------------------------------------------------------
131
132 #-----------------------------------------------------------------------------
133 # On unix systems, need to link against dl for dynamic librairies open/close
134 IF(UNIX)
135   SET(BBTK_LINK_LIBRARIES
136     ${BBTK_LINK_LIBRARIES}
137     dl) 
138 ENDIF(UNIX)
139 #-----------------------------------------------------------------------------
140
141 # mingw 
142 IF(MINGW)
143   SET(BBTK_LINK_LIBRARIES
144     ${BBTK_LINK_LIBRARIES}
145     dl) 
146         include_directories( "$ENV{SQLITE_DIR}/include") 
147 ENDIF(MINGW)
148
149
150 #-----------------------------------------------------------------------------
151 MESSAGE(STATUS "")
152 MESSAGE(STATUS "=======================================")
153 MESSAGE(STATUS "bbtk LINK LIBRARIES:")
154 MESSAGE(STATUS "${BBTK_LINK_LIBRARIES}")
155 MESSAGE(STATUS "=======================================")
156 MESSAGE(STATUS "")
157 #-----------------------------------------------------------------------------
158
159 #-----------------------------------------------------------------------------
160 # EO bbtk library dependencies
161 #-----------------------------------------------------------------------------
162