1 # ---------------------------------------------------------------------
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
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
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.
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
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 # ------------------------------------------------------------------------ */
27 #=======================================================================
29 #=======================================================================
30 MACRO(CREA_FIND_WXWIDGETS)
32 if (DEFINED CREA_USE_MXE)
33 SET(WXGLCANVASLIBS "gl")
35 # LG : These options should be set by the user at top level of crea
36 FIND_PACKAGE(wxWidgets COMPONENTS base core adv html
40 MESSAGE ( STATUS "=======================================")
41 MESSAGE ( STATUS "Looking for wxWidgets... found ${wxWidgets_CONFIG_EXECUTABLE}")
42 MESSAGE(STATUS "wxWidgets_INCLUDE_DIRS = ${wxWidgets_INCLUDE_DIRS}")
44 MESSAGE ( ERROR "EED cmake ERROR : wxWidgets not found")
45 ENDIF(wxWidgets_FOUND)
46 ELSE(DEFINED CREA_USE_MXE)
49 # WXWINDOWS_LIBRARY = full path to the wxWindows library and linker flags on unix
50 # CMAKE_WX_CXX_FLAGS = compiler flags for building wxWindows
51 # WXWINDOWS_INCLUDE_PATH = include path of wxWindows
52 SET(WXWINDOWS_USE_GL 1)
54 #wxWidgets build related stuff
55 # DO NOT FORCE DEBUG LIBS !!
56 SET(WXW_USE_DEBUG OFF)
57 SET(WXW_USE_UNICODE OFF)
58 SET(WXW_USE_SHARED ON)
61 SET(WXW_FILE_VERSION "28")
62 SET(WXW_VERSION "2.8")
65 # Why forcing verbosity ?
66 # SET(CMAKE_VERBOSE_MAKEFILE TRUE)
68 INCLUDE (${CREA_CMAKE_DIR}/FindWxWidgetsWin32.cmake)
70 ENDIF (DEFINED CREA_USE_MXE)
73 IF(NOT wxWidgets_FOUND)
75 # technically those packages are not required
76 # since one can still use the Motif/X11 version and not the gtk one:
77 FIND_PACKAGE(PkgConfig REQUIRED)
79 ## pkg_check_modules (GTK2 gtk+-2.0)
80 ## pkg_check_modules (GTK322 gtk+-3.0)
81 pkg_check_modules (GTK3 REQUIRED gtk+-3.0)
82 #MESSAGE("${GTK3_INCLUDE_DIRS}")
84 # Can I require all my user to have the gl lib on linux, even if they do not really need it...
85 SET(WXGLCANVASLIBS "gl")
88 # LG : These options should be set by the user at top level of crea
89 FIND_PACKAGE(wxWidgets COMPONENTS base core adv html
94 MESSAGE ( STATUS "=======================================")
95 MESSAGE ( STATUS "Looking for wxWidgets... found ${wxWidgets_CONFIG_EXECUTABLE}")
96 ENDIF(wxWidgets_FOUND)
97 ENDIF(NOT wxWidgets_FOUND)
102 ENDMACRO(CREA_FIND_WXWIDGETS)
103 #=======================================================================
105 #=======================================================================
106 MACRO(CREA_USE_WXWIDGETS)
107 # Preprocessor settings
108 CREA_DEFINE( USE_WXWIDGETS )
109 CREA_DEFINE( _USE_WXWIDGETS_ )
111 if (DEFINED CREA_USE_MXE)
112 include(${wxWidgets_USE_FILE})
113 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}${wxWidgets_CXX_FLAGS}")
114 INCLUDE_DIRECTORIES(${wxWidgets_INCLUDE_DIRS})
115 LINK_DIRECTORIES( ${wxWidgets_LIBRARY_DIRS} )
116 SET(WXWIDGETS_LIBRARIES
117 ${wxWidgets_LIBRARIES}
120 MESSAGE ( STATUS "EED : MACRO CREA_USE_WXWIDGETS B wxWidgets_INCLUDE_DIRS = ${wxWidgets_INCLUDE_DIRS}")
121 MESSAGE ( STATUS "EED : MACRO CREA_USE_WXWIDGETS B wxWidgets_DEFINITIONS = ${wxWidgets_DEFINITIONS}")
122 MESSAGE ( STATUS "EED : MACRO CREA_USE_WXWIDGETS B wxWidgets_LIBRARY_DIRS = ${wxWidgets_LIBRARY_DIRS}")
123 MESSAGE ( STATUS "EED : MACRO CREA_USE_WXWIDGETS B wxWidgets_LIBRARIES = ${wxWidgets_LIBRARIES}")
124 MESSAGE ( STATUS "EED : MACRO CREA_USE_WXWIDGETS B wxWidgets_USE_FILE = ${wxWidgets_USE_FILE}")
127 ELSE(DEFINED CREA_USE_MXE)
129 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}${WXWIDGETS_CXX_FLAGS}")
130 SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}${WXWIDGETS_EXE_LINKER_FLAGS}")
132 ADD_DEFINITIONS( ${WXWIDGETS_DEFINITIONS} )
134 INCLUDE_DIRECTORIES(${WXWIDGETS_INCLUDE_DIR})
135 LINK_DIRECTORIES( ${WXWIDGETS_LINK_DIRECTORIES} )
136 SET(WXWIDGETS_LIBRARIES
137 ${WXWIDGETS_LIBRARIES}
138 #DO NOT FORCE DEBUG LIBS !!
140 optimized wxmsw28_aui
146 ENDIF (DEFINED CREA_USE_MXE)
149 ## INCLUDE_DIRECTORIES(${GTK2_INCLUDE_DIRS})
150 ## LINK_DIRECTORIES(${GTK2_LIBRARY_DIRS})
151 ## LINK_LIBRARIES(${GTK2_LIBRARIES})
153 INCLUDE_DIRECTORIES(${GTK3_INCLUDE_DIRS})
154 LINK_DIRECTORIES(${GTK3_LIBRARY_DIRS})
155 LINK_LIBRARIES(${GTK3_LIBRARIES} )
159 # INCLUDE( ${GTK_USE_FILE} )
160 INCLUDE( ${wxWidgets_USE_FILE} )
161 MARK_AS_ADVANCED(wxWidgets_CONFIG_EXECUTABLE)
162 SET(WXWIDGETS_LIBRARIES
168 ${wxWidgets_LIBRARIES}
172 ENDMACRO(CREA_USE_WXWIDGETS)
173 #=======================================================================
175 #=======================================================================
176 MACRO(CREA_FIND_AND_USE_WXWIDGETS)
177 CREA_FIND_WXWIDGETS()
179 ENDMACRO(CREA_FIND_AND_USE_WXWIDGETS)
180 #=======================================================================