]> Creatis software - bbtk.git/blob - kernel/cmake/FIND_AND_USE_WXWIDGETS.cmake
Allow user to always forget .bbs
[bbtk.git] / kernel / cmake / FIND_AND_USE_WXWIDGETS.cmake
1
2
3 MACRO(FIND_AND_USE_WXWIDGETS)
4
5   IF(WIN32)
6     # Search WXWIDGETS
7     
8     #  WXWINDOWS_LIBRARY         = full path to the wxWindows library and linker flags on unix
9     #  CMAKE_WX_CXX_FLAGS        = compiler flags for building wxWindows
10     #  WXWINDOWS_INCLUDE_PATH    = include path of wxWindows
11     #  WXWIDGETS_LIBRARIES       = wx libraries
12     
13     SET(WXWINDOWS_USE_GL 1)
14
15     #wxWidgets build related stuff
16     SET(WXW_USE_DEBUG    ON)
17     SET(WXW_USE_UNICODE  OFF)
18     SET(WXW_USE_SHARED   ON)
19     SET(WXW_USE_UNIV     OFF)
20     SET(WXW_USE_MONO     OFF)
21     SET(WXW_FILE_VERSION "28")
22     SET(WXW_VERSION      "2.8")
23     
24     #CMake Options
25     SET(CMAKE_VERBOSE_MAKEFILE TRUE)
26     
27     INCLUDE (cmake/FindwxW.cmake)
28     #
29     SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}${WXWIDGETS_CXX_FLAGS}")
30     SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}${WXWIDGETS_EXE_LINKER_FLAGS}")
31     ADD_DEFINITIONS( ${WXWIDGETS_DEFINITIONS}  )
32     #
33     INCLUDE_DIRECTORIES(${WXWIDGETS_INCLUDE_DIR})
34     LINK_DIRECTORIES( ${WXWIDGETS_LINK_DIRECTORIES} )
35     SET(WXWIDGETS_LIBRARIES
36       ${WXWIDGETS_LIBRARIES}     
37       debug msvcrtd
38       debug msvcprtd
39       optimized msvcrt
40       optimized msvcprt
41       )
42   ENDIF(WIN32)
43   IF(UNIX)
44     # GTK2
45     INCLUDE(cmake/FindGTK2.cmake)
46     INCLUDE_DIRECTORIES(${GTK2_INCLUDE_DIRS})
47     LINK_DIRECTORIES(${GTK2_LIBRARY_DIRS})
48     LINK_LIBRARIES(${GTK2_LIBRARIES})
49     # WX
50     #SET(wxWidgets_USE_LIBS base core gl)
51     FIND_PACKAGE( wxWidgets REQUIRED) 
52     INCLUDE( ${wxWidgets_USE_FILE} )
53     MARK_AS_ADVANCED(wxWidgets_CONFIG_EXECUTABLE)
54     SET(WXWIDGETS_LIBRARIES
55       ${wxWidgets_LIBRARIES}
56       ${GTK2_LIBRARIES}
57       )
58     MARK_AS_ADVANCED(GTK2_CAIRO_INCLUDE_PATH)
59     MARK_AS_ADVANCED(GTK2_GOBJECT_LIBRARY)
60   ENDIF(UNIX)
61
62 ENDMACRO(FIND_AND_USE_WXWIDGETS)
63