ENH: fix bug where sharedforward would not work if there was a space in the path...
[cmake.git] / Modules / Use_wxWindows.cmake
blobda8bdd1beedcdfb54cce4cb092e05b229d50f50e
2 # This convenience include finds if wxWindows is installed
3 # and set the appropriate libs, incdirs, flags etc.
4 # author Jan Woetzel <jw -at- mip.informatik.uni-kiel.de> (07/2003)
5 ##
6 # -----------------------------------------------------
7 # USAGE:
8 #   just include Use_wxWindows.cmake
9 #   in your projects CMakeLists.txt
10 # INCLUDE( ${CMAKE_MODULE_PATH}/Use_wxWindows.cmake)
12 #   if you are sure you need GL then
13 # SET(WXWINDOWS_USE_GL 1)
14 #   *before* you include this file.
16 # -----------------------------------------------------
17 # 16.Feb.2004: changed INCLUDE to FIND_PACKAGE to read from users own non-system CMAKE_MODULE_PATH (Jan Woetzel JW)
18 # 07/2006: rewrite as FindwxWidgets.cmake, kept for backward compatibilty JW
20 MESSAGE(STATUS "Use_wxWindows.cmake is DEPRECATED. \n"
21 "Please use FIND_PACKAGE(wxWidgets) and INCLUDE(${wxWidgets_USE_FILE}) instead. (JW)")
24 # ------------------------
26 FIND_PACKAGE( wxWindows )
28 IF(WXWINDOWS_FOUND)
30 #MESSAGE("DBG Use_wxWindows.cmake:  WXWINDOWS_INCLUDE_DIR=${WXWINDOWS_INCLUDE_DIR} WXWINDOWS_LINK_DIRECTORIES=${WXWINDOWS_LINK_DIRECTORIES}     WXWINDOWS_LIBRARIES=${WXWINDOWS_LIBRARIES}  CMAKE_WXWINDOWS_CXX_FLAGS=${CMAKE_WXWINDOWS_CXX_FLAGS} WXWINDOWS_DEFINITIONS=${WXWINDOWS_DEFINITIONS}")
32  IF(WXWINDOWS_INCLUDE_DIR)
33     INCLUDE_DIRECTORIES(${WXWINDOWS_INCLUDE_DIR})
34   ENDIF(WXWINDOWS_INCLUDE_DIR)
35  IF(WXWINDOWS_LINK_DIRECTORIES)
36     LINK_DIRECTORIES(${WXWINDOWS_LINK_DIRECTORIES})
37   ENDIF(WXWINDOWS_LINK_DIRECTORIES)
38   IF(WXWINDOWS_LIBRARIES)
39     LINK_LIBRARIES(${WXWINDOWS_LIBRARIES})
40   ENDIF(WXWINDOWS_LIBRARIES)
41   IF (CMAKE_WXWINDOWS_CXX_FLAGS)
42     SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_WXWINDOWS_CXX_FLAGS}")
43   ENDIF(CMAKE_WXWINDOWS_CXX_FLAGS)
44   IF(WXWINDOWS_DEFINITIONS)
45     ADD_DEFINITIONS(${WXWINDOWS_DEFINITIONS})
46   ENDIF(WXWINDOWS_DEFINITIONS)
47 ELSE(WXWINDOWS_FOUND)
48   MESSAGE(SEND_ERROR "wxWindows not found by Use_wxWindows.cmake")
49 ENDIF(WXWINDOWS_FOUND)