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)
34 # WXWINDOWS_LIBRARY = full path to the wxWindows library and linker flags on unix
35 # CMAKE_WX_CXX_FLAGS = compiler flags for building wxWindows
36 # WXWINDOWS_INCLUDE_PATH = include path of wxWindows
37 SET(WXWINDOWS_USE_GL 1)
39 #wxWidgets build related stuff
40 # DO NOT FORCE DEBUG LIBS !!
41 SET(WXW_USE_DEBUG OFF)
42 SET(WXW_USE_UNICODE OFF)
43 SET(WXW_USE_SHARED ON)
46 SET(WXW_FILE_VERSION "28")
47 SET(WXW_VERSION "2.8")
50 # Why forcing verbosity ?
51 # SET(CMAKE_VERBOSE_MAKEFILE TRUE)
53 INCLUDE (${CREA_CMAKE_DIR}/FindWxWidgetsWin32.cmake)
58 MESSAGE ( "===============Manual wx-config 3 EED =======================")
59 SET(wxWidgets_CONFIG_EXECUTABLE /usr/bin/wx-config-3.0 CACHE STRING wxWidgets_CONFIG_EXECUTABLE FORCE)
60 SET(wxWidgets_wxrc_EXECUTABLE /usr/bin/wxrc-3.0 CACHE STRING wxWidgets_wxrc_EXECUTABLE FORCE)
62 IF(NOT wxWidgets_FOUND)
64 # technically those packages are not required
65 # since one can still use the Motif/X11 version and not the gtk one:
66 FIND_PACKAGE(PkgConfig REQUIRED)
68 ## pkg_check_modules (GTK2 gtk+-2.0)
69 ## pkg_check_modules (GTK322 gtk+-3.0)
70 pkg_check_modules (GTK3 REQUIRED gtk+-3.0)
71 #MESSAGE("${GTK3_INCLUDE_DIRS}")
73 # Can I require all my user to have the gl lib on linux, even if they do not really need it...
74 SET(WXGLCANVASLIBS "gl")
77 # LG : These options should be set by the user at top level of crea
78 FIND_PACKAGE(wxWidgets COMPONENTS base core adv html
83 MESSAGE ( STATUS "=======================================")
84 MESSAGE ( STATUS "Looking for wxWidgets... found ${wxWidgets_CONFIG_EXECUTABLE}")
85 ENDIF(wxWidgets_FOUND)
86 ENDIF(NOT wxWidgets_FOUND)
91 ENDMACRO(CREA_FIND_WXWIDGETS)
92 #=======================================================================
94 #=======================================================================
95 MACRO(CREA_USE_WXWIDGETS)
96 # Preprocessor settings
97 CREA_DEFINE( USE_WXWIDGETS )
98 CREA_DEFINE( _USE_WXWIDGETS_ )
103 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}${WXWIDGETS_CXX_FLAGS}")
104 SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}${WXWIDGETS_EXE_LINKER_FLAGS}")
106 ADD_DEFINITIONS( ${WXWIDGETS_DEFINITIONS} )
108 INCLUDE_DIRECTORIES(${WXWIDGETS_INCLUDE_DIR})
109 LINK_DIRECTORIES( ${WXWIDGETS_LINK_DIRECTORIES} )
110 SET(WXWIDGETS_LIBRARIES
111 ${WXWIDGETS_LIBRARIES}
112 #DO NOT FORCE DEBUG LIBS !!
114 optimized wxmsw28_aui
122 ## INCLUDE_DIRECTORIES(${GTK2_INCLUDE_DIRS})
123 ## LINK_DIRECTORIES(${GTK2_LIBRARY_DIRS})
124 ## LINK_LIBRARIES(${GTK2_LIBRARIES})
126 INCLUDE_DIRECTORIES(${GTK3_INCLUDE_DIRS})
127 LINK_DIRECTORIES(${GTK3_LIBRARY_DIRS})
128 LINK_LIBRARIES(${GTK3_LIBRARIES} )
132 # INCLUDE( ${GTK_USE_FILE} )
133 INCLUDE( ${wxWidgets_USE_FILE} )
134 MARK_AS_ADVANCED(wxWidgets_CONFIG_EXECUTABLE)
135 SET(WXWIDGETS_LIBRARIES
141 ${wxWidgets_LIBRARIES}
145 ENDMACRO(CREA_USE_WXWIDGETS)
146 #=======================================================================
148 #=======================================================================
149 MACRO(CREA_FIND_AND_USE_WXWIDGETS)
150 CREA_FIND_WXWIDGETS()
152 ENDMACRO(CREA_FIND_AND_USE_WXWIDGETS)
153 #=======================================================================