From cc9b6fa5a4c16e9d5a0e666fccef77e4ff541e6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20A=2E=20Col=C3=B3n=20V=C3=A9lez?= Date: Thu, 8 Jan 2015 22:27:16 -0500 Subject: [PATCH 1/4] Search for wx-config-3.0 and wxrc-3.0. The comment made it look as an arch-only thing which was misleading. . Gentoo uses wx-config-3.0 and wxrc-3.0 --- cmake/SearchForStuff.cmake | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cmake/SearchForStuff.cmake b/cmake/SearchForStuff.cmake index 8f172386cd..f9db6c437f 100644 --- a/cmake/SearchForStuff.cmake +++ b/cmake/SearchForStuff.cmake @@ -23,15 +23,12 @@ else() set(wxWidgets_CONFIG_OPTIONS --unicode=yes) endif() -# Temprorary help for Arch-based distros. -# They have wx2.8, lib32-wx2.8 and wx3.0 but no lib32-wx3.0. # wx2.8 => /usr/bin/wx-config-2.8, /usr/bin/wxrc-2.8 # lib32-wx2.8 => /usr/bin/wx-config32-2.8, /usr/bin/wxrc32-2.8 -# wx3.0 => /usr/bin/wx-config, /usr/bin/wxrc -> /usr/bin/wxrc-3.0 +# wx3.0 => /usr/bin/wx-config-3.0, /usr/bin/wxrc-3.0 # I'm going to take a wild guess and predict this: # lib32-wx3.0 => /usr/bin/wx-config32-3.0, /usr/bin/wxrc32-3.0 -# FindwxWidgets only searches for wxrc and wx-config. Therefore only native -# wx3.0 works since everything else has non-standard naming. +# FindwxWidgets only searches for wxrc and wx-config. if(CMAKE_CROSSCOMPILING) # May need to fix the filenames for lib32-wx3.0. if(NOT WX28_API AND ${PCSX2_TARGET_ARCHITECTURES} MATCHES "i386" AND EXISTS "/usr/bin/wx-config32-3.0" AND EXISTS "/usr/bin/wxrc32-3.0") @@ -42,7 +39,10 @@ if(CMAKE_CROSSCOMPILING) set(wxWidgets_wxrc_EXECUTABLE "/usr/bin/wxrc32-2.8") endif() else() - if(WX28_API AND EXISTS "/usr/bin/wx-config-2.8" AND EXISTS "/usr/bin/wxrc-2.8") + if(NOT WX28_API AND EXISTS "/usr/bin/wx-config-3.0" AND EXISTS "/usr/bin/wxrc-3.0") + set(wxWidgets_CONFIG_EXECUTABLE "/usr/bin/wx-config-3.0") + set(wxWidgets_wxrc_EXECUTABLE "/usr/bin/wxrc-3.0") + elseif(WX28_API AND EXISTS "/usr/bin/wx-config-2.8" AND EXISTS "/usr/bin/wxrc-2.8") set(wxWidgets_CONFIG_EXECUTABLE "/usr/bin/wx-config-2.8") set(wxWidgets_wxrc_EXECUTABLE "/usr/bin/wxrc-2.8") endif() From 3b83d6d302d9921e6eae96e117775440412ab46b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20A=2E=20Col=C3=B3n=20V=C3=A9lez?= Date: Fri, 9 Jan 2015 07:10:11 -0500 Subject: [PATCH 2/4] Make FindwxWidgets find the correct version/toolkit via wx-config. WX_vs_SDL() is still needed. --- cmake/SearchForStuff.cmake | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/cmake/SearchForStuff.cmake b/cmake/SearchForStuff.cmake index f9db6c437f..cfbe8f8c52 100644 --- a/cmake/SearchForStuff.cmake +++ b/cmake/SearchForStuff.cmake @@ -23,6 +23,18 @@ else() set(wxWidgets_CONFIG_OPTIONS --unicode=yes) endif() +if(WX28_API) + list(APPEND wxWidgets_CONFIG_OPTIONS --version=2.8) +else() + list(APPEND wxWidgets_CONFIG_OPTIONS --version=3.0) +endif() + +if(GTK3_API) + list(APPEND wxWidgets_CONFIG_OPTIONS --toolkit=gtk3) +else() + list(APPEND wxWidgets_CONFIG_OPTIONS --toolkit=gtk2) +endif() + # wx2.8 => /usr/bin/wx-config-2.8, /usr/bin/wxrc-2.8 # lib32-wx2.8 => /usr/bin/wx-config32-2.8, /usr/bin/wxrc32-2.8 # wx3.0 => /usr/bin/wx-config-3.0, /usr/bin/wxrc-3.0 @@ -157,5 +169,3 @@ include_directories(${CMAKE_SOURCE_DIR}/common/include #---------------------------------------- include(ApiValidation) WX_vs_SDL() -WX_vs_GTK3() -WX_version() From 90c4322fc5124889e02b16f28d48a9e690a7358f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20A=2E=20Col=C3=B3n=20V=C3=A9lez?= Date: Fri, 9 Jan 2015 07:44:26 -0500 Subject: [PATCH 3/4] Remove check for wxrc since it's not needed. --- cmake/SearchForStuff.cmake | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/cmake/SearchForStuff.cmake b/cmake/SearchForStuff.cmake index cfbe8f8c52..8c8918e72a 100644 --- a/cmake/SearchForStuff.cmake +++ b/cmake/SearchForStuff.cmake @@ -35,28 +35,24 @@ else() list(APPEND wxWidgets_CONFIG_OPTIONS --toolkit=gtk2) endif() -# wx2.8 => /usr/bin/wx-config-2.8, /usr/bin/wxrc-2.8 -# lib32-wx2.8 => /usr/bin/wx-config32-2.8, /usr/bin/wxrc32-2.8 -# wx3.0 => /usr/bin/wx-config-3.0, /usr/bin/wxrc-3.0 +# wx2.8 => /usr/bin/wx-config-2.8 +# lib32-wx2.8 => /usr/bin/wx-config32-2.8 +# wx3.0 => /usr/bin/wx-config-3.0 # I'm going to take a wild guess and predict this: -# lib32-wx3.0 => /usr/bin/wx-config32-3.0, /usr/bin/wxrc32-3.0 -# FindwxWidgets only searches for wxrc and wx-config. +# lib32-wx3.0 => /usr/bin/wx-config32-3.0 +# FindwxWidgets only searches for wx-config. if(CMAKE_CROSSCOMPILING) # May need to fix the filenames for lib32-wx3.0. - if(NOT WX28_API AND ${PCSX2_TARGET_ARCHITECTURES} MATCHES "i386" AND EXISTS "/usr/bin/wx-config32-3.0" AND EXISTS "/usr/bin/wxrc32-3.0") + if(NOT WX28_API AND ${PCSX2_TARGET_ARCHITECTURES} MATCHES "i386" AND EXISTS "/usr/bin/wx-config32-3.0") set(wxWidgets_CONFIG_EXECUTABLE "/usr/bin/wx-config32-3.0") - set(wxWidgets_wxrc_EXECUTABLE "/usr/bin/wxrc32-3.0") - elseif(WX28_API AND ${PCSX2_TARGET_ARCHITECTURES} MATCHES "i386" AND EXISTS "/usr/bin/wx-config32-2.8" AND EXISTS "/usr/bin/wxrc32-2.8") + elseif(WX28_API AND ${PCSX2_TARGET_ARCHITECTURES} MATCHES "i386" AND EXISTS "/usr/bin/wx-config32-2.8") set(wxWidgets_CONFIG_EXECUTABLE "/usr/bin/wx-config32-2.8") - set(wxWidgets_wxrc_EXECUTABLE "/usr/bin/wxrc32-2.8") endif() else() - if(NOT WX28_API AND EXISTS "/usr/bin/wx-config-3.0" AND EXISTS "/usr/bin/wxrc-3.0") + if(NOT WX28_API AND EXISTS "/usr/bin/wx-config-3.0") set(wxWidgets_CONFIG_EXECUTABLE "/usr/bin/wx-config-3.0") - set(wxWidgets_wxrc_EXECUTABLE "/usr/bin/wxrc-3.0") - elseif(WX28_API AND EXISTS "/usr/bin/wx-config-2.8" AND EXISTS "/usr/bin/wxrc-2.8") + elseif(WX28_API AND EXISTS "/usr/bin/wx-config-2.8") set(wxWidgets_CONFIG_EXECUTABLE "/usr/bin/wx-config-2.8") - set(wxWidgets_wxrc_EXECUTABLE "/usr/bin/wxrc-2.8") endif() endif() From f160c398149422e43dcf90b3211b23005f4e3d28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20A=2E=20Col=C3=B3n=20V=C3=A9lez?= Date: Mon, 12 Jan 2015 02:54:49 -0500 Subject: [PATCH 4/4] Remove dead code from cmake/ApiValidation.cmake. --- cmake/ApiValidation.cmake | 45 --------------------------------------- 1 file changed, 45 deletions(-) diff --git a/cmake/ApiValidation.cmake b/cmake/ApiValidation.cmake index 0e0f7f5e3c..489e1413dd 100644 --- a/cmake/ApiValidation.cmake +++ b/cmake/ApiValidation.cmake @@ -6,14 +6,6 @@ set(wx_sdl_c_code " #endif ") -set(wx_gtk3_c_code " -#include - -#ifdef __WXGTK3__ -#error cmake_WX_GTK3 -#endif -") - function(WX_vs_SDL) file(WRITE "${CMAKE_BINARY_DIR}/wx_sdl.c" "${wx_sdl_c_code}") enable_language(C) @@ -32,41 +24,4 @@ function(WX_vs_SDL) Unfortunately you try to build PCSX2 with SDL2 support which is not compatible Please use -DSDL2_API=FALSE") endif() - -endfunction() - -function(WX_vs_GTK3) - file(WRITE "${CMAKE_BINARY_DIR}/wx_gtk3.c" "${wx_gtk3_c_code}") - enable_language(C) - - try_run( - run_result_unused - compile_result_unused - "${CMAKE_BINARY_DIR}" - "${CMAKE_BINARY_DIR}/wx_gtk3.c" - COMPILE_OUTPUT_VARIABLE OUT - CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:STRING=${wxWidgets_INCLUDE_DIRS}" - ) - - if (${OUT} MATCHES "cmake_WX_GTK3") - if (NOT GTK3_API) - message(FATAL_ERROR "Your current WxWidget version requires GTK3. Please use -DGTK3_API=TRUE option") - endif() - else() - if (GTK3_API) - message(FATAL_ERROR "Your current WxWidget version doesn't support GTK3. Please use -DGTK3_API=FALSE option") - endif() - endif() - -endfunction() - -function(WX_version) - EXECUTE_PROCESS(COMMAND ${wxWidgets_CONFIG_EXECUTABLE} --version OUTPUT_VARIABLE version) - STRING(STRIP ${version} version) - if (${version} MATCHES "3.0" AND WX28_API) - message(FATAL_ERROR "Mismatch between wx-config version (${version}) and requested WX API (2.8.x)") - endif() - if (${version} MATCHES "2.8" AND NOT WX28_API) - message(FATAL_ERROR "Mismatch between wx-config version (${version}) and requested WX API (3.0.x)") - endif() endfunction()