From 36c15a2f0bc0107074019901f3208891667a4546 Mon Sep 17 00:00:00 2001 From: "Miguel A. Figueroa-Villanueva" Date: Wed, 1 Sep 2010 00:15:07 -0400 Subject: [PATCH 1/5] BUG #10658: FindwxWidgets USE_FILE should not include .cmake extension. The wxWidgets_USE_FILE variable to be used with the include command should be set to UsewxWidgets; not UsewxWidgets.cmake. --- Modules/FindwxWidgets.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/FindwxWidgets.cmake b/Modules/FindwxWidgets.cmake index 90818bc64..cbc3e4b9a 100644 --- a/Modules/FindwxWidgets.cmake +++ b/Modules/FindwxWidgets.cmake @@ -188,7 +188,7 @@ IF(EXISTS "${wxWidgets_CURRENT_LIST_DIR}/UsewxWidgets.cmake") SET(wxWidgets_USE_FILE "${wxWidgets_CURRENT_LIST_DIR}/UsewxWidgets.cmake") ELSE(EXISTS "${wxWidgets_CURRENT_LIST_DIR}/UsewxWidgets.cmake") - SET(wxWidgets_USE_FILE UsewxWidgets.cmake) + SET(wxWidgets_USE_FILE UsewxWidgets) ENDIF(EXISTS "${wxWidgets_CURRENT_LIST_DIR}/UsewxWidgets.cmake") #===================================================================== From 6cb14ebf160b156e842c644392377fd6460327c6 Mon Sep 17 00:00:00 2001 From: "Miguel A. Figueroa-Villanueva" Date: Wed, 1 Sep 2010 09:34:57 -0400 Subject: [PATCH 2/5] STYLE: Clarified/Fixed documentation of UsewxWidgets. --- Modules/UsewxWidgets.cmake | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/Modules/UsewxWidgets.cmake b/Modules/UsewxWidgets.cmake index 037b7159f..3a4a38269 100644 --- a/Modules/UsewxWidgets.cmake +++ b/Modules/UsewxWidgets.cmake @@ -1,15 +1,12 @@ -# - Convenience include for using wxWidgets library -# Finds if wxWidgets is installed -# and set the appropriate libs, incdirs, flags etc. -# INCLUDE_DIRECTORIES, LINK_DIRECTORIES and ADD_DEFINITIONS -# are called. +# - Convenience include for using wxWidgets library. +# Determines if wxWidgets was FOUND and sets the appropriate libs, incdirs, +# flags, etc. INCLUDE_DIRECTORIES and LINK_DIRECTORIES are called. # # USAGE -# SET( wxWidgets_USE_LIBS gl xml xrc ) # optionally: more than wx std libs -# FIND_PACKAGE(wxWidgets REQUIRED) -# INCLUDE( ${xWidgets_USE_FILE} ) -# ... add your targets here, e.g. ADD_EXECUTABLE/ ADD_LIBRARY ... -# TARGET_LINK_LIBRARIERS( ${wxWidgets_LIBRARIES}) +# FIND_PACKAGE(wxWidgets REQUIRED base core gl net) +# INCLUDE(${wxWidgets_USE_FILE}) +# # and for each of your dependant executable/library targets: +# TARGET_LINK_LIBRARIES( ${wxWidgets_LIBRARIES}) # # DEPRECATED # LINK_LIBRARIES is not called in favor of adding dependencies per target. From f46712ebe7b3fe60a02f5fc5cf08cc861287c42b Mon Sep 17 00:00:00 2001 From: "Miguel A. Figueroa-Villanueva" Date: Wed, 1 Sep 2010 10:40:01 -0400 Subject: [PATCH 3/5] BUG #11123: Generic include dir should come after config specific one. --- Modules/FindwxWidgets.cmake | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Modules/FindwxWidgets.cmake b/Modules/FindwxWidgets.cmake index cbc3e4b9a..4da4c8e77 100644 --- a/Modules/FindwxWidgets.cmake +++ b/Modules/FindwxWidgets.cmake @@ -563,23 +563,23 @@ IF(wxWidgets_FIND_STYLE STREQUAL "win32") # Get configuration parameters from the name. WX_GET_NAME_COMPONENTS(${wxWidgets_CONFIGURATION} UNV UCD DBG) + # Set wxWidgets lib setup include directory. + IF(EXISTS ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}/wx/setup.h) + SET(wxWidgets_INCLUDE_DIRS + ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}) + ELSE(EXISTS ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}/wx/setup.h) + DBG_MSG("wxWidgets_FOUND FALSE because ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}/wx/setup.h does not exists.") + SET(wxWidgets_FOUND FALSE) + ENDIF(EXISTS ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}/wx/setup.h) + # Set wxWidgets main include directory. IF(EXISTS ${WX_ROOT_DIR}/include/wx/wx.h) - SET(wxWidgets_INCLUDE_DIRS ${WX_ROOT_DIR}/include) + LIST(APPEND wxWidgets_INCLUDE_DIRS ${WX_ROOT_DIR}/include) ELSE(EXISTS ${WX_ROOT_DIR}/include/wx/wx.h) DBG_MSG("wxWidgets_FOUND FALSE because WX_ROOT_DIR=${WX_ROOT_DIR} has no ${WX_ROOT_DIR}/include/wx/wx.h") SET(wxWidgets_FOUND FALSE) ENDIF(EXISTS ${WX_ROOT_DIR}/include/wx/wx.h) - # Set wxWidgets lib setup include directory. - IF(EXISTS ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}/wx/setup.h) - LIST(APPEND wxWidgets_INCLUDE_DIRS - ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}) - ELSE(EXISTS ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}/wx/setup.h) - DBG_MSG("WXWIDGET_FOUND FALSE because ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}/wx/setup.h does not exists.") - SET(wxWidgets_FOUND FALSE) - ENDIF(EXISTS ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}/wx/setup.h) - # Find wxWidgets libraries. WX_FIND_LIBS("${UNV}" "${UCD}" "${DBG}") IF(WX_USE_REL_AND_DBG) From 3dbeeb77934d6dff85c71b001e07622c5ac6fe4c Mon Sep 17 00:00:00 2001 From: "Miguel A. Figueroa-Villanueva" Date: Wed, 1 Sep 2010 12:27:31 -0400 Subject: [PATCH 4/5] BUG #8184: Fixed FindwxWidgets wrong order of default libs for MinGW. Also fixed usage sample in comments, which can be misleading for MinGW users as demonstrated by mantis issue #10089. --- Modules/FindwxWidgets.cmake | 9 +++++---- Modules/UsewxWidgets.cmake | 3 ++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Modules/FindwxWidgets.cmake b/Modules/FindwxWidgets.cmake index 4da4c8e77..08b37c37d 100644 --- a/Modules/FindwxWidgets.cmake +++ b/Modules/FindwxWidgets.cmake @@ -4,7 +4,7 @@ # modules that you will use, you need to name them as components to # the package: # -# FIND_PACKAGE(wxWidgets COMPONENTS base core ...) +# FIND_PACKAGE(wxWidgets COMPONENTS core base ...) # # There are two search branches: a windows style and a unix style. For # windows, the following variables are searched for and set to @@ -54,7 +54,8 @@ # wxWidgets_USE_FILE - Convenience include file. # # Sample usage: -# FIND_PACKAGE(wxWidgets COMPONENTS base core gl net) +# # Note that for MinGW users the order of libs is important! +# FIND_PACKAGE(wxWidgets COMPONENTS net gl core base) # IF(wxWidgets_FOUND) # INCLUDE(${wxWidgets_USE_FILE}) # # and for each of your dependent executable/library targets: @@ -62,7 +63,7 @@ # ENDIF(wxWidgets_FOUND) # # If wxWidgets is required (i.e., not an optional part): -# FIND_PACKAGE(wxWidgets REQUIRED base core gl net) +# FIND_PACKAGE(wxWidgets REQUIRED net gl core base) # INCLUDE(${wxWidgets_USE_FILE}) # # and for each of your dependent executable/library targets: # TARGET_LINK_LIBRARIES( ${wxWidgets_LIBRARIES}) @@ -213,7 +214,7 @@ IF(wxWidgets_FIND_STYLE STREQUAL "win32") IF(wxWidgets_USE_MONOLITHIC) SET(wxWidgets_FIND_COMPONENTS mono) ELSE(wxWidgets_USE_MONOLITHIC) - SET(wxWidgets_FIND_COMPONENTS base core) # this is default + SET(wxWidgets_FIND_COMPONENTS core base) # this is default ENDIF(wxWidgets_USE_MONOLITHIC) ENDIF(NOT wxWidgets_FIND_COMPONENTS) diff --git a/Modules/UsewxWidgets.cmake b/Modules/UsewxWidgets.cmake index 3a4a38269..9ecfff0cc 100644 --- a/Modules/UsewxWidgets.cmake +++ b/Modules/UsewxWidgets.cmake @@ -3,7 +3,8 @@ # flags, etc. INCLUDE_DIRECTORIES and LINK_DIRECTORIES are called. # # USAGE -# FIND_PACKAGE(wxWidgets REQUIRED base core gl net) +# # Note that for MinGW users the order of libs is important! +# FIND_PACKAGE(wxWidgets REQUIRED net gl core base) # INCLUDE(${wxWidgets_USE_FILE}) # # and for each of your dependant executable/library targets: # TARGET_LINK_LIBRARIES( ${wxWidgets_LIBRARIES}) From ede24f817124293de7d1d22353c0e6e81f250ebe Mon Sep 17 00:00:00 2001 From: "Miguel A. Figueroa-Villanueva" Date: Sun, 5 Sep 2010 09:39:37 -0400 Subject: [PATCH 5/5] ENH #8993: FindwxWidgets add support for wx-config custom options. Added suport for setting a custom toolkit, refix, etc. when using wx-config. --- Modules/FindwxWidgets.cmake | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/Modules/FindwxWidgets.cmake b/Modules/FindwxWidgets.cmake index 08b37c37d..d991cd492 100644 --- a/Modules/FindwxWidgets.cmake +++ b/Modules/FindwxWidgets.cmake @@ -32,7 +32,14 @@ # wxWidgets_USE_UNICODE # wxWidgets_USE_UNIVERSAL # wxWidgets_USE_STATIC -# +# +# There is also a wxWidgets_CONFIG_OPTIONS variable for all other +# options that need to be passed to the wx-config utility. For +# example, to use the base toolkit found in the /usr/local path, set +# the variable (before calling the FIND_PACKAGE command) as such: +# +# SET(wxWidgets_CONFIG_OPTIONS --toolkit=base --prefix=/usr) +# # The following are set after the configuration is done for both # windows and unix style: # @@ -615,7 +622,8 @@ ELSE(wxWidgets_FIND_STYLE STREQUAL "win32") # MACRO(WX_CONFIG_SELECT_GET_DEFAULT) EXECUTE_PROCESS( - COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}" --selected-config + COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}" + ${wxWidgets_CONFIG_OPTIONS} --selected-config OUTPUT_VARIABLE _wx_selected_config RESULT_VARIABLE _wx_result ERROR_QUIET @@ -643,13 +651,15 @@ ELSE(wxWidgets_FIND_STYLE STREQUAL "win32") # MACRO(WX_CONFIG_SELECT_QUERY_BOOL _OPT_NAME _OPT_HELP) EXECUTE_PROCESS( - COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}" --${_OPT_NAME}=yes + COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}" + ${wxWidgets_CONFIG_OPTIONS} --${_OPT_NAME}=yes RESULT_VARIABLE _wx_result_yes OUTPUT_QUIET ERROR_QUIET ) EXECUTE_PROCESS( - COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}" --${_OPT_NAME}=no + COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}" + ${wxWidgets_CONFIG_OPTIONS} --${_OPT_NAME}=no RESULT_VARIABLE _wx_result_no OUTPUT_QUIET ERROR_QUIET @@ -675,7 +685,7 @@ ELSE(wxWidgets_FIND_STYLE STREQUAL "win32") # among multiple builds. # MACRO(WX_CONFIG_SELECT_SET_OPTIONS) - SET(wxWidgets_SELECT_OPTIONS "") + SET(wxWidgets_SELECT_OPTIONS ${wxWidgets_CONFIG_OPTIONS}) FOREACH(_opt_name debug static unicode universal) STRING(TOUPPER ${_opt_name} _upper_opt_name) IF(DEFINED wxWidgets_USE_${_upper_opt_name})