diff --git a/ports/gppanel/CMakeLists.txt b/ports/gppanel/CMakeLists.txt index e300f285409121..9073014bbbfa94 100644 --- a/ports/gppanel/CMakeLists.txt +++ b/ports/gppanel/CMakeLists.txt @@ -3,7 +3,6 @@ project(gpPanel CXX) set(wxWidgets_EXCLUDE_COMMON_LIBRARIES TRUE) find_package(wxWidgets REQUIRED COMPONENTS core base) -include(${wxWidgets_USE_FILE}) file(GLOB_RECURSE SOURCES "gpPanel/*.cpp") file(GLOB HEADERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/include" "include/*.h") diff --git a/ports/gppanel/vcpkg.json b/ports/gppanel/vcpkg.json index 2493d41a8172b7..5e9afab0b090f3 100644 --- a/ports/gppanel/vcpkg.json +++ b/ports/gppanel/vcpkg.json @@ -1,7 +1,7 @@ { "name": "gppanel", "version-date": "2020-05-20", - "port-version": 1, + "port-version": 2, "description": "gpPanel is chart library for wxWidget. It inheritance from wxPanel and use modified wxMathPlot library at chart engine.", "homepage": "https://github.com/woollybah/gppanel", "dependencies": [ diff --git a/ports/wxwidgets/export-targets.patch b/ports/wxwidgets/export-targets.patch new file mode 100644 index 00000000000000..e305028d0bc51f --- /dev/null +++ b/ports/wxwidgets/export-targets.patch @@ -0,0 +1,223 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 4063020..6dfe09c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -78,3 +78,51 @@ include(build/cmake/main.cmake) + if(wxBUILD_SAMPLES AND wxUSE_GUI) + set_directory_properties(PROPERTIES VS_STARTUP_PROJECT minimal) + endif() ++ ++file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/unofficial-wxwidgets-config.cmake.in" ++[[include(CMakeFindDependencyMacro) ++if (@wxUSE_ZLIB@ STREQUAL "sys") ++ find_dependency(ZLIB) ++endif() ++if (@wxUSE_EXPAT@ STREQUAL "sys") ++ find_dependency(EXPAT) ++endif() ++if (@wxUSE_LIBJPEG@ STREQUAL "sys") ++ find_dependency(JPEG) ++endif() ++if (@wxUSE_LIBPNG@ STREQUAL "sys") ++ find_dependency(PNG) ++endif() ++if (@wxUSE_LIBTIFF@ STREQUAL "sys") ++ find_dependency(TIFF) ++endif() ++ ++list(APPEND TARGET_FILES wxregex wxscintilla wxbase wxcore) ++if (@wxUSE_OPENGL@) ++ list(APPEND TARGET_FILES wxgl) ++endif() ++if (@wxUSE_XML@) ++ list(APPEND TARGET_FILES wxxml) ++endif() ++list(APPEND TARGET_FILES wxhtml wxxrc wxstc wxwebview) ++if (@wxUSE_SOCKETS@) ++ list(APPEND TARGET_FILES wxnet) ++endif() ++list(APPEND TARGET_FILES wxpropgrid) ++if (@wxUSE_DEBUGREPORT@) ++ list(APPEND TARGET_FILES wxqa) ++endif() ++list(APPEND TARGET_FILES wxribbon wxrichtext) ++if (@wxUSE_MEDIACTRL@) ++ list(APPEND TARGET_FILES wxmedia) ++endif() ++list(APPEND TARGET_FILES wxadv wxaui) ++ ++foreach (TARGET_FILE ${TARGET_FILES}) ++ include("${CMAKE_CURRENT_LIST_DIR}/unofficial-${TARGET_FILE}Targets.cmake") ++endforeach() ++ ++set(wxWidgets_CONFIG_EXECUTABLE "${CMAKE_CURRENT_LIST_DIR}/../../tools/wxwidgets/wx-config") ++]]) ++configure_file(${CMAKE_CURRENT_BINARY_DIR}/unofficial-wxwidgets-config.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/unofficial-wxwidgets-config.cmake @ONLY) ++install(FILES ${CMAKE_CURRENT_BINARY_DIR}/unofficial-wxwidgets-config.cmake DESTINATION share/unofficial-wxwidgets) +\ No newline at end of file +diff --git a/build/cmake/functions.cmake b/build/cmake/functions.cmake +index e99555e..468426e 100644 +--- a/build/cmake/functions.cmake ++++ b/build/cmake/functions.cmake +@@ -257,13 +257,20 @@ function(wx_set_target_properties target_name is_base) + target_include_directories(${target_name} + BEFORE + PUBLIC +- ${wxSETUP_HEADER_PATH} +- ${wxSOURCE_DIR}/include ++ "$" ++ "$" ++ $ + ) + ++ if (NOT MSVC) ++ target_include_directories(${target_name} ++ PUBLIC $ ++ ) ++ endif() ++ + if(wxTOOLKIT_INCLUDE_DIRS) + target_include_directories(${target_name} +- PUBLIC ${wxTOOLKIT_INCLUDE_DIRS}) ++ PUBLIC "$") + endif() + + if (WIN32) +@@ -371,12 +378,14 @@ macro(wx_add_library name) + set_target_properties(${name} PROPERTIES PROJECT_LABEL ${name_short}) + + # Setup install +- wx_install(TARGETS ${name} ++ wx_install(TARGETS ${name} EXPORT unofficial-${name}Targets + LIBRARY DESTINATION "lib${wxPLATFORM_LIB_DIR}" + ARCHIVE DESTINATION "lib${wxPLATFORM_LIB_DIR}" + RUNTIME DESTINATION "bin${wxPLATFORM_LIB_DIR}" + BUNDLE DESTINATION Applications/wxWidgets + ) ++ ++ install(EXPORT unofficial-${name}Targets NAMESPACE wx:: DESTINATION share/unofficial-wxwidgets) + endif() + endmacro() + +@@ -453,7 +462,18 @@ macro(wx_lib_include_directories name) + if (_LIB_INCLUDE_DIRS_PRIVATE) + set(INCLUDE_POS BEFORE) + endif() +- target_include_directories(${name};${INCLUDE_POS};${ARGN}) ++ if (_LIB_INCLUDE_DIRS_PUBLIC) ++ foreach (PUBLIC_DIR ${_LIB_INCLUDE_DIRS_PUBLIC}) ++ target_include_directories(${name};${INCLUDE_POS};PUBLIC;$) ++ endforeach() ++ endif() ++ if (_LIB_INCLUDE_DIRS_PRIVATE) ++ target_include_directories(${name};${INCLUDE_POS};PRIVATE;${_LIB_INCLUDE_DIRS_PRIVATE}) ++ endif() ++ target_include_directories(${name};PUBLIC;$) ++ if (NOT MSVC) ++ target_include_directories(${name};PUBLIC;$) ++ endif() + endif() + endmacro() + +@@ -514,8 +534,14 @@ function(wx_set_builtin_target_properties target_name) + target_include_directories(${target_name} + BEFORE + PUBLIC +- ${wxSETUP_HEADER_PATH} ++ "$" ++ $ + ) ++ if (NOT MSVC) ++ target_include_directories(${target_name} ++ PUBLIC $ ++ ) ++ endif() + + set_target_properties(${target_name} PROPERTIES FOLDER "Third Party Libraries") + +@@ -789,10 +815,10 @@ function(wx_add name group) + endif() + + if(group STREQUAL Samples) +- target_include_directories(${target_name} PRIVATE ${wxSOURCE_DIR}/samples) ++ target_include_directories(${target_name} PRIVATE "$") + elseif(group STREQUAL Tests) +- target_include_directories(${target_name} PRIVATE ${wxSOURCE_DIR}/tests) +- target_include_directories(${target_name} PRIVATE ${wxSOURCE_DIR}/3rdparty/catch/include) ++ target_include_directories(${target_name} PRIVATE "$") ++ target_include_directories(${target_name} PRIVATE "$") + endif() + + if(APP_DATA) +diff --git a/build/cmake/lib/CMakeLists.txt b/build/cmake/lib/CMakeLists.txt +index 5c574c7..5497605 100644 +--- a/build/cmake/lib/CMakeLists.txt ++++ b/build/cmake/lib/CMakeLists.txt +@@ -86,11 +86,11 @@ if(wxBUILD_MONOLITHIC) + target_link_libraries(wxmono ${vis} ${wxMONO_LIBS_${vis}}) + endif() + if(wxMONO_INCLUDE_DIRS_${vis}) +- set(INCLUDE_POS) + if (vis STREQUAL PRIVATE) +- set(INCLUDE_POS BEFORE) ++ target_include_directories(wxmono BEFORE ${vis} ${wxMONO_INCLUDE_DIRS_${vis}}) ++ else() ++ target_include_directories(wxmono ${vis} "$") + endif() +- target_include_directories(wxmono ${INCLUDE_POS} ${vis} ${wxMONO_INCLUDE_DIRS_${vis}}) + endif() + if(wxMONO_DEFINITIONS_${vis}) + target_compile_definitions(wxmono ${vis} ${wxMONO_DEFINITIONS_${vis}}) +diff --git a/build/cmake/lib/regex.cmake b/build/cmake/lib/regex.cmake +index b28fc2c..a78c2da 100644 +--- a/build/cmake/lib/regex.cmake ++++ b/build/cmake/lib/regex.cmake +@@ -18,4 +18,13 @@ if(wxUSE_REGEX) + target_include_directories(wxregex PRIVATE ${wxSETUP_HEADER_PATH} ${wxSOURCE_DIR}/include) + set(REGEX_LIBRARIES wxregex) + set(REGEX_INCLUDE_DIRS ${wxSOURCE_DIR}/src/regex) ++ ++ install(TARGETS wxregex EXPORT unofficial-wxregexTargets ++ LIBRARY DESTINATION "lib${wxPLATFORM_LIB_DIR}" ++ ARCHIVE DESTINATION "lib${wxPLATFORM_LIB_DIR}" ++ RUNTIME DESTINATION "bin${wxPLATFORM_LIB_DIR}" ++ BUNDLE DESTINATION Applications/wxWidgets ++ ) ++ ++ install(EXPORT unofficial-wxregexTargets NAMESPACE wx:: DESTINATION share/unofficial-wxwidgets) + endif() +diff --git a/build/cmake/lib/stc/CMakeLists.txt b/build/cmake/lib/stc/CMakeLists.txt +index bd6acd8..c8c5ff5 100644 +--- a/build/cmake/lib/stc/CMakeLists.txt ++++ b/build/cmake/lib/stc/CMakeLists.txt +@@ -182,6 +182,15 @@ if(wxBUILD_PRECOMP) + wx_target_enable_precomp(wxscintilla ${wxSCINTILLA_PREC_HEADER}) + endif() + ++install(TARGETS wxscintilla EXPORT unofficial-wxscintillaTargets ++ LIBRARY DESTINATION "lib${wxPLATFORM_LIB_DIR}" ++ ARCHIVE DESTINATION "lib${wxPLATFORM_LIB_DIR}" ++ RUNTIME DESTINATION "bin${wxPLATFORM_LIB_DIR}" ++ BUNDLE DESTINATION Applications/wxWidgets ++ ) ++ ++install(EXPORT unofficial-wxscintillaTargets NAMESPACE wx:: DESTINATION share/unofficial-wxwidgets) ++ + wx_add_library(wxstc ${STC_FILES}) + wx_lib_include_directories(wxstc PRIVATE + ${wxSOURCE_DIR}/src/stc/scintilla/include +diff --git a/build/cmake/lib/webview/CMakeLists.txt b/build/cmake/lib/webview/CMakeLists.txt +index cc3298f..1d47e56 100644 +--- a/build/cmake/lib/webview/CMakeLists.txt ++++ b/build/cmake/lib/webview/CMakeLists.txt +@@ -132,8 +132,8 @@ if(WXGTK AND wxUSE_WEBVIEW_WEBKIT2) + ) + + target_include_directories(wxwebkit2_ext PUBLIC +- ${LIBSOUP_INCLUDE_DIRS} +- ${WEBKIT2_INCLUDE_DIR} ++ "$" ++ "$" + ) + target_link_libraries(wxwebkit2_ext PUBLIC + ${LIBSOUP_LIBRARIES} diff --git a/ports/wxwidgets/fix-file-generate.patch b/ports/wxwidgets/fix-file-generate.patch new file mode 100644 index 00000000000000..b98692b0ac74b3 --- /dev/null +++ b/ports/wxwidgets/fix-file-generate.patch @@ -0,0 +1,13 @@ +diff --git a/build/cmake/modules/cotire.cmake b/build/cmake/modules/cotire.cmake +index bb69643..99b0cb6 100644 +--- a/build/cmake/modules/cotire.cmake ++++ b/build/cmake/modules/cotire.cmake +@@ -2371,7 +2371,7 @@ function (cotire_generate_target_script _language _configurations _target _targe + # use file(GENERATE ...) to expand generator expressions in the target script at CMake generate-time + set (_configNameOrNoneGeneratorExpression "$<$:None>$<$>:$>") + set (_targetCotireConfigScript "${CMAKE_CURRENT_BINARY_DIR}/${_target}_${_language}_${_configNameOrNoneGeneratorExpression}_${_moduleName}") +- file (GENERATE OUTPUT "${_targetCotireConfigScript}" INPUT "${_targetCotireScript}") ++ file (GENERATE OUTPUT "${_targetCotireConfigScript}" INPUT "${_targetCotireScript}" TARGET "${_target}") + else() + set (_targetCotireConfigScript "${_targetCotireScript}") + endif() diff --git a/ports/wxwidgets/fix-install-path.patch b/ports/wxwidgets/fix-install-path.patch new file mode 100644 index 00000000000000..f24290111df88f --- /dev/null +++ b/ports/wxwidgets/fix-install-path.patch @@ -0,0 +1,13 @@ +diff --git a/build/cmake/functions.cmake b/build/cmake/functions.cmake +index 902b7c5..e99555e 100644 +--- a/build/cmake/functions.cmake ++++ b/build/cmake/functions.cmake +@@ -374,7 +374,7 @@ macro(wx_add_library name) + wx_install(TARGETS ${name} + LIBRARY DESTINATION "lib${wxPLATFORM_LIB_DIR}" + ARCHIVE DESTINATION "lib${wxPLATFORM_LIB_DIR}" +- RUNTIME DESTINATION "lib${wxPLATFORM_LIB_DIR}" ++ RUNTIME DESTINATION "bin${wxPLATFORM_LIB_DIR}" + BUNDLE DESTINATION Applications/wxWidgets + ) + endif() diff --git a/ports/wxwidgets/fix-wx-config-path.patch b/ports/wxwidgets/fix-wx-config-path.patch new file mode 100644 index 00000000000000..e4ce406b94d5d7 --- /dev/null +++ b/ports/wxwidgets/fix-wx-config-path.patch @@ -0,0 +1,38 @@ +diff --git a/build/cmake/install.cmake b/build/cmake/install.cmake +index 968dff8..4699f63 100644 +--- a/build/cmake/install.cmake ++++ b/build/cmake/install.cmake +@@ -44,10 +44,12 @@ else() + ) + + install(DIRECTORY DESTINATION "bin") ++ install(FILES ${CMAKE_INSTALL_PREFIX}/lib/wx/config/${wxBUILD_FILE_ID} ++ DESTINATION ${CMAKE_INSTALL_PREFIX}/bin RENAME wx-config ++ ) + install(CODE "execute_process( \ +- COMMAND ${CMAKE_COMMAND} -E create_symlink \ +- ${CMAKE_INSTALL_PREFIX}/lib/wx/config/${wxBUILD_FILE_ID} \ +- ${CMAKE_INSTALL_PREFIX}/bin/wx-config \ ++ COMMAND sh -c \"chmod u+x \ ++ ${CMAKE_INSTALL_PREFIX}/bin/wx-config\" \ + )" + ) + endif() +diff --git a/wx-config.in b/wx-config.in +index 441f88c..ca68a80 100644 +--- a/wx-config.in ++++ b/wx-config.in +@@ -402,7 +402,12 @@ is_cross() { [ "x@cross_compiling@" = "xyes" ]; } + + + # Determine the base directories we require. +-prefix=${input_option_prefix-${this_prefix:-@prefix@}} ++base_folder=$(dirname $(readlink -f "$0")) ++if [ "@CMAKE_BUILD_TYPE@" = "Debug" ]; then ++ prefix=${input_option_prefix-${this_prefix:-${base_folder}/../../..}} ++else ++ prefix=${input_option_prefix-${this_prefix:-${base_folder}/../..}} ++fi + exec_prefix=${input_option_exec_prefix-${input_option_prefix-${this_exec_prefix:-@exec_prefix@}}} + wxconfdir="@libdir@/wx/config" + diff --git a/ports/wxwidgets/fix-wxconfig-libs-output.patch b/ports/wxwidgets/fix-wxconfig-libs-output.patch new file mode 100644 index 00000000000000..37762f9165d055 --- /dev/null +++ b/ports/wxwidgets/fix-wxconfig-libs-output.patch @@ -0,0 +1,46 @@ +diff --git a/build/cmake/config.cmake b/build/cmake/config.cmake +index 91d11ac..4e22ee9 100644 +--- a/build/cmake/config.cmake ++++ b/build/cmake/config.cmake +@@ -41,7 +41,40 @@ macro(wx_get_dependencies var lib) + endif() + set(dep_name "-l${dep_name}") + else() +- get_filename_component(dep_name ${dep} NAME) ++ if (CMAKE_BUILD_TYPE STREQUAL "Release") ++ # For "$<$:" ++ set(CONFIG_TYPE_INVERT "CONFIG:DEBUG>:") ++ else() ++ # For "$<$>:" ++ set(CONFIG_TYPE_INVERT "CONFIG:DEBUG>>:") ++ endif() ++ if (dep MATCHES "${CONFIG_TYPE_INVERT}") ++ continue() ++ endif() ++ string(REGEX REPLACE "^.+>:(.+)>$" "\\1" dep_path ${dep}) ++ if (NOT dep_path) ++ set(dep_name ${dep}) ++ else() ++ string(REGEX MATCH "^-.*$" ADDED_PREFIX ${dep_path}) ++ if (ADDED_PREFIX) ++ set(dep_name ${dep_path}) ++ else() ++ get_filename_component(abs_path ${dep_path} PATH) ++ if (NOT abs_path) ++ string(REGEX MATCH "^lib(.*).a$" CURR_STATIC_NAME ${dep_path}) ++ string(REGEX MATCH "^lib(.*).so$" CURR_DYNAMIC_NAME ${dep_path}) ++ if (CURR_STATIC_NAME) ++ set(dep_name "-l${CURR_STATIC_NAME}") ++ elseif (CURR_DYNAMIC_NAME) ++ set(dep_name "-l${CURR_DYNAMIC_NAME}") ++ else() ++ set(dep_name "-l${dep_path}") ++ endif() ++ else() ++ set(dep_name ${dep_path}) ++ endif() ++ endif() ++ endif() + endif() + wx_string_append(${var} "${dep_name} ") + endforeach() diff --git a/ports/wxwidgets/portfile.cmake b/ports/wxwidgets/portfile.cmake index 5b5ecd730724d9..9c06c532564113 100644 --- a/ports/wxwidgets/portfile.cmake +++ b/ports/wxwidgets/portfile.cmake @@ -9,6 +9,11 @@ vcpkg_from_github( PATCHES disable-platform-lib-dir.patch fix-build.patch + fix-wx-config-path.patch + fix-install-path.patch + export-targets.patch + fix-wxconfig-libs-output.patch # Remove this patch in the next update + fix-file-generate.patch # https://github.com/wxWidgets/wxWidgets/pull/2404 ) set(OPTIONS) @@ -47,40 +52,32 @@ vcpkg_configure_cmake( vcpkg_install_cmake() -file(GLOB DLLS "${CURRENT_PACKAGES_DIR}/lib/*.dll") -if(DLLS) - file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/bin) - foreach(DLL ${DLLS}) - get_filename_component(N "${DLL}" NAME) - file(RENAME ${DLL} ${CURRENT_PACKAGES_DIR}/bin/${N}) - endforeach() -endif() -file(GLOB DLLS "${CURRENT_PACKAGES_DIR}/debug/lib/*.dll") -if(DLLS) - file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/bin) - foreach(DLL ${DLLS}) - get_filename_component(N "${DLL}" NAME) - file(RENAME ${DLL} ${CURRENT_PACKAGES_DIR}/debug/bin/${N}) - endforeach() -endif() +vcpkg_copy_pdbs() -if(VCPKG_TARGET_IS_WINDOWS) - vcpkg_copy_tools(TOOL_NAMES wxrc AUTO_CLEAN) -else() - vcpkg_copy_tools(TOOL_NAMES wxrc wx-config wxrc-3.1 AUTO_CLEAN) -endif() +vcpkg_fixup_cmake_targets(CONFIG_PATH share/unofficial-wxwidgets TARGET_PATH share/unofficial-wxwidgets) -# do the copy pdbs now after the dlls got moved to the expected /bin folder above -vcpkg_copy_pdbs() +set(tools wxrc) +if(NOT VCPKG_TARGET_IS_WINDOWS) + list(APPEND tools wx-config wxrc-3.1) +endif() +if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") + # Copy debug tools + vcpkg_copy_tools( + TOOL_NAMES ${tools} + SEARCH_DIR "${CURRENT_PACKAGES_DIR}/debug/bin" + DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}/debug" + ) +endif() +vcpkg_copy_tools(TOOL_NAMES ${tools} AUTO_CLEAN) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/include/msvc) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(GLOB_RECURSE INCLUDES ${CURRENT_PACKAGES_DIR}/include/*.h) -if(EXISTS ${CURRENT_PACKAGES_DIR}/lib/mswu/wx/setup.h) - list(APPEND INCLUDES ${CURRENT_PACKAGES_DIR}/lib/mswu/wx/setup.h) +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include/msvc") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +file(GLOB_RECURSE INCLUDES "${CURRENT_PACKAGES_DIR}/include/*.h") +if(EXISTS "${CURRENT_PACKAGES_DIR}/lib/mswu/wx/setup.h") + list(APPEND INCLUDES "${CURRENT_PACKAGES_DIR}/lib/mswu/wx/setup.h") endif() -if(EXISTS ${CURRENT_PACKAGES_DIR}/debug/lib/mswud/wx/setup.h) - list(APPEND INCLUDES ${CURRENT_PACKAGES_DIR}/debug/lib/mswud/wx/setup.h) +if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib/mswud/wx/setup.h") + list(APPEND INCLUDES "${CURRENT_PACKAGES_DIR}/debug/lib/mswud/wx/setup.h") endif() foreach(INC IN LISTS INCLUDES) file(READ "${INC}" _contents) @@ -94,9 +91,9 @@ foreach(INC IN LISTS INCLUDES) file(WRITE "${INC}" "${_contents}") endforeach() -if(NOT EXISTS ${CURRENT_PACKAGES_DIR}/include/wx/setup.h) - file(GLOB_RECURSE WX_SETUP_H_FILES_DBG ${CURRENT_PACKAGES_DIR}/debug/lib/*.h) - file(GLOB_RECURSE WX_SETUP_H_FILES_REL ${CURRENT_PACKAGES_DIR}/lib/*.h) +if(NOT EXISTS "${CURRENT_PACKAGES_DIR}/include/wx/setup.h") + file(GLOB_RECURSE WX_SETUP_H_FILES_DBG "${CURRENT_PACKAGES_DIR}/debug/lib/*.h") + file(GLOB_RECURSE WX_SETUP_H_FILES_REL "${CURRENT_PACKAGES_DIR}/lib/*.h") string(REPLACE "${CURRENT_PACKAGES_DIR}/debug/lib/" "" WX_SETUP_H_FILES_DBG "${WX_SETUP_H_FILES_DBG}") string(REPLACE "/setup.h" "" WX_SETUP_H_DBG_RELATIVE "${WX_SETUP_H_FILES_DBG}") @@ -104,8 +101,17 @@ if(NOT EXISTS ${CURRENT_PACKAGES_DIR}/include/wx/setup.h) string(REPLACE "${CURRENT_PACKAGES_DIR}/lib/" "" WX_SETUP_H_FILES_REL "${WX_SETUP_H_FILES_REL}") string(REPLACE "/setup.h" "" WX_SETUP_H_REL_RELATIVE "${WX_SETUP_H_FILES_REL}") - configure_file(${CMAKE_CURRENT_LIST_DIR}/setup.h.in ${CURRENT_PACKAGES_DIR}/include/wx/setup.h @ONLY) + configure_file("${CMAKE_CURRENT_LIST_DIR}/setup.h.in" "${CURRENT_PACKAGES_DIR}/include/wx/setup.h" @ONLY) endif() -file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/wxwidgets) -configure_file(${CMAKE_CURRENT_LIST_DIR}/usage ${CURRENT_PACKAGES_DIR}/share/wxwidgets/usage COPYONLY) -file(INSTALL ${SOURCE_PATH}/docs/licence.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) + +# Fix the abs path in wx-config +if (NOT VCPKG_TARGET_IS_WINDOWS) + file(READ "${CURRENT_PACKAGES_DIR}/tools/wxwidgets/wx-config" _contents) + string(REGEX REPLACE "${CURRENT_PACKAGES_DIR}" "\${prefix}" _contents "${_contents}") + string(REGEX REPLACE "${CURRENT_INSTALLED_DIR}" "\${prefix}" _contents "${_contents}") + file(WRITE "${CURRENT_PACKAGES_DIR}/tools/wxwidgets/wx-config" "${_contents}") +endif() + +configure_file("${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake.in" + "${CURRENT_PACKAGES_DIR}/share/wxwidgets/vcpkg-cmake-wrapper.cmake" @ONLY) +file(INSTALL "${SOURCE_PATH}/docs/licence.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/ports/wxwidgets/usage b/ports/wxwidgets/usage index e873e4ae343aa8..98e0713e82fb22 100644 --- a/ports/wxwidgets/usage +++ b/ports/wxwidgets/usage @@ -3,3 +3,4 @@ The package wxwidgets provides CMake integration: find_package(wxWidgets REQUIRED) target_include_directories(main PRIVATE ${wxWidgets_INCLUDE_DIRS}) target_link_libraries(main PRIVATE ${wxWidgets_LIBRARIES}) + target_compile_options(main PRIVATE ${wxWidgets_FLAGS}) diff --git a/ports/wxwidgets/vcpkg-cmake-wrapper.cmake b/ports/wxwidgets/vcpkg-cmake-wrapper.cmake deleted file mode 100644 index 55557b36097a05..00000000000000 --- a/ports/wxwidgets/vcpkg-cmake-wrapper.cmake +++ /dev/null @@ -1,25 +0,0 @@ -set(wxWidgets_ROOT_DIR "${CMAKE_CURRENT_LIST_DIR}/../.." CACHE INTERNAL "" FORCE) -set(WX_ROOT_DIR "${wxWidgets_ROOT_DIR}") -set(wxWidgets_LIB_DIR "${wxWidgets_ROOT_DIR}/lib" CACHE INTERNAL "" FORCE) -set(WX_LIB_DIR "${wxWidgets_LIB_DIR}") -find_library(WX_based NAMES wxbase31ud PATHS "${wxWidgets_ROOT_DIR}/debug/lib" NO_DEFAULT_PATH) -file(GLOB WX_DEBUG_LIBS "${wxWidgets_ROOT_DIR}/debug/lib/wx*d_*.lib") -foreach(WX_DEBUG_LIB ${WX_DEBUG_LIBS}) - string(REGEX REPLACE ".*wx([^/]*)d_([^/\\.]*)\\.[^/\\.]*\$" "WX_\\2d" varname "${WX_DEBUG_LIB}") - set(${varname} "${WX_DEBUG_LIB}" CACHE INTERNAL "" FORCE) -endforeach() -_find_package(${ARGS}) -find_package(ZLIB QUIET) -find_package(libpng CONFIG QUIET) -find_package(TIFF QUIET) -find_package(expat CONFIG QUIET) - -if(wxWidgets_LIBRARIES AND NOT wxWidgets_LIBRARIES MATCHES "TIFF::TIFF;png;expat::expat;ZLIB::ZLIB") - list(APPEND wxWidgets_LIBRARIES "TIFF::TIFF;expat::expat;ZLIB::ZLIB") - - if (TARGET png) - list(APPEND wxWidgets_LIBRARIES "png") - elseif(TARGET png_static) - list(APPEND wxWidgets_LIBRARIES "png_static") - endif() -endif() diff --git a/ports/wxwidgets/vcpkg-cmake-wrapper.cmake.in b/ports/wxwidgets/vcpkg-cmake-wrapper.cmake.in new file mode 100644 index 00000000000000..680b303f090a6b --- /dev/null +++ b/ports/wxwidgets/vcpkg-cmake-wrapper.cmake.in @@ -0,0 +1,22 @@ +_find_package(unofficial-wxwidgets CONFIG REQUIRED) + +set(wxWidgets_FOUND 1) +file(GLOB WX_TARGETS ${CMAKE_CURRENT_LIST_DIR}/../unofficial-wxwidgets/unofficial*Targets.cmake) +foreach(WX_TARGET ${WX_TARGETS}) + get_filename_component(TARGET_FILE ${WX_TARGET} NAME) + string(REGEX REPLACE "unofficial-(.+)Targets.cmake" "wx::\\1" TARGET_NAME ${TARGET_FILE}) + list(APPEND wxWidgets_LIBRARIES ${TARGET_NAME}) +endforeach() + +get_target_property(wxWidgets_INCLUDE_DIR wx::wxbase INTERFACE_INCLUDE_DIRECTORIES) +set(wxWidgets_INCLUDE_DIRS ${wxWidgets_INCLUDE_DIR}) + +# Get extra cpp flags +if (UNIX) + execute_process( + COMMAND @CURRENT_INSTALLED_DIR@/tools/wxwidgets/wx-config@VCPKG_TARGET_EXECUTABLE_SUFFIX@ --cxxflags + OUTPUT_VARIABLE OUTPUT_FLAGS + ) + + string(REGEX MATCHALL "(-D[^ ]+)" wxWidgets_FLAGS "${OUTPUT_FLAGS}") +endif() \ No newline at end of file diff --git a/ports/wxwidgets/vcpkg.json b/ports/wxwidgets/vcpkg.json index 540e2147fc7923..4121b491552669 100644 --- a/ports/wxwidgets/vcpkg.json +++ b/ports/wxwidgets/vcpkg.json @@ -1,7 +1,7 @@ { "name": "wxwidgets", "version-semver": "3.1.5", - "port-version": 3, + "port-version": 4, "description": [ "Widget toolkit and tools library for creating graphical user interfaces (GUIs) for cross-platform applications. ", "Set WXWIDGETS_USE_STL in a custom triplet to build with the wxUSE_STL build option." diff --git a/scripts/azure-pipelines/linux/provision-image.sh b/scripts/azure-pipelines/linux/provision-image.sh index 66d8fe9321d2c3..e74247df0e3cb9 100755 --- a/scripts/azure-pipelines/linux/provision-image.sh +++ b/scripts/azure-pipelines/linux/provision-image.sh @@ -51,6 +51,9 @@ APT_PACKAGES="$APT_PACKAGES python2 python-is-python3" # Additionally required/installed by Azure DevOps Scale Set Agents APT_PACKAGES="$APT_PACKAGES liblttng-ust0 libkrb5-3 zlib1g libicu66" +# Additionally required by wxwidegets +APT_PACKAGES="$APT_PACKAGES libgtk-3-dev" + sudo apt -y install $APT_PACKAGES # Install newer version of nasm than the apt package, required by intel-ipsec diff --git a/scripts/ci.baseline.txt b/scripts/ci.baseline.txt index 1129af095404d0..9316c3cf4af55c 100644 --- a/scripts/ci.baseline.txt +++ b/scripts/ci.baseline.txt @@ -1644,7 +1644,6 @@ wintoast:x64-uwp=fail wpilib:arm64-windows=fail wpilib:x64-osx=fail wxchartdir:x64-osx=fail -wxwidgets:x64-linux=fail x265:arm64-windows=fail x265:arm-uwp=fail x265:x64-uwp=fail diff --git a/versions/baseline.json b/versions/baseline.json index 52e6abb4e428c1..1331fabe8f87ba 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -2410,7 +2410,7 @@ }, "gppanel": { "baseline": "2020-05-20", - "port-version": 1 + "port-version": 2 }, "graphene": { "baseline": "1.10.2", diff --git a/versions/g-/gppanel.json b/versions/g-/gppanel.json index 5b4ec4c3bafff0..c51fcadb218231 100644 --- a/versions/g-/gppanel.json +++ b/versions/g-/gppanel.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "0120fbac078c45f40169c68b6b4b107e64b4c150", + "version-date": "2020-05-20", + "port-version": 2 + }, { "git-tree": "4cc181130888f98e2495b4a1f342b28a532f28b4", "version-date": "2020-05-20", diff --git a/versions/w-/wxwidgets.json b/versions/w-/wxwidgets.json index d674192ce108db..f2ade9a9c85381 100644 --- a/versions/w-/wxwidgets.json +++ b/versions/w-/wxwidgets.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "e8dec57de7c4d7c31f123d67a38631b713c5dee4", + "version-semver": "3.1.5", + "port-version": 4 + }, { "git-tree": "dcd0a52fd041f8c7b658a01ec1141f36d77220c6", "version-semver": "3.1.5",