diff options
author | Miguel A. Figueroa-Villanueva <miguelf@ieee.org> | 2009-02-24 21:49:15 (GMT) |
---|---|---|
committer | Miguel A. Figueroa-Villanueva <miguelf@ieee.org> | 2009-02-24 21:49:15 (GMT) |
commit | cf55e01adadfa569715fac21373c7fda089b3fe8 (patch) | |
tree | e5dea908df163e37940509f2a440fd1fde44411b /Modules | |
parent | b5db18e72322862883e6d0695e3e0cc5826f39c9 (diff) | |
download | CMake-cf55e01adadfa569715fac21373c7fda089b3fe8.zip CMake-cf55e01adadfa569715fac21373c7fda089b3fe8.tar.gz CMake-cf55e01adadfa569715fac21373c7fda089b3fe8.tar.bz2 |
BUG: Using PROPERTY COMPILE_DEFINITIONS_DEBUG to support Debug only preprocessor options (e.g., _DEBUG __WXDEBUG__).
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/FindwxWidgets.cmake | 20 | ||||
-rw-r--r-- | Modules/UsewxWidgets.cmake | 9 |
2 files changed, 24 insertions, 5 deletions
diff --git a/Modules/FindwxWidgets.cmake b/Modules/FindwxWidgets.cmake index 11df1b5..b70122e 100644 --- a/Modules/FindwxWidgets.cmake +++ b/Modules/FindwxWidgets.cmake @@ -41,7 +41,9 @@ # rpath on UNIX. Typically an empty string # in WIN32 environment. # wxWidgets_DEFINITIONS - Contains defines required to compile/link -# against WX, e.g. -DWXUSINGDLL +# against WX, e.g. WXUSINGDLL +# wxWidgets_DEFINITIONS_DEBUG- Contains defines required to compile/link +# against WX debug builds, e.g. __WXDEBUG__ # wxWidgets_CXX_FLAGS - Include dirs and ompiler flags for # unices, empty on WIN32. Esentially # "`wx-config --cxxflags`". @@ -413,7 +415,7 @@ IF(wxWidgets_FIND_STYLE STREQUAL "win32") wxWidgets-2.7.4 wxWidgets-2.7.3 wxWidgets-2.7.2 - wxWidgest-2.7.1 + wxWidgets-2.7.1 wxWidgets-2.7.0 wxWidgets-2.7.0-1 wxWidgets-2.6.4 @@ -491,7 +493,7 @@ IF(wxWidgets_FIND_STYLE STREQUAL "win32") IF(WX_LIB_DIR) # If building shared libs, define WXUSINGDLL to use dllimport. IF(WX_LIB_DIR MATCHES ".*[dD][lL][lL].*") - SET(wxWidgets_DEFINITIONS "-DWXUSINGDLL") + SET(wxWidgets_DEFINITIONS WXUSINGDLL) DBG_MSG_V("detected SHARED/DLL tree WX_LIB_DIR=${WX_LIB_DIR}") ENDIF(WX_LIB_DIR MATCHES ".*[dD][lL][lL].*") @@ -564,6 +566,14 @@ IF(wxWidgets_FIND_STYLE STREQUAL "win32") # Settings for requested libs (i.e., include dir, libraries, etc.). WX_SET_LIBRARIES(wxWidgets_FIND_COMPONENTS "${DBG}") + # Add necessary definitions for unicode builds + IF("${UCD}" STREQUAL "u") + LIST(APPEND wxWidgets_DEFINITIONS UNICODE _UNICODE) + ENDIF("${UCD}" STREQUAL "u") + + # Add necessary definitions for debug builds + SET(wxWidgets_DEFINITIONS_DEBUG _DEBUG __WXDEBUG__) + ENDIF(WX_CONFIGURATION) ENDIF(WX_LIB_DIR) ENDIF(WX_ROOT_DIR) @@ -692,11 +702,13 @@ ELSE(wxWidgets_FIND_STYLE STREQUAL "win32") DBG_MSG_V("wxWidgets_CXX_FLAGS=${wxWidgets_CXX_FLAGS}") - # parse definitions from cxxflags; drop -D* from CXXFLAGS + # parse definitions from cxxflags; drop -D* from CXXFLAGS and the -D prefix STRING(REGEX MATCHALL "-D[^;]+" wxWidgets_DEFINITIONS "${wxWidgets_CXX_FLAGS}") STRING(REGEX REPLACE "-D[^;]+;" "" wxWidgets_CXX_FLAGS "${wxWidgets_CXX_FLAGS}") + STRING(REPLACE "-D" "" + wxWidgets_INCLUDE_DIRS "${wxWidgets_DEFINITIONS}") # parse include dirs from cxxflags; drop -I prefix STRING(REGEX MATCHALL "-I[^;]+" diff --git a/Modules/UsewxWidgets.cmake b/Modules/UsewxWidgets.cmake index 6f5cb26..df373bf 100644 --- a/Modules/UsewxWidgets.cmake +++ b/Modules/UsewxWidgets.cmake @@ -46,10 +46,17 @@ IF (wxWidgets_FOUND) ENDIF(wxWidgets_LIBRARY_DIRS) IF (wxWidgets_DEFINITIONS) - ADD_DEFINITIONS( ${wxWidgets_DEFINITIONS} ) + SET_PROPERTY(DIRECTORY APPEND + PROPERTY COMPILE_DEFINITIONS ${wxWidgets_DEFINITIONS}) MSG("wxWidgets_DEFINITIONS=${wxWidgets_DEFINITIONS}") ENDIF(wxWidgets_DEFINITIONS) + IF (wxWidgets_DEFINITIONS_DEBUG) + SET_PROPERTY(DIRECTORY APPEND + PROPERTY COMPILE_DEFINITIONS_DEBUG ${wxWidgets_DEFINITIONS_DEBUG}) + MSG("wxWidgets_DEFINITIONS_DEBUG=${wxWidgets_DEFINITIONS_DEBUG}") + ENDIF(wxWidgets_DEFINITIONS_DEBUG) + IF (wxWidgets_CXX_FLAGS) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${wxWidgets_CXX_FLAGS}") MSG("wxWidgets_CXX_FLAGS=${wxWidgets_CXX_FLAGS}") |