From e69755c2037318236d7db2a114417222a06560e6 Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Sun, 17 May 2020 19:41:02 +0200 Subject: [PATCH 1/7] CMake: check if the compiler supports using precompiled headers Build the cotire test project and check if it succeeds. Also check if the 'had text segment at different address' warning does not appear in the build output. If it does not succeed, disable usage of precompiled headers. If the PCH option was changed, clean the project and rebuild it again. Do not clean everytime the project is configured because (re)building the cotire test project takes some time. --- build/cmake/init.cmake | 34 +++++++++++++++++++ .../cmake/modules/cotire_test/CMakeLists.txt | 21 ++++++++++++ build/cmake/modules/cotire_test/license | 22 ++++++++++++ .../modules/cotire_test/src/CMakeLists.txt | 31 +++++++++++++++++ .../cmake/modules/cotire_test/src/example.cpp | 24 +++++++++++++ build/cmake/modules/cotire_test/src/example.h | 10 ++++++ build/cmake/modules/cotire_test/src/log.cpp | 17 ++++++++++ build/cmake/modules/cotire_test/src/log.h | 10 ++++++ build/cmake/modules/cotire_test/src/main.cpp | 12 +++++++ 9 files changed, 181 insertions(+) create mode 100644 build/cmake/modules/cotire_test/CMakeLists.txt create mode 100644 build/cmake/modules/cotire_test/license create mode 100644 build/cmake/modules/cotire_test/src/CMakeLists.txt create mode 100644 build/cmake/modules/cotire_test/src/example.cpp create mode 100644 build/cmake/modules/cotire_test/src/example.h create mode 100644 build/cmake/modules/cotire_test/src/log.cpp create mode 100644 build/cmake/modules/cotire_test/src/log.h create mode 100644 build/cmake/modules/cotire_test/src/main.cpp diff --git a/build/cmake/init.cmake b/build/cmake/init.cmake index 6709c371b8..2fdb787484 100644 --- a/build/cmake/init.cmake +++ b/build/cmake/init.cmake @@ -530,3 +530,37 @@ if(wxUSE_GUI) set(wxUSE_LIBGNOMEVFS OFF) endif() endif() + +# test if precompiled headers are supported using the cotire test project +if(DEFINED wxBUILD_PRECOMP_PREV AND NOT wxBUILD_PRECOMP STREQUAL wxBUILD_PRECOMP_PREV) + set(CLEAN_PRECOMP_TEST TRUE) +endif() +set(wxBUILD_PRECOMP_PREV ${wxBUILD_PRECOMP} CACHE INTERNAL "") + +if(wxBUILD_PRECOMP) + if (CLEAN_PRECOMP_TEST) + try_compile(RESULT_VAR_CLEAN + "${wxBINARY_DIR}/CMakeFiles/cotire_test" + "${wxSOURCE_DIR}/build/cmake/modules/cotire_test" + CotireExample clean_cotire + ) + endif() + try_compile(RESULT_VAR + "${wxBINARY_DIR}/CMakeFiles/cotire_test" + "${wxSOURCE_DIR}/build/cmake/modules/cotire_test" + CotireExample OUTPUT_VARIABLE OUTPUT_VAR + ) + + # check if output has precompiled header warnings. The build can still succeed, so check the output + # likely caused by gcc hardening: https://bugzilla.redhat.com/show_bug.cgi?id=1721553 + # cc1plus: warning /path/to/project/cotire/name_CXX_prefix.hxx.gch: had text segment at different address + string(FIND "${OUTPUT_VAR}" "had text segment at different address" HAS_MESSAGE) + if(${HAS_MESSAGE} GREATER -1) + set(RESULT_VAR FALSE) + endif() + + if(NOT RESULT_VAR) + message(WARNING "precompiled header (PCH) test failed, it will be turned off") + wx_option_force_value(wxBUILD_PRECOMP OFF) + endif() +endif(wxBUILD_PRECOMP) diff --git a/build/cmake/modules/cotire_test/CMakeLists.txt b/build/cmake/modules/cotire_test/CMakeLists.txt new file mode 100644 index 0000000000..dd1426208f --- /dev/null +++ b/build/cmake/modules/cotire_test/CMakeLists.txt @@ -0,0 +1,21 @@ +# cotire example project + +cmake_minimum_required(VERSION 2.8.12) + +if (POLICY CMP0058) + # Ninja requires custom command byproducts to be explicit + cmake_policy(SET CMP0058 NEW) +endif() + +project (CotireExample) + +set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/..") + +if (NOT CMAKE_VERSION VERSION_LESS "3.1.0") + set (CMAKE_CXX_STANDARD "98") + set (CMAKE_CXX_EXTENSIONS OFF) +endif() + +include(cotire) + +add_subdirectory(src) diff --git a/build/cmake/modules/cotire_test/license b/build/cmake/modules/cotire_test/license new file mode 100644 index 0000000000..68c37ca2d5 --- /dev/null +++ b/build/cmake/modules/cotire_test/license @@ -0,0 +1,22 @@ +Copyright (c) 2012-2018 Sascha Kratky + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/build/cmake/modules/cotire_test/src/CMakeLists.txt b/build/cmake/modules/cotire_test/src/CMakeLists.txt new file mode 100644 index 0000000000..92df233550 --- /dev/null +++ b/build/cmake/modules/cotire_test/src/CMakeLists.txt @@ -0,0 +1,31 @@ +# cotire example project + +add_executable(example main.cpp example.cpp log.cpp log.h example.h) + +# enable warnings +if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + set_target_properties(example PROPERTIES COMPILE_FLAGS "-Weverything") +elseif (CMAKE_CXX_COMPILER_ID MATCHES "GNU") + set_target_properties(example PROPERTIES COMPILE_FLAGS "-Wall -Wextra") +endif() + +cotire(example) + +# cotire sets the following properties +get_target_property(_unitySource example COTIRE_CXX_UNITY_SOURCE) +get_target_property(_prefixHeader example COTIRE_CXX_PREFIX_HEADER) +get_target_property(_precompiledHeader example COTIRE_CXX_PRECOMPILED_HEADER) +get_target_property(_unityTargetName example COTIRE_UNITY_TARGET_NAME) + +if (_unitySource) + message(STATUS "example unity source: ${_unitySource}") +endif() +if (_prefixHeader) + message(STATUS "example prefix header: ${_prefixHeader}") +endif() +if (_precompiledHeader) + message(STATUS "example precompiled header: ${_precompiledHeader}") +endif() +if (TARGET ${_unityTargetName}) + message(STATUS "example unity target: ${_unityTargetName}") +endif() diff --git a/build/cmake/modules/cotire_test/src/example.cpp b/build/cmake/modules/cotire_test/src/example.cpp new file mode 100644 index 0000000000..a85731507a --- /dev/null +++ b/build/cmake/modules/cotire_test/src/example.cpp @@ -0,0 +1,24 @@ +// cotire example project + +#include "example.h" + +#ifndef NDEBUG +#include +#include +#endif + +namespace example { + +std::string get_message() { + char msg_chrs[] = { 'C', 'o', 't', 'i', 'r', 'e', 'd', '!' }; +#ifdef NDEBUG + return std::string(&msg_chrs[0], &msg_chrs[sizeof(msg_chrs)]); +#else + std::string msg; + msg.reserve(sizeof(msg_chrs)); + std::copy(msg_chrs, msg_chrs + sizeof(msg_chrs), std::back_inserter(msg)); + return msg; +#endif +} + +} diff --git a/build/cmake/modules/cotire_test/src/example.h b/build/cmake/modules/cotire_test/src/example.h new file mode 100644 index 0000000000..0fe3e235cc --- /dev/null +++ b/build/cmake/modules/cotire_test/src/example.h @@ -0,0 +1,10 @@ +// cotire example project + +#include + +namespace example { + +std::string get_message(); + +} + diff --git a/build/cmake/modules/cotire_test/src/log.cpp b/build/cmake/modules/cotire_test/src/log.cpp new file mode 100644 index 0000000000..5294adb827 --- /dev/null +++ b/build/cmake/modules/cotire_test/src/log.cpp @@ -0,0 +1,17 @@ +// cotire example project + +#include "log.h" + +#include + +namespace logging { + +void error(const std::string& msg) { + std::cerr << msg << std::endl; +} + +void info(const std::string& msg) { + std::cout << msg << std::endl; +} + +} diff --git a/build/cmake/modules/cotire_test/src/log.h b/build/cmake/modules/cotire_test/src/log.h new file mode 100644 index 0000000000..a6ce24a1e8 --- /dev/null +++ b/build/cmake/modules/cotire_test/src/log.h @@ -0,0 +1,10 @@ +// cotire example project + +#include + +namespace logging { + +void error(const std::string& msg); +void info(const std::string& msg); + +} diff --git a/build/cmake/modules/cotire_test/src/main.cpp b/build/cmake/modules/cotire_test/src/main.cpp new file mode 100644 index 0000000000..2ea1af6217 --- /dev/null +++ b/build/cmake/modules/cotire_test/src/main.cpp @@ -0,0 +1,12 @@ +// cotire example project main + +#include + +#include "example.h" +#include "log.h" + +int main() +{ + std::string msg = example::get_message(); + logging::info(msg); +} From ef741462cdd4e089bc3e583845e8368c4d23f41d Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Sun, 17 May 2020 19:41:12 +0200 Subject: [PATCH 2/7] CMake: fix file names in info header --- build/cmake/policies.cmake | 2 +- build/cmake/source_groups.cmake | 2 +- build/cmake/tests/drawing/CMakeLists.txt | 2 +- build/cmake/tests/gui/CMakeLists.txt | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build/cmake/policies.cmake b/build/cmake/policies.cmake index f68682df02..14aaeef17a 100644 --- a/build/cmake/policies.cmake +++ b/build/cmake/policies.cmake @@ -1,5 +1,5 @@ ############################################################################# -# Name: CMakeLists.txt +# Name: build/cmake/policies.cmake # Purpose: CMake policies for wxWidgets # Author: Tobias Taschner # Created: 2016-10-21 diff --git a/build/cmake/source_groups.cmake b/build/cmake/source_groups.cmake index d3123b48a6..7e8ba95f4b 100644 --- a/build/cmake/source_groups.cmake +++ b/build/cmake/source_groups.cmake @@ -1,5 +1,5 @@ ############################################################################# -# Name: build/cmake/main.cmake +# Name: build/cmake/source_groups.cmake # Purpose: CMake source groups file # Author: Tobias Taschner # Created: 2016-10-14 diff --git a/build/cmake/tests/drawing/CMakeLists.txt b/build/cmake/tests/drawing/CMakeLists.txt index 995186c272..98977d07b6 100644 --- a/build/cmake/tests/drawing/CMakeLists.txt +++ b/build/cmake/tests/drawing/CMakeLists.txt @@ -1,5 +1,5 @@ ############################################################################# -# Name: build/cmake/tests/base/CMakeLists.txt +# Name: build/cmake/tests/drawing/CMakeLists.txt # Purpose: CMake file for drawing test # Author: Tobias Taschner # Created: 2016-10-31 diff --git a/build/cmake/tests/gui/CMakeLists.txt b/build/cmake/tests/gui/CMakeLists.txt index 75db39bb99..f9da139a0b 100644 --- a/build/cmake/tests/gui/CMakeLists.txt +++ b/build/cmake/tests/gui/CMakeLists.txt @@ -1,5 +1,5 @@ ############################################################################# -# Name: build/cmake/tests/base/CMakeLists.txt +# Name: build/cmake/tests/gui/CMakeLists.txt # Purpose: CMake file for gui test # Author: Tobias Taschner # Created: 2016-10-31 From 498b79d619f730a0ceb4b460ef0527380a76bd3a Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Sun, 17 May 2020 19:41:22 +0200 Subject: [PATCH 3/7] CMake: copy data of widgets sample to correct directory --- build/cmake/functions.cmake | 17 +++++++++++++---- build/cmake/samples/CMakeLists.txt | 2 +- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/build/cmake/functions.cmake b/build/cmake/functions.cmake index 03004a9181..1aafa4a983 100644 --- a/build/cmake/functions.cmake +++ b/build/cmake/functions.cmake @@ -599,7 +599,7 @@ endfunction() # all following parameters a src files for the executable # source files are relative to samples/${name}/ # Optionally: -# DATA followed by required data files +# DATA followed by required data files. Use a colon to separate different source and dest paths # DEFINITIONS list of definitions for the target # FOLDER subfolder in IDE # LIBRARIES followed by required libraries @@ -715,10 +715,19 @@ function(wx_add_sample name) if(SAMPLE_DATA) # TODO: handle data files differently for OS X bundles # Copy data files to output directory - foreach(data_file ${SAMPLE_DATA}) + foreach(data_src ${SAMPLE_DATA}) + string(FIND ${data_src} ":" HAS_COLON) + if(${HAS_COLON} GREATER -1) + MATH(EXPR DEST_INDEX "${HAS_COLON}+1") + string(SUBSTRING ${data_src} ${DEST_INDEX} -1 data_dst) + string(SUBSTRING ${data_src} 0 ${HAS_COLON} data_src) + else() + set(data_dst ${data_src}) + endif() + list(APPEND cmds COMMAND ${CMAKE_COMMAND} - -E copy ${wxSOURCE_DIR}/samples/${wxSAMPLE_SUBDIR}${name}/${data_file} - ${wxOUTPUT_DIR}/${wxPLATFORM_LIB_DIR}/${data_file}) + -E copy ${wxSOURCE_DIR}/samples/${wxSAMPLE_SUBDIR}${name}/${data_src} + ${wxOUTPUT_DIR}/${wxPLATFORM_LIB_DIR}/${data_dst}) endforeach() add_custom_command( TARGET ${target_name} ${cmds} diff --git a/build/cmake/samples/CMakeLists.txt b/build/cmake/samples/CMakeLists.txt index 7b3a9dead2..044d9cb1df 100644 --- a/build/cmake/samples/CMakeLists.txt +++ b/build/cmake/samples/CMakeLists.txt @@ -213,7 +213,7 @@ wx_list_add_prefix(WIDGETS_RC_FILES icons/ stattext.xpm text.xpm timepick.xpm toggle.xpm ) wx_add_sample(widgets IMPORTANT ${SAMPLE_WIDGETS_SRC} - DATA ${WIDGETS_RC_FILES} textctrl.cpp ../image/toucan.png + DATA ${WIDGETS_RC_FILES} textctrl.cpp ../image/toucan.png:toucan.png ) wx_add_sample(wizard DEPENDS wxUSE_WIZARDDLG) wx_add_sample(wrapsizer) From 0c2d05f52fc83673a0c38261c9258d1ccd780301 Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Sun, 17 May 2020 19:41:33 +0200 Subject: [PATCH 4/7] CMake: add library aliases using wx:: namespace --- build/cmake/functions.cmake | 9 +++++++++ build/cmake/policies.cmake | 5 +++++ 2 files changed, 14 insertions(+) diff --git a/build/cmake/functions.cmake b/build/cmake/functions.cmake index 1aafa4a983..3d93ac9e09 100644 --- a/build/cmake/functions.cmake +++ b/build/cmake/functions.cmake @@ -334,6 +334,7 @@ macro(wx_add_library name) endif() add_library(${name} ${wxBUILD_LIB_TYPE} ${src_files}) + add_library(wx::${name} ALIAS ${name}) wx_set_target_properties(${name} ${wxADD_LIBRARY_IS_BASE}) # Setup install @@ -501,7 +502,15 @@ endfunction() # Add a third party builtin library function(wx_add_builtin_library name) wx_list_add_prefix(src_list "${wxSOURCE_DIR}/" ${ARGN}) + + if(${name} MATCHES "wx.*") + string(SUBSTRING ${name} 2 -1 name_short) + else() + set(name_short ${name}) + endif() + add_library(${name} STATIC ${src_list}) + add_library(wx::${name_short} ALIAS ${name}) wx_set_builtin_target_properties(${name}) if(wxBUILD_SHARED) set_target_properties(${name} PROPERTIES POSITION_INDEPENDENT_CODE TRUE) diff --git a/build/cmake/policies.cmake b/build/cmake/policies.cmake index 14aaeef17a..1a7415d0e1 100644 --- a/build/cmake/policies.cmake +++ b/build/cmake/policies.cmake @@ -14,6 +14,11 @@ if(POLICY CMP0025) cmake_policy(SET CMP0025 NEW) endif() +if(POLICY CMP0028) + # Double colon in target name means ALIAS or IMPORTED target. + cmake_policy(SET CMP0028 NEW) +endif() + if(POLICY CMP0038) # targets may not link directly to themselves cmake_policy(SET CMP0038 NEW) From 0f806ad96db4e22053769c0b2f3b7be4026ea8de Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Sun, 17 May 2020 19:41:44 +0200 Subject: [PATCH 5/7] CMake: use wx prefix in library names Rename all library targets to start with wx. This way it does not use generic names like base or core that could interfere with other libraries that add include the wxWidgets project. --- build/cmake/config.cmake | 6 +-- build/cmake/demos/CMakeLists.txt | 6 +-- build/cmake/functions.cmake | 48 +++++++++++++------- build/cmake/lib/CMakeLists.txt | 12 ++--- build/cmake/lib/adv/CMakeLists.txt | 4 +- build/cmake/lib/aui/CMakeLists.txt | 4 +- build/cmake/lib/base/CMakeLists.txt | 32 ++++++------- build/cmake/lib/core/CMakeLists.txt | 32 ++++++------- build/cmake/lib/gl/CMakeLists.txt | 8 ++-- build/cmake/lib/html/CMakeLists.txt | 8 ++-- build/cmake/lib/media/CMakeLists.txt | 24 +++++----- build/cmake/lib/net/CMakeLists.txt | 6 +-- build/cmake/lib/propgrid/CMakeLists.txt | 4 +- build/cmake/lib/qa/CMakeLists.txt | 6 +-- build/cmake/lib/ribbon/CMakeLists.txt | 4 +- build/cmake/lib/richtext/CMakeLists.txt | 6 +-- build/cmake/lib/stc/CMakeLists.txt | 10 ++-- build/cmake/lib/webview/CMakeLists.txt | 42 ++++++++--------- build/cmake/lib/xml/CMakeLists.txt | 8 ++-- build/cmake/lib/xrc/CMakeLists.txt | 6 +-- build/cmake/samples/CMakeLists.txt | 58 ++++++++++++------------ build/cmake/samples/html.cmake | 18 ++++---- build/cmake/tests/base/CMakeLists.txt | 4 +- build/cmake/tests/drawing/CMakeLists.txt | 4 +- build/cmake/tests/gui/CMakeLists.txt | 18 ++++---- build/cmake/utils/CMakeLists.txt | 4 +- 26 files changed, 198 insertions(+), 184 deletions(-) diff --git a/build/cmake/config.cmake b/build/cmake/config.cmake index 90277f3955..eb0f42167a 100644 --- a/build/cmake/config.cmake +++ b/build/cmake/config.cmake @@ -29,8 +29,8 @@ endmacro() macro(wx_get_dependencies var lib) set(${var}) - if(TARGET ${lib}) - get_target_property(deps ${lib} LINK_LIBRARIES) + if(TARGET wx${lib}) + get_target_property(deps wx${lib} LINK_LIBRARIES) foreach(dep IN LISTS deps) if(TARGET ${dep}) get_target_property(dep_name ${dep} OUTPUT_NAME) @@ -98,7 +98,7 @@ function(wx_write_config) set(STD_BASE_LIBS_ALL xml net base) set(STD_GUI_LIBS_ALL xrc html qa adv core) foreach(lib IN ITEMS xrc webview stc richtext ribbon propgrid aui gl media html qa adv core xml net base) - list(FIND wxLIB_TARGETS ${lib} hasLib) + list(FIND wxLIB_TARGETS wx${lib} hasLib) if (hasLib GREATER -1) wx_string_append(BUILT_WX_LIBS "${lib} ") list(FIND STD_BASE_LIBS_ALL ${lib} index) diff --git a/build/cmake/demos/CMakeLists.txt b/build/cmake/demos/CMakeLists.txt index 37d296f977..c8fe3a859e 100644 --- a/build/cmake/demos/CMakeLists.txt +++ b/build/cmake/demos/CMakeLists.txt @@ -56,7 +56,7 @@ function(wx_add_demo name) if(wxBUILD_SHARED) target_compile_definitions(${DEMO_NAME} PRIVATE WXUSINGDLL) endif() - wx_exe_link_libraries(${DEMO_NAME} core ${DEMO_LIBRARIES}) + wx_exe_link_libraries(${DEMO_NAME} wxcore ${DEMO_LIBRARIES}) wx_set_common_target_properties(${DEMO_NAME}) set_target_properties(${DEMO_NAME} PROPERTIES FOLDER "Demos") set_target_properties(${DEMO_NAME} PROPERTIES @@ -92,7 +92,7 @@ wx_add_demo(forty DATA about.htm LIBRARIES - html xml + wxhtml wxxml ) wx_add_demo(fractal @@ -118,7 +118,7 @@ wx_add_demo(poem DATA wxpoem.txt wxpoem.dat wxpoem.idx LIBRARIES - html + wxhtml NAME wxpoem ) diff --git a/build/cmake/functions.cmake b/build/cmake/functions.cmake index 3d93ac9e09..230df3dd63 100644 --- a/build/cmake/functions.cmake +++ b/build/cmake/functions.cmake @@ -120,6 +120,12 @@ endfunction() # Set common properties on wx library target function(wx_set_target_properties target_name is_base) + if(${target_name} MATCHES "wx.*") + string(SUBSTRING ${target_name} 2 -1 target_name_short) + else() + set(target_name_short ${target_name}) + endif() + # Set library name according to: # docs/contributing/about-platform-toolkit-and-library-names.md if(is_base) @@ -137,9 +143,9 @@ function(wx_set_target_properties target_name is_base) else() set(lib_unicode) endif() - if(NOT target_name STREQUAL "base" AND NOT target_name STREQUAL "mono") + if(NOT target_name_short STREQUAL "base" AND NOT target_name_short STREQUAL "mono") # Do not append library name for base library - set(lib_suffix _${target_name}) + set(lib_suffix _${target_name_short}) else() set(lib_suffix) endif() @@ -203,7 +209,7 @@ function(wx_set_target_properties target_name is_base) # Set common compile definitions target_compile_definitions(${target_name} PRIVATE WXBUILDING _LIB) - if(target_name STREQUAL "mono" AND wxUSE_GUI) + if(target_name_short STREQUAL "mono" AND wxUSE_GUI) target_compile_definitions(${target_name} PRIVATE wxUSE_GUI=1 wxUSE_BASE=1) elseif(is_base OR NOT wxUSE_GUI) target_compile_definitions(${target_name} PRIVATE wxUSE_GUI=0 wxUSE_BASE=1) @@ -274,26 +280,26 @@ function(wx_set_target_properties target_name is_base) PUBLIC ${wxTOOLKIT_DEFINITIONS}) if(wxBUILD_SHARED) - string(TOUPPER ${target_name} target_name_upper) - if(target_name STREQUAL "mono") + string(TOUPPER ${target_name_short} target_name_upper) + if(target_name_short STREQUAL "mono") target_compile_definitions(${target_name} PRIVATE DLL_EXPORTS WXMAKINGDLL) else() target_compile_definitions(${target_name} PRIVATE DLL_EXPORTS WXMAKINGDLL_${target_name_upper}) endif() - if(NOT target_name STREQUAL "base") + if(NOT target_name_short STREQUAL "base") target_compile_definitions(${target_name} PRIVATE WXUSINGDLL) endif() endif() # Link common libraries - if(NOT target_name STREQUAL "mono") - if(NOT target_name STREQUAL "base") + if(NOT target_name_short STREQUAL "mono") + if(NOT target_name_short STREQUAL "base") # All libraries except base need the base library - target_link_libraries(${target_name} PUBLIC base) + target_link_libraries(${target_name} PUBLIC wxbase) endif() - if(NOT is_base AND NOT target_name STREQUAL "core") + if(NOT is_base AND NOT target_name_short STREQUAL "core") # All non base libraries except core need core - target_link_libraries(${target_name} PUBLIC core) + target_link_libraries(${target_name} PUBLIC wxcore) endif() endif() @@ -317,7 +323,7 @@ macro(wx_add_library name) list(APPEND wxLIB_TARGETS ${name}) set(wxLIB_TARGETS ${wxLIB_TARGETS} PARENT_SCOPE) - if(wxBUILD_MONOLITHIC AND NOT ${name} STREQUAL "mono") + if(wxBUILD_MONOLITHIC AND NOT ${name} STREQUAL "wxmono") # collect all source files for mono library set(wxMONO_SRC_FILES ${wxMONO_SRC_FILES} ${src_files} PARENT_SCOPE) else() @@ -333,9 +339,16 @@ macro(wx_add_library name) set(wxBUILD_LIB_TYPE STATIC) endif() + if(${name} MATCHES "wx.*") + string(SUBSTRING ${name} 2 -1 name_short) + else() + set(name_short ${name}) + endif() + add_library(${name} ${wxBUILD_LIB_TYPE} ${src_files}) - add_library(wx::${name} ALIAS ${name}) + add_library(wx::${name_short} ALIAS ${name}) wx_set_target_properties(${name} ${wxADD_LIBRARY_IS_BASE}) + set_property(TARGET ${name} PROPERTY PROJECT_LABEL ${name_short}) # Setup install wx_install(TARGETS ${name} @@ -406,7 +419,7 @@ endmacro() # Link wx libraries to executable macro(wx_exe_link_libraries name) if(wxBUILD_MONOLITHIC) - target_link_libraries(${name} PUBLIC mono) + target_link_libraries(${name} PUBLIC wxmono) else() target_link_libraries(${name};PRIVATE;${ARGN}) endif() @@ -512,6 +525,7 @@ function(wx_add_builtin_library name) add_library(${name} STATIC ${src_list}) add_library(wx::${name_short} ALIAS ${name}) wx_set_builtin_target_properties(${name}) + set_property(TARGET ${name} PROPERTY PROJECT_LABEL ${name_short}) if(wxBUILD_SHARED) set_target_properties(${name} PROPERTIES POSITION_INDEPENDENT_CODE TRUE) endif() @@ -705,10 +719,10 @@ function(wx_add_sample name) endif() # All samples use at least the base library other libraries # will have to be added with wx_link_sample_libraries() - wx_exe_link_libraries(${target_name} base) + wx_exe_link_libraries(${target_name} wxbase) if(NOT SAMPLE_CONSOLE) # UI samples always require core - wx_exe_link_libraries(${target_name} core) + wx_exe_link_libraries(${target_name} wxcore) else() target_compile_definitions(${target_name} PRIVATE wxUSE_GUI=0 wxUSE_BASE=1) endif() @@ -866,7 +880,7 @@ function(wx_add_test name) endif() add_executable(${name} ${test_src}) target_include_directories(${name} PRIVATE "${wxSOURCE_DIR}/tests" "${wxSOURCE_DIR}/3rdparty/catch/include") - wx_exe_link_libraries(${name} base) + wx_exe_link_libraries(${name} wxbase) if(wxBUILD_SHARED) target_compile_definitions(${name} PRIVATE WXUSINGDLL) endif() diff --git a/build/cmake/lib/CMakeLists.txt b/build/cmake/lib/CMakeLists.txt index 939eba57d3..cf40472c45 100644 --- a/build/cmake/lib/CMakeLists.txt +++ b/build/cmake/lib/CMakeLists.txt @@ -75,31 +75,31 @@ endforeach() if(wxBUILD_MONOLITHIC) # Create monolithic library target list(LENGTH wxMONO_SRC_FILES src_file_count) - wx_add_library(mono ${wxMONO_SRC_FILES}) + wx_add_library(wxmono ${wxMONO_SRC_FILES}) foreach(vis PRIVATE PUBLIC) if(wxMONO_LIBS_${vis}) # Remove libs included in mono from list foreach(lib IN LISTS LIBS) - list(REMOVE_ITEM wxMONO_LIBS_${vis} ${lib}) + list(REMOVE_ITEM wxMONO_LIBS_${vis} wx${lib}) endforeach() - target_link_libraries(mono ${vis} ${wxMONO_LIBS_${vis}}) + 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) endif() - target_include_directories(mono ${INCLUDE_POS} ${vis} ${wxMONO_INCLUDE_DIRS_${vis}}) + target_include_directories(wxmono ${INCLUDE_POS} ${vis} ${wxMONO_INCLUDE_DIRS_${vis}}) endif() if(wxMONO_DEFINITIONS_${vis}) - target_compile_definitions(mono ${vis} ${wxMONO_DEFINITIONS_${vis}}) + target_compile_definitions(wxmono ${vis} ${wxMONO_DEFINITIONS_${vis}}) endif() endforeach() foreach(file ${wxMONO_NONCOMPILED_CPP_FILES}) set_source_files_properties(${file} PROPERTIES HEADER_FILE_ONLY TRUE) endforeach() - wx_finalize_lib(mono) + wx_finalize_lib(wxmono) endif() # Propagate variable(s) to parent scope diff --git a/build/cmake/lib/adv/CMakeLists.txt b/build/cmake/lib/adv/CMakeLists.txt index b3e0fc468a..e3e5459f08 100644 --- a/build/cmake/lib/adv/CMakeLists.txt +++ b/build/cmake/lib/adv/CMakeLists.txt @@ -9,6 +9,6 @@ include(../../source_groups.cmake) -wx_add_library(adv "${wxSOURCE_DIR}/src/common/dummy.cpp") +wx_add_library(wxadv "${wxSOURCE_DIR}/src/common/dummy.cpp") -wx_finalize_lib(adv) +wx_finalize_lib(wxadv) diff --git a/build/cmake/lib/aui/CMakeLists.txt b/build/cmake/lib/aui/CMakeLists.txt index 1ce816a851..ef488e5768 100644 --- a/build/cmake/lib/aui/CMakeLists.txt +++ b/build/cmake/lib/aui/CMakeLists.txt @@ -17,6 +17,6 @@ elseif(WXGTK2) wx_append_sources(AUI_FILES AUI_GTK) endif() -wx_add_library(aui ${AUI_FILES}) +wx_add_library(wxaui ${AUI_FILES}) -wx_finalize_lib(aui) +wx_finalize_lib(wxaui) diff --git a/build/cmake/lib/base/CMakeLists.txt b/build/cmake/lib/base/CMakeLists.txt index 08a1f74f22..cd897c3154 100644 --- a/build/cmake/lib/base/CMakeLists.txt +++ b/build/cmake/lib/base/CMakeLists.txt @@ -26,38 +26,38 @@ elseif(UNIX) wx_append_sources(BASE_FILES BASE_UNIX) endif() -wx_add_library(base IS_BASE ${BASE_FILES}) +wx_add_library(wxbase IS_BASE ${BASE_FILES}) if(NOT wxBUILD_MONOLITHIC) - wx_lib_compile_definitions(base PRIVATE wxUSE_BASE=1) + wx_lib_compile_definitions(wxbase PRIVATE wxUSE_BASE=1) endif() if(wxUSE_ZLIB) - wx_lib_include_directories(base PRIVATE ${ZLIB_INCLUDE_DIRS}) - wx_lib_link_libraries(base PRIVATE ${ZLIB_LIBRARIES}) + wx_lib_include_directories(wxbase PRIVATE ${ZLIB_INCLUDE_DIRS}) + wx_lib_link_libraries(wxbase PRIVATE ${ZLIB_LIBRARIES}) endif() if(wxUSE_REGEX) - wx_lib_include_directories(base PRIVATE ${REGEX_INCLUDE_DIRS}) - wx_lib_link_libraries(base PRIVATE ${REGEX_LIBRARIES}) + wx_lib_include_directories(wxbase PRIVATE ${REGEX_INCLUDE_DIRS}) + wx_lib_link_libraries(wxbase PRIVATE ${REGEX_LIBRARIES}) endif() if(wxUSE_LIBLZMA) - wx_lib_include_directories(base PRIVATE ${LIBLZMA_INCLUDE_DIRS}) - wx_lib_link_libraries(base PRIVATE ${LIBLZMA_LIBRARIES}) + wx_lib_include_directories(wxbase PRIVATE ${LIBLZMA_INCLUDE_DIRS}) + wx_lib_link_libraries(wxbase PRIVATE ${LIBLZMA_LIBRARIES}) endif() if(UNIX AND wxUSE_SECRETSTORE) - wx_lib_include_directories(base PRIVATE ${LIBSECRET_INCLUDE_DIRS}) - wx_lib_link_libraries(base PRIVATE ${LIBSECRET_LIBRARIES}) + wx_lib_include_directories(wxbase PRIVATE ${LIBSECRET_INCLUDE_DIRS}) + wx_lib_link_libraries(wxbase PRIVATE ${LIBSECRET_LIBRARIES}) endif() if(wxUSE_LIBICONV) - wx_lib_include_directories(base PRIVATE ${ICONV_INCLUDE_DIR}) - wx_lib_link_libraries(base PRIVATE ${ICONV_LIBRARIES}) + wx_lib_include_directories(wxbase PRIVATE ${ICONV_INCLUDE_DIR}) + wx_lib_link_libraries(wxbase PRIVATE ${ICONV_LIBRARIES}) endif() if(wxUSE_THREADS AND CMAKE_THREAD_LIBS_INIT) - wx_lib_link_libraries(base PRIVATE ${CMAKE_THREAD_LIBS_INIT}) + wx_lib_link_libraries(wxbase PRIVATE ${CMAKE_THREAD_LIBS_INIT}) endif() if(APPLE) - wx_lib_link_libraries(base + wx_lib_link_libraries(wxbase PRIVATE "-framework Security" PUBLIC @@ -67,7 +67,7 @@ if(APPLE) "-framework IOKit" ) elseif(UNIX) - wx_lib_link_libraries(base PRIVATE dl) + wx_lib_link_libraries(wxbase PRIVATE dl) endif() -wx_finalize_lib(base) +wx_finalize_lib(wxbase) diff --git a/build/cmake/lib/core/CMakeLists.txt b/build/cmake/lib/core/CMakeLists.txt index d8125aa255..d9f423c8f8 100644 --- a/build/cmake/lib/core/CMakeLists.txt +++ b/build/cmake/lib/core/CMakeLists.txt @@ -54,44 +54,44 @@ elseif(WXQT) endif() endif() -wx_add_library(core ${CORE_SRC}) +wx_add_library(wxcore ${CORE_SRC}) foreach(lib JPEG PNG TIFF) if(${lib}_LIBRARIES) if(lib STREQUAL JPEG) - wx_lib_include_directories(core PRIVATE ${${lib}_INCLUDE_DIR}) + wx_lib_include_directories(wxcore PRIVATE ${${lib}_INCLUDE_DIR}) else() - wx_lib_include_directories(core PRIVATE ${${lib}_INCLUDE_DIRS}) + wx_lib_include_directories(wxcore PRIVATE ${${lib}_INCLUDE_DIRS}) endif() - wx_lib_link_libraries(core PRIVATE ${${lib}_LIBRARIES}) + wx_lib_link_libraries(wxcore PRIVATE ${${lib}_LIBRARIES}) endif() endforeach() if(WIN32) - wx_lib_link_libraries(core PRIVATE winmm) + wx_lib_link_libraries(wxcore PRIVATE winmm) endif() if(WXOSX_COCOA) - wx_lib_link_libraries(core PUBLIC "-framework AudioToolbox") + wx_lib_link_libraries(wxcore PUBLIC "-framework AudioToolbox") if(wxUSE_WEBKIT) - wx_lib_link_libraries(core PUBLIC "-framework WebKit") + wx_lib_link_libraries(wxcore PUBLIC "-framework WebKit") endif() endif() if(WXGTK AND wxUSE_PRIVATE_FONTS) - wx_lib_include_directories(core PUBLIC ${FONTCONFIG_INCLUDE_DIRS} ${PANGOFT2_INCLUDE_DIRS}) - wx_lib_link_libraries(core PUBLIC ${FONTCONFIG_LIBRARIES} ${PANGOFT2_LIBRARIES}) + wx_lib_include_directories(wxcore PUBLIC ${FONTCONFIG_INCLUDE_DIRS} ${PANGOFT2_INCLUDE_DIRS}) + wx_lib_link_libraries(wxcore PUBLIC ${FONTCONFIG_LIBRARIES} ${PANGOFT2_LIBRARIES}) endif() if(wxUSE_LIBSDL) if(SDL2_FOUND) - wx_lib_include_directories(core PUBLIC ${SDL2_INCLUDE_DIR}) - wx_lib_link_libraries(core PUBLIC ${SDL2_LIBRARY}) + wx_lib_include_directories(wxcore PUBLIC ${SDL2_INCLUDE_DIR}) + wx_lib_link_libraries(wxcore PUBLIC ${SDL2_LIBRARY}) elseif(SDL_FOUND) - wx_lib_include_directories(core PUBLIC ${SDL_INCLUDE_DIR}) - wx_lib_link_libraries(core PUBLIC ${SDL_LIBRARY}) + wx_lib_include_directories(wxcore PUBLIC ${SDL_INCLUDE_DIR}) + wx_lib_link_libraries(wxcore PUBLIC ${SDL_LIBRARY}) endif() endif() if(wxUSE_LIBNOTIFY) - wx_lib_include_directories(core PUBLIC ${LIBNOTIFY_INCLUDE_DIRS}) - wx_lib_link_libraries(core PUBLIC ${LIBNOTIFY_LIBRARIES}) + wx_lib_include_directories(wxcore PUBLIC ${LIBNOTIFY_INCLUDE_DIRS}) + wx_lib_link_libraries(wxcore PUBLIC ${LIBNOTIFY_LIBRARIES}) endif() -wx_finalize_lib(core) +wx_finalize_lib(wxcore) diff --git a/build/cmake/lib/gl/CMakeLists.txt b/build/cmake/lib/gl/CMakeLists.txt index 605a2b4f66..62ce6ef769 100644 --- a/build/cmake/lib/gl/CMakeLists.txt +++ b/build/cmake/lib/gl/CMakeLists.txt @@ -21,8 +21,8 @@ elseif(WXQT) wx_append_sources(GL_FILES OPENGL_QT) endif() -wx_add_library(gl ${GL_FILES}) -wx_lib_include_directories(gl PUBLIC ${OPENGL_INCLUDE_DIR}) -wx_lib_link_libraries(gl PUBLIC ${OPENGL_LIBRARIES}) +wx_add_library(wxgl ${GL_FILES}) +wx_lib_include_directories(wxgl PUBLIC ${OPENGL_INCLUDE_DIR}) +wx_lib_link_libraries(wxgl PUBLIC ${OPENGL_LIBRARIES}) -wx_finalize_lib(gl) +wx_finalize_lib(wxgl) diff --git a/build/cmake/lib/html/CMakeLists.txt b/build/cmake/lib/html/CMakeLists.txt index d4b8b6d19c..57ba75fbf9 100644 --- a/build/cmake/lib/html/CMakeLists.txt +++ b/build/cmake/lib/html/CMakeLists.txt @@ -15,11 +15,11 @@ if(WIN32 OR wxUSE_LIBMSPACK) wx_append_sources(HTML_FILES HTML_MSW) endif() -wx_add_library(html ${HTML_FILES}) +wx_add_library(wxhtml ${HTML_FILES}) if(wxUSE_LIBMSPACK) - wx_lib_include_directories(html PRIVATE ${MSPACK_INCLUDE_DIRS}) - wx_lib_link_libraries(html PRIVATE ${MSPACK_LIBRARIES}) + wx_lib_include_directories(wxhtml PRIVATE ${MSPACK_INCLUDE_DIRS}) + wx_lib_link_libraries(wxhtml PRIVATE ${MSPACK_LIBRARIES}) endif() -wx_finalize_lib(html) +wx_finalize_lib(wxhtml) diff --git a/build/cmake/lib/media/CMakeLists.txt b/build/cmake/lib/media/CMakeLists.txt index 81028fabbe..2458896d35 100644 --- a/build/cmake/lib/media/CMakeLists.txt +++ b/build/cmake/lib/media/CMakeLists.txt @@ -21,37 +21,37 @@ elseif(WXQT) wx_append_sources(MEDIA_FILES MEDIA_QT) endif() -wx_add_library(media ${MEDIA_FILES}) +wx_add_library(wxmedia ${MEDIA_FILES}) if(WXOSX_COCOA) # TODO: add version detection of some kind and/or wx_option - wx_lib_compile_definitions(media PRIVATE -DwxOSX_USE_QTKIT=0) - wx_lib_link_libraries(media PUBLIC + wx_lib_compile_definitions(wxmedia PRIVATE -DwxOSX_USE_QTKIT=0) + wx_lib_link_libraries(wxmedia PUBLIC "-framework AVFoundation" "-framework AVKit" "-framework CoreMedia" ) elseif(UNIX) - wx_lib_include_directories(media PUBLIC ${GSTREAMER_INCLUDE_DIRS}) + wx_lib_include_directories(wxmedia PUBLIC ${GSTREAMER_INCLUDE_DIRS}) if(GSTREAMER_INTERFACES_INCLUDE_DIRS) - wx_lib_include_directories(media PUBLIC ${GSTREAMER_INTERFACES_INCLUDE_DIRS}) + wx_lib_include_directories(wxmedia PUBLIC ${GSTREAMER_INTERFACES_INCLUDE_DIRS}) endif() if(GSTREAMER_VIDEO_INCLUDE_DIRS) - wx_lib_include_directories(media PUBLIC ${GSTREAMER_VIDEO_INCLUDE_DIRS}) + wx_lib_include_directories(wxmedia PUBLIC ${GSTREAMER_VIDEO_INCLUDE_DIRS}) endif() if(GSTREAMER_PLAYER_INCLUDE_DIRS) - wx_lib_include_directories(media PUBLIC ${GSTREAMER_PLAYER_INCLUDE_DIRS}) + wx_lib_include_directories(wxmedia PUBLIC ${GSTREAMER_PLAYER_INCLUDE_DIRS}) endif() - wx_lib_link_libraries(media PUBLIC ${GSTREAMER_LIBRARIES}) + wx_lib_link_libraries(wxmedia PUBLIC ${GSTREAMER_LIBRARIES}) if(GSTREAMER_INTERFACES_LIBRARIES) - wx_lib_link_libraries(media PUBLIC ${GSTREAMER_INTERFACES_LIBRARIES}) + wx_lib_link_libraries(wxmedia PUBLIC ${GSTREAMER_INTERFACES_LIBRARIES}) endif() if(GSTREAMER_VIDEO_LIBRARIES) - wx_lib_link_libraries(media PUBLIC ${GSTREAMER_VIDEO_LIBRARIES}) + wx_lib_link_libraries(wxmedia PUBLIC ${GSTREAMER_VIDEO_LIBRARIES}) endif() if(GSTREAMER_PLAYER_LIBRARIES) - wx_lib_link_libraries(media PUBLIC ${GSTREAMER_PLAYER_LIBRARIES}) + wx_lib_link_libraries(wxmedia PUBLIC ${GSTREAMER_PLAYER_LIBRARIES}) endif() endif() -wx_finalize_lib(media) +wx_finalize_lib(wxmedia) diff --git a/build/cmake/lib/net/CMakeLists.txt b/build/cmake/lib/net/CMakeLists.txt index 3d38412803..3d36948a31 100644 --- a/build/cmake/lib/net/CMakeLists.txt +++ b/build/cmake/lib/net/CMakeLists.txt @@ -21,10 +21,10 @@ if(UNIX AND NOT WIN32) wx_append_sources(NET_FILES NET_UNIX) endif() -wx_add_library(net IS_BASE ${NET_FILES}) +wx_add_library(wxnet IS_BASE ${NET_FILES}) if(WIN32) - wx_lib_link_libraries(net PRIVATE ws2_32) + wx_lib_link_libraries(wxnet PRIVATE ws2_32) endif() -wx_finalize_lib(net) +wx_finalize_lib(wxnet) diff --git a/build/cmake/lib/propgrid/CMakeLists.txt b/build/cmake/lib/propgrid/CMakeLists.txt index 07fc043e46..d785c8c268 100644 --- a/build/cmake/lib/propgrid/CMakeLists.txt +++ b/build/cmake/lib/propgrid/CMakeLists.txt @@ -11,6 +11,6 @@ include(../../source_groups.cmake) wx_append_sources(PROPGRID_FILES PROPGRID) -wx_add_library(propgrid ${PROPGRID_FILES}) +wx_add_library(wxpropgrid ${PROPGRID_FILES}) -wx_finalize_lib(propgrid) +wx_finalize_lib(wxpropgrid) diff --git a/build/cmake/lib/qa/CMakeLists.txt b/build/cmake/lib/qa/CMakeLists.txt index 8a0674c9a3..050287205e 100644 --- a/build/cmake/lib/qa/CMakeLists.txt +++ b/build/cmake/lib/qa/CMakeLists.txt @@ -11,7 +11,7 @@ include(../../source_groups.cmake) wx_append_sources(QA_FILES QA) -wx_add_library(qa ${QA_FILES}) -wx_lib_link_libraries(qa PUBLIC xml) +wx_add_library(wxqa ${QA_FILES}) +wx_lib_link_libraries(wxqa PUBLIC wxxml) -wx_finalize_lib(qa) +wx_finalize_lib(wxqa) diff --git a/build/cmake/lib/ribbon/CMakeLists.txt b/build/cmake/lib/ribbon/CMakeLists.txt index 756fdbacc6..042fe6f836 100644 --- a/build/cmake/lib/ribbon/CMakeLists.txt +++ b/build/cmake/lib/ribbon/CMakeLists.txt @@ -11,6 +11,6 @@ include(../../source_groups.cmake) wx_append_sources(RIBBON_FILES RIBBON) -wx_add_library(ribbon ${RIBBON_FILES}) +wx_add_library(wxribbon ${RIBBON_FILES}) -wx_finalize_lib(ribbon) +wx_finalize_lib(wxribbon) diff --git a/build/cmake/lib/richtext/CMakeLists.txt b/build/cmake/lib/richtext/CMakeLists.txt index 98ca504f47..63b1e5385c 100644 --- a/build/cmake/lib/richtext/CMakeLists.txt +++ b/build/cmake/lib/richtext/CMakeLists.txt @@ -11,7 +11,7 @@ include(../../source_groups.cmake) wx_append_sources(RICHTEXT_FILES RICHTEXT) -wx_add_library(richtext ${RICHTEXT_FILES}) -wx_lib_link_libraries(richtext PRIVATE html xml) +wx_add_library(wxrichtext ${RICHTEXT_FILES}) +wx_lib_link_libraries(wxrichtext PRIVATE wxhtml wxxml) -wx_finalize_lib(richtext) +wx_finalize_lib(wxrichtext) diff --git a/build/cmake/lib/stc/CMakeLists.txt b/build/cmake/lib/stc/CMakeLists.txt index f96687d2d8..44c6a75f6f 100644 --- a/build/cmake/lib/stc/CMakeLists.txt +++ b/build/cmake/lib/stc/CMakeLists.txt @@ -182,18 +182,18 @@ if(wxBUILD_PRECOMP) wx_target_enable_precomp(wxscintilla ${wxSCINTILLA_PREC_HEADER}) endif() -wx_add_library(stc ${STC_FILES}) -wx_lib_include_directories(stc PRIVATE +wx_add_library(wxstc ${STC_FILES}) +wx_lib_include_directories(wxstc PRIVATE ${wxSOURCE_DIR}/src/stc/scintilla/include ${wxSOURCE_DIR}/src/stc/scintilla/lexlib ${wxSOURCE_DIR}/src/stc/scintilla/src ) -wx_lib_compile_definitions(stc PRIVATE +wx_lib_compile_definitions(wxstc PRIVATE NO_CXX11_REGEX __WX__ SCI_LEXER LINK_LEXERS ) -wx_lib_link_libraries(stc PRIVATE wxscintilla) +wx_lib_link_libraries(wxstc PRIVATE wxscintilla) -wx_finalize_lib(stc) +wx_finalize_lib(wxstc) diff --git a/build/cmake/lib/webview/CMakeLists.txt b/build/cmake/lib/webview/CMakeLists.txt index 4645032097..dc9850fa27 100644 --- a/build/cmake/lib/webview/CMakeLists.txt +++ b/build/cmake/lib/webview/CMakeLists.txt @@ -23,20 +23,20 @@ elseif(APPLE) wx_append_sources(WEBVIEW_FILES WEBVIEW_OSX_SHARED) endif() -wx_add_library(webview ${WEBVIEW_FILES}) +wx_add_library(wxwebview ${WEBVIEW_FILES}) if(WXGTK AND wxUSE_WEBVIEW_WEBKIT2) set(WX_WEB_EXTENSIONS_DIRECTORY "lib/wx/${wxMAJOR_VERSION}.${wxMINOR_VERSION}/web-extensions") - wx_lib_compile_definitions(webview PRIVATE + wx_lib_compile_definitions(wxwebview PRIVATE -DWX_WEB_EXTENSIONS_DIRECTORY="${CMAKE_INSTALL_PREFIX}/${WX_WEB_EXTENSIONS_DIRECTORY}" ) endif() if(APPLE) - wx_lib_link_libraries(webview PUBLIC "-framework WebKit") + wx_lib_link_libraries(wxwebview PUBLIC "-framework WebKit") elseif(WXMSW) if(wxUSE_WEBVIEW_EDGE) - wx_lib_include_directories(webview PRIVATE "${PROJECT_SOURCE_DIR}/3rdparty/webview2/build/native/include") + wx_lib_include_directories(wxwebview PRIVATE "${PROJECT_SOURCE_DIR}/3rdparty/webview2/build/native/include") if (CMAKE_SIZEOF_VOID_P EQUAL 4) set(WEBVIEW2_ARCH x86) @@ -44,55 +44,55 @@ elseif(WXMSW) set(WEBVIEW2_ARCH x64) endif() - add_custom_command(TARGET webview POST_BUILD + add_custom_command(TARGET wxwebview POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy "${PROJECT_SOURCE_DIR}/3rdparty/webview2/build/native/${WEBVIEW2_ARCH}/WebView2Loader.dll" - "$/WebView2Loader.dll") + "$/WebView2Loader.dll") endif() elseif(WXGTK) if(LIBSOUP_FOUND) - wx_lib_include_directories(webview PUBLIC ${LIBSOUP_INCLUDE_DIRS}) - wx_lib_link_libraries(webview PUBLIC ${LIBSOUP_LIBRARIES}) + wx_lib_include_directories(wxwebview PUBLIC ${LIBSOUP_INCLUDE_DIRS}) + wx_lib_link_libraries(wxwebview PUBLIC ${LIBSOUP_LIBRARIES}) endif() if(wxUSE_WEBVIEW_WEBKIT2) - wx_lib_include_directories(webview PUBLIC ${WEBKIT2_INCLUDE_DIR}) - wx_lib_link_libraries(webview PUBLIC ${WEBKIT2_LIBRARIES}) + wx_lib_include_directories(wxwebview PUBLIC ${WEBKIT2_INCLUDE_DIR}) + wx_lib_link_libraries(wxwebview PUBLIC ${WEBKIT2_LIBRARIES}) elseif(wxUSE_WEBVIEW_WEBKIT) - wx_lib_include_directories(webview PUBLIC ${WEBKIT_INCLUDE_DIR}) - wx_lib_link_libraries(webview PUBLIC ${WEBKIT_LIBRARIES}) + wx_lib_include_directories(wxwebview PUBLIC ${WEBKIT_INCLUDE_DIR}) + wx_lib_link_libraries(wxwebview PUBLIC ${WEBKIT_LIBRARIES}) endif() endif() -wx_finalize_lib(webview) +wx_finalize_lib(wxwebview) # webkit extension plugin # we can't use (all of the) macros and functions because this library should # always be build as a shared libary, and not included in the monolithic build. if(WXGTK AND wxUSE_WEBVIEW_WEBKIT2) wx_append_sources(WEBKIT2_EXT_FILES WEBVIEW_WEBKIT2_EXTENSION) - add_library(webkit2_ext SHARED ${WEBKIT2_EXT_FILES}) - wx_set_target_properties(webkit2_ext false) + add_library(wxwebkit2_ext SHARED ${WEBKIT2_EXT_FILES}) + wx_set_target_properties(wxwebkit2_ext false) # Change output name to match expected name in webview_webkit2.cpp: webkit2_ext* if(wxUSE_UNICODE) set(lib_unicode u) endif() - set_target_properties(webkit2_ext PROPERTIES PREFIX "") - set_target_properties(webkit2_ext PROPERTIES + set_target_properties(wxwebkit2_ext PROPERTIES PREFIX "") + set_target_properties(wxwebkit2_ext PROPERTIES OUTPUT_NAME "webkit2_ext${lib_unicode}-${wxMAJOR_VERSION}.${wxMINOR_VERSION}" OUTPUT_NAME_DEBUG "webkit2_ext${lib_unicode}d-${wxMAJOR_VERSION}.${wxMINOR_VERSION}" ) - target_include_directories(webkit2_ext PUBLIC + target_include_directories(wxwebkit2_ext PUBLIC ${LIBSOUP_INCLUDE_DIRS} ${WEBKIT2_INCLUDE_DIR} ) - target_link_libraries(webkit2_ext PUBLIC + target_link_libraries(wxwebkit2_ext PUBLIC ${LIBSOUP_LIBRARIES} ${WEBKIT2_LIBRARIES} ) - wx_install(TARGETS webkit2_ext LIBRARY DESTINATION ${WX_WEB_EXTENSIONS_DIRECTORY}) + wx_install(TARGETS wxwebkit2_ext LIBRARY DESTINATION ${WX_WEB_EXTENSIONS_DIRECTORY}) - add_dependencies(webview webkit2_ext) + add_dependencies(wxwebview wxwebkit2_ext) endif() diff --git a/build/cmake/lib/xml/CMakeLists.txt b/build/cmake/lib/xml/CMakeLists.txt index 3eaae0b5d1..1acf928d42 100644 --- a/build/cmake/lib/xml/CMakeLists.txt +++ b/build/cmake/lib/xml/CMakeLists.txt @@ -10,8 +10,8 @@ include(../../source_groups.cmake) wx_append_sources(XML_FILES XML) -wx_add_library(xml IS_BASE ${XML_FILES}) -wx_lib_link_libraries(xml PRIVATE ${EXPAT_LIBRARIES}) -wx_lib_include_directories(xml PRIVATE ${EXPAT_INCLUDE_DIRS}) +wx_add_library(wxxml IS_BASE ${XML_FILES}) +wx_lib_link_libraries(wxxml PRIVATE ${EXPAT_LIBRARIES}) +wx_lib_include_directories(wxxml PRIVATE ${EXPAT_INCLUDE_DIRS}) -wx_finalize_lib(xml) +wx_finalize_lib(wxxml) diff --git a/build/cmake/lib/xrc/CMakeLists.txt b/build/cmake/lib/xrc/CMakeLists.txt index 5b52b394a9..2897e93454 100644 --- a/build/cmake/lib/xrc/CMakeLists.txt +++ b/build/cmake/lib/xrc/CMakeLists.txt @@ -11,7 +11,7 @@ include(../../source_groups.cmake) wx_append_sources(XRC_FILES XRC) -wx_add_library(xrc ${XRC_FILES}) -wx_lib_link_libraries(xrc PRIVATE html xml) +wx_add_library(wxxrc ${XRC_FILES}) +wx_lib_link_libraries(wxxrc PRIVATE wxhtml wxxml) -wx_finalize_lib(xrc) +wx_finalize_lib(wxxrc) diff --git a/build/cmake/samples/CMakeLists.txt b/build/cmake/samples/CMakeLists.txt index 044d9cb1df..a5c003da4e 100644 --- a/build/cmake/samples/CMakeLists.txt +++ b/build/cmake/samples/CMakeLists.txt @@ -11,7 +11,7 @@ wx_add_sample(access accesstest.cpp DEPENDS wxUSE_ACCESSIBILITY) wx_add_sample(animate anitest.cpp anitest.h DATA throbber.gif hourglass.ani DEPENDS wxUSE_ANIMATIONCTRL) wx_add_sample(archive CONSOLE) wx_add_sample(artprov arttest.cpp artbrows.cpp artbrows.h) -wx_add_sample(aui auidemo.cpp LIBRARIES aui html NAME auidemo DEPENDS wxUSE_AUI) +wx_add_sample(aui auidemo.cpp LIBRARIES wxaui wxhtml NAME auidemo DEPENDS wxUSE_AUI) wx_add_sample(calendar RES calendar.rc DEPENDS wxUSE_CALENDARCTRL) wx_add_sample(caret DEPENDS wxUSE_CARET) wx_add_sample(clipboard DEPENDS wxUSE_CLIPBOARD) @@ -21,7 +21,7 @@ wx_add_sample(config conftest.cpp DEPENDS wxUSE_CONFIG) wx_add_sample(console CONSOLE IMPORTANT) wx_add_sample(dataview IMPORTANT dataview.cpp mymodels.cpp mymodels.h DEPENDS wxUSE_DATAVIEWCTRL) if(wxUSE_ON_FATAL_EXCEPTION AND (NOT WIN32 OR MSVC)) - wx_add_sample(debugrpt LIBRARIES qa DEPENDS wxUSE_DEBUGREPORT) + wx_add_sample(debugrpt LIBRARIES wxqa DEPENDS wxUSE_DEBUGREPORT) endif() set(SAMPLE_DIALOGS_SRC dialogs.cpp dialogs.h) if(NOT wxBUILD_SHARED AND (WXMSW OR APPLE)) # AND NOT WXUNIV @@ -34,11 +34,11 @@ if(WXGTK2) wx_list_add_prefix(SAMPLE_DIALOGS_SRC ../../src/generic/ filedlgg.cpp) endif() wx_add_sample(dialogs ${SAMPLE_DIALOGS_SRC} DATA tips.txt) -wx_add_sample(dialup nettest.cpp LIBRARIES net DEPENDS wxUSE_DIALUP_MANAGER) +wx_add_sample(dialup nettest.cpp LIBRARIES wxnet DEPENDS wxUSE_DIALUP_MANAGER) wx_add_sample(display) wx_add_sample(dnd dnd.cpp RES dnd.rc DATA wxwin.png DEPENDS wxUSE_DRAG_AND_DROP) wx_add_sample(docview docview.cpp doc.cpp view.cpp docview.h doc.h view.h - RES docview.rc LIBRARIES aui DEPENDS wxUSE_DOC_VIEW_ARCHITECTURE) + RES docview.rc LIBRARIES wxaui DEPENDS wxUSE_DOC_VIEW_ARCHITECTURE) wx_add_sample(dragimag dragimag.cpp dragimag.h RES dragimag.rc DATA backgrnd.png shape01.png shape02.png shape03.png DEPENDS wxUSE_DRAGIMAGE) @@ -55,7 +55,7 @@ wx_list_add_prefix(HELP_DOC_FILES doc/ aindex.html down.gif dxxgifs.tex HIER.html icon1.gif icon2.gif index.html logo.gif wx204.htm wx34.htm wxExtHelpController.html wxhelp.map wx.htm ) -wx_add_sample(help demo.cpp LIBRARIES html +wx_add_sample(help demo.cpp LIBRARIES wxhtml DATA back.gif bullet.bmp contents.gif cshelp.txt doc.chm doc.cnt doc.hhc doc.hhk doc.hhp doc.hlp doc.hpj doc.zip forward.gif up.gif @@ -63,7 +63,7 @@ wx_add_sample(help demo.cpp LIBRARIES html NAME helpdemo DEPENDS wxUSE_HELP ) -wx_add_sample(htlbox LIBRARIES html DEPENDS wxUSE_HTML) +wx_add_sample(htlbox LIBRARIES wxhtml DEPENDS wxUSE_HTML) if(wxUSE_HTML) include(html.cmake) endif() @@ -78,35 +78,35 @@ endforeach() wx_add_sample(internat DATA ${INTERNAT_DATA_FILES} DEPENDS wxUSE_INTL) # IPC samples set(wxSAMPLE_FOLDER ipc) -wx_add_sample(ipc client.cpp client.h connection.h ipcsetup.h NAME ipcclient LIBRARIES net DEPENDS wxUSE_IPC) -wx_add_sample(ipc server.cpp server.h connection.h ipcsetup.h NAME ipcserver LIBRARIES net DEPENDS wxUSE_IPC) -wx_add_sample(ipc CONSOLE baseclient.cpp connection.h ipcsetup.h NAME baseipcclient LIBRARIES net DEPENDS wxUSE_IPC) -wx_add_sample(ipc CONSOLE baseserver.cpp connection.h ipcsetup.h NAME baseipcserver LIBRARIES net DEPENDS wxUSE_IPC) +wx_add_sample(ipc client.cpp client.h connection.h ipcsetup.h NAME ipcclient LIBRARIES wxnet DEPENDS wxUSE_IPC) +wx_add_sample(ipc server.cpp server.h connection.h ipcsetup.h NAME ipcserver LIBRARIES wxnet DEPENDS wxUSE_IPC) +wx_add_sample(ipc CONSOLE baseclient.cpp connection.h ipcsetup.h NAME baseipcclient LIBRARIES wxnet DEPENDS wxUSE_IPC) +wx_add_sample(ipc CONSOLE baseserver.cpp connection.h ipcsetup.h NAME baseipcserver LIBRARIES wxnet DEPENDS wxUSE_IPC) set(wxSAMPLE_FOLDER) wx_add_sample(joytest joytest.cpp joytest.h DATA buttonpress.wav DEPENDS wxUSE_JOYSTICK) wx_add_sample(keyboard) wx_add_sample(layout layout.cpp layout.h) wx_add_sample(listctrl listtest.cpp listtest.h RES listtest.rc DEPENDS wxUSE_LISTCTRL) wx_add_sample(mdi mdi.cpp mdi.h RES mdi.rc DEPENDS wxUSE_MDI wxUSE_DOC_VIEW_ARCHITECTURE wxUSE_MDI_ARCHITECTURE) -wx_add_sample(mediaplayer LIBRARIES media DEPENDS wxUSE_MEDIACTRL) +wx_add_sample(mediaplayer LIBRARIES wxmedia DEPENDS wxUSE_MEDIACTRL) wx_add_sample(memcheck) wx_add_sample(menu DEPENDS wxUSE_MENUS) wx_add_sample(minimal IMPORTANT) -wx_add_sample(notebook notebook.cpp notebook.h LIBRARIES aui DEPENDS wxUSE_NOTEBOOK) +wx_add_sample(notebook notebook.cpp notebook.h LIBRARIES wxaui DEPENDS wxUSE_NOTEBOOK) if(wxUSE_OPENGL) set(wxSAMPLE_SUBDIR opengl/) set(wxSAMPLE_FOLDER OpenGL) - wx_add_sample(cube cube.cpp cube.h LIBRARIES gl) - wx_add_sample(isosurf isosurf.cpp isosurf.h LIBRARIES gl DATA isosurf.dat.gz) + wx_add_sample(cube cube.cpp cube.h LIBRARIES wxgl) + wx_add_sample(isosurf isosurf.cpp isosurf.h LIBRARIES wxgl DATA isosurf.dat.gz) wx_add_sample(penguin penguin.cpp dxfrenderer.cpp trackball.c dxfrenderer.h penguin.h trackball.h - LIBRARIES gl + LIBRARIES wxgl DATA penguin.dxf.gz) wx_add_sample(pyramid pyramid.cpp oglstuff.cpp mathstuff.cpp oglpfuncs.cpp pyramid.h oglstuff.h mathstuff.h oglpfuncs.h - LIBRARIES gl) + LIBRARIES wxgl) set(wxSAMPLE_SUBDIR) set(wxSAMPLE_FOLDER) endif() @@ -116,30 +116,30 @@ wx_add_sample(power) wx_add_sample(preferences DEPENDS wxUSE_PREFERENCES_EDITOR) wx_add_sample(printing printing.cpp printing.h DEPENDS wxUSE_PRINTING_ARCHITECTURE) wx_add_sample(propgrid propgrid.cpp propgrid_minimal.cpp sampleprops.cpp - tests.cpp sampleprops.h propgrid.h LIBRARIES propgrid NAME propgriddemo DEPENDS wxUSE_PROPGRID) + tests.cpp sampleprops.h propgrid.h LIBRARIES wxpropgrid NAME propgriddemo DEPENDS wxUSE_PROPGRID) wx_add_sample(render FOLDER render) wx_add_sample(render DLL renddll.cpp NAME renddll FOLDER render) -wx_add_sample(ribbon ribbondemo.cpp LIBRARIES ribbon NAME ribbondemo DEPENDS wxUSE_RIBBON) -wx_add_sample(richtext LIBRARIES richtext html xml NAME richtextdemo DEPENDS wxUSE_XML wxUSE_RICHTEXT) +wx_add_sample(ribbon ribbondemo.cpp LIBRARIES wxribbon NAME ribbondemo DEPENDS wxUSE_RIBBON) +wx_add_sample(richtext LIBRARIES wxrichtext wxhtml wxxml NAME richtextdemo DEPENDS wxUSE_XML wxUSE_RICHTEXT) wx_add_sample(sashtest sashtest.cpp sashtest.h RES sashtest.rc DEPENDS wxUSE_SASH) wx_add_sample(scroll) wx_add_sample(secretstore CONSOLE DEPENDS wxUSE_SECRETSTORE) wx_add_sample(shaped DATA star.png) if(wxUSE_SOCKETS) - wx_add_sample(sockets client.cpp NAME client LIBRARIES net FOLDER sockets) - wx_add_sample(sockets server.cpp NAME server LIBRARIES net FOLDER sockets) - wx_add_sample(sockets CONSOLE baseclient.cpp NAME baseclient LIBRARIES net FOLDER sockets) - wx_add_sample(sockets CONSOLE baseserver.cpp NAME baseserver LIBRARIES net FOLDER sockets) + wx_add_sample(sockets client.cpp NAME client LIBRARIES wxnet FOLDER sockets) + wx_add_sample(sockets server.cpp NAME server LIBRARIES wxnet FOLDER sockets) + wx_add_sample(sockets CONSOLE baseclient.cpp NAME baseclient LIBRARIES wxnet FOLDER sockets) + wx_add_sample(sockets CONSOLE baseserver.cpp NAME baseserver LIBRARIES wxnet FOLDER sockets) endif() wx_add_sample(sound RES sound.rc DATA 9000g.wav cuckoo.wav doggrowl.wav tinkalink2.wav DEPENDS wxUSE_SOUND) wx_add_sample(splash DATA splash.png press.mpg DEPENDS wxUSE_SPLASH) if(TARGET splash AND wxUSE_MEDIACTRL) - wx_exe_link_libraries(splash media) + wx_exe_link_libraries(splash wxmedia) endif() wx_add_sample(splitter DEPENDS wxUSE_SPLITTER) wx_add_sample(statbar DEPENDS wxUSE_STATUSBAR) wx_add_sample(stc stctest.cpp edit.cpp prefs.cpp edit.h defsext.h prefs.h - DATA stctest.cpp NAME stctest LIBRARIES stc DEPENDS wxUSE_STC) + DATA stctest.cpp NAME stctest LIBRARIES wxstc DEPENDS wxUSE_STC) wx_add_sample(svg svgtest.cpp RES svgtest.rc DEPENDS wxUSE_SVG) wx_add_sample(taborder) wx_add_sample(taskbar tbtest.cpp tbtest.h DEPENDS wxUSE_TASKBARICON) @@ -152,9 +152,9 @@ wx_add_sample(typetest typetest.cpp typetest.h) wx_add_sample(uiaction DEPENDS wxUSE_UIACTIONSIMULATOR) wx_add_sample(validate validate.cpp validate.h DEPENDS wxUSE_VALIDATORS) wx_add_sample(vscroll vstest.cpp) -wx_add_sample(webview LIBRARIES webview NAME webviewsample DEPENDS wxUSE_WEBVIEW) +wx_add_sample(webview LIBRARIES wxwebview NAME webviewsample DEPENDS wxUSE_WEBVIEW) if(TARGET webviewsample AND wxUSE_STC) - wx_exe_link_libraries(webviewsample stc) + wx_exe_link_libraries(webviewsample wxstc) endif() # widgets Sample set(SAMPLE_WIDGETS_SRC @@ -244,12 +244,12 @@ wx_add_sample(xrc custclas.h objrefdlg.h DATA ${XRC_RC_FILES} - LIBRARIES aui ribbon xrc html + LIBRARIES wxaui wxribbon wxxrc wxhtml NAME xrcdemo DEPENDS wxUSE_XML wxUSE_XRC ) wx_add_sample(xti xti.cpp classlist.cpp codereadercallback.cpp - classlist.h codereadercallback.h LIBRARIES xml + classlist.h codereadercallback.h LIBRARIES wxxml DEPENDS wxUSE_XML wxUSE_EXTENDED_RTTI) if(WIN32) diff --git a/build/cmake/samples/html.cmake b/build/cmake/samples/html.cmake index a13c405e9f..5a5299a020 100644 --- a/build/cmake/samples/html.cmake +++ b/build/cmake/samples/html.cmake @@ -10,7 +10,7 @@ set(wxSAMPLE_FOLDER html) set(wxSAMPLE_SUBDIR html/) -wx_add_sample(about DATA data/about.htm data/logo.png LIBRARIES html) +wx_add_sample(about DATA data/about.htm data/logo.png LIBRARIES wxhtml) wx_list_add_prefix(HELP_DATA_FILES helpfiles/ Index.hhk another.hhc @@ -23,21 +23,21 @@ wx_list_add_prefix(HELP_DATA_FILES helpfiles/ page2-b.htm testing.hhp ) -wx_add_sample(help DATA ${HELP_DATA_FILES} LIBRARIES html NAME htmlhelp DEPENDS wxUSE_HELP) -wx_add_sample(helpview DATA test.zip LIBRARIES html DEPENDS wxUSE_HELP) +wx_add_sample(help DATA ${HELP_DATA_FILES} LIBRARIES wxhtml NAME htmlhelp DEPENDS wxUSE_HELP) +wx_add_sample(helpview DATA test.zip LIBRARIES wxhtml DEPENDS wxUSE_HELP) #TODO: htmlctrl sample uses outdated definitions -#wx_add_sample(htmlctrl LIBRARIES html) -wx_add_sample(printing DATA logo6.gif test.htm LIBRARIES html NAME htmlprinting +#wx_add_sample(htmlctrl LIBRARIES wxhtml) +wx_add_sample(printing DATA logo6.gif test.htm LIBRARIES wxhtml NAME htmlprinting DEPENDS wxUSE_PRINTING_ARCHITECTURE) wx_add_sample(test DATA imagemap.png pic.png pic2.bmp i18n.gif imagemap.htm tables.htm test.htm listtest.htm 8859_2.htm cp1250.htm regres.htm foo.png subsup.html - LIBRARIES net html NAME htmltest) -wx_add_sample(virtual DATA start.htm LIBRARIES html) -wx_add_sample(widget DATA start.htm LIBRARIES html) -wx_add_sample(zip DATA pages.zip start.htm LIBRARIES html DEPENDS wxUSE_FS_ZIP) + LIBRARIES wxnet wxhtml NAME htmltest) +wx_add_sample(virtual DATA start.htm LIBRARIES wxhtml) +wx_add_sample(widget DATA start.htm LIBRARIES wxhtml) +wx_add_sample(zip DATA pages.zip start.htm LIBRARIES wxhtml DEPENDS wxUSE_FS_ZIP) set(wxSAMPLE_SUBDIR) set(wxSAMPLE_FOLDER) diff --git a/build/cmake/tests/base/CMakeLists.txt b/build/cmake/tests/base/CMakeLists.txt index 9cab7a5079..a6fe945ecb 100644 --- a/build/cmake/tests/base/CMakeLists.txt +++ b/build/cmake/tests/base/CMakeLists.txt @@ -121,9 +121,9 @@ wx_add_test(test_base ${TEST_SRC} ) target_compile_definitions(test_base PRIVATE wxUSE_GUI=0 wxUSE_BASE=1) if(wxUSE_SOCKETS) - wx_exe_link_libraries(test_base net) + wx_exe_link_libraries(test_base wxnet) endif() if(wxUSE_XML) - wx_exe_link_libraries(test_base xml) + wx_exe_link_libraries(test_base wxxml) endif() wx_test_enable_precomp(test_base) diff --git a/build/cmake/tests/drawing/CMakeLists.txt b/build/cmake/tests/drawing/CMakeLists.txt index 98977d07b6..ba6aeb480f 100644 --- a/build/cmake/tests/drawing/CMakeLists.txt +++ b/build/cmake/tests/drawing/CMakeLists.txt @@ -41,9 +41,9 @@ wx_add_test(test_drawing ${TEST_DRAWING_SRC} DATA ${TEST_DRAWING_DATA} ) if(wxUSE_SOCKETS) - wx_exe_link_libraries(test_drawing net) + wx_exe_link_libraries(test_drawing wxnet) endif() -wx_exe_link_libraries(test_drawing core) +wx_exe_link_libraries(test_drawing wxcore) wx_test_enable_precomp(test_drawing) # This is a sample plugin, it simply uses a wxImage based diff --git a/build/cmake/tests/gui/CMakeLists.txt b/build/cmake/tests/gui/CMakeLists.txt index f9da139a0b..c0f62ff77e 100644 --- a/build/cmake/tests/gui/CMakeLists.txt +++ b/build/cmake/tests/gui/CMakeLists.txt @@ -168,29 +168,29 @@ wx_add_test(test_gui ${TEST_GUI_SRC} DATA ${TEST_GUI_DATA} RES ../samples/sample.rc ) -wx_exe_link_libraries(test_gui core) +wx_exe_link_libraries(test_gui wxcore) if(wxUSE_RICHTEXT) - wx_exe_link_libraries(test_gui richtext) + wx_exe_link_libraries(test_gui wxrichtext) endif() if(wxUSE_STC) - wx_exe_link_libraries(test_gui stc) + wx_exe_link_libraries(test_gui wxstc) endif() if(wxUSE_MEDIACTRL) - wx_exe_link_libraries(test_gui media) + wx_exe_link_libraries(test_gui wxmedia) endif() if(wxUSE_XRC) - wx_exe_link_libraries(test_gui xrc) + wx_exe_link_libraries(test_gui wxxrc) endif() if(wxUSE_XML) - wx_exe_link_libraries(test_gui xml) + wx_exe_link_libraries(test_gui wxxml) endif() if(wxUSE_HTML) - wx_exe_link_libraries(test_gui html) + wx_exe_link_libraries(test_gui wxhtml) endif() if(wxUSE_SOCKETS) - wx_exe_link_libraries(test_gui net) + wx_exe_link_libraries(test_gui wxnet) endif() if(wxUSE_WEBVIEW) - wx_exe_link_libraries(test_gui webview) + wx_exe_link_libraries(test_gui wxwebview) endif() wx_test_enable_precomp(test_gui) diff --git a/build/cmake/utils/CMakeLists.txt b/build/cmake/utils/CMakeLists.txt index a47d615e12..0fd4761719 100644 --- a/build/cmake/utils/CMakeLists.txt +++ b/build/cmake/utils/CMakeLists.txt @@ -14,9 +14,9 @@ if(wxUSE_XRC) target_compile_definitions(wxrc PRIVATE WXUSINGDLL) endif() if(wxUSE_XML) - wx_exe_link_libraries(wxrc xml) + wx_exe_link_libraries(wxrc wxxml) endif() - wx_exe_link_libraries(wxrc base) + wx_exe_link_libraries(wxrc wxbase) set_target_properties(wxrc PROPERTIES FOLDER "Utilities") From ba3fd12efb1957b85678389116f7bd36e0660c3f Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Sun, 17 May 2020 19:41:57 +0200 Subject: [PATCH 6/7] CMake: fix linking the DLL sample in monolithic build --- build/cmake/functions.cmake | 4 +++- build/cmake/samples/CMakeLists.txt | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/build/cmake/functions.cmake b/build/cmake/functions.cmake index 230df3dd63..741358f633 100644 --- a/build/cmake/functions.cmake +++ b/build/cmake/functions.cmake @@ -791,7 +791,9 @@ endfunction() # Link libraries to a sample function(wx_link_sample_libraries name) - target_link_libraries(${name} ${ARGN}) + if(TARGET ${name}) + target_link_libraries(${name} PUBLIC ${ARGN}) + endif() endfunction() # Add a option and mark is as advanced if it starts with wxUSE_ diff --git a/build/cmake/samples/CMakeLists.txt b/build/cmake/samples/CMakeLists.txt index a5c003da4e..fcf11fb681 100644 --- a/build/cmake/samples/CMakeLists.txt +++ b/build/cmake/samples/CMakeLists.txt @@ -262,10 +262,12 @@ if(WIN32) if(NOT wxBUILD_SHARED) # this test only makes sense with statically built wx, otherwise # the same copy of wx would be used - wx_add_sample(dll wx_exe.cpp my_dll.h NAME wx_exe FOLDER dll LIBRARIES my_dll) + wx_add_sample(dll wx_exe.cpp my_dll.h NAME wx_exe FOLDER dll) + wx_link_sample_libraries(wx_exe my_dll) endif() - wx_add_sample(dll sdk_exe.cpp my_dll.h NAME sdk_exe FOLDER dll LIBRARIES my_dll) + wx_add_sample(dll sdk_exe.cpp my_dll.h NAME sdk_exe FOLDER dll) + wx_link_sample_libraries(sdk_exe my_dll) endif() wx_add_sample(regtest RES regtest.rc DEPENDS wxUSE_REGKEY) From a4160444795c1a99783d3e7674a9f57dc6b48ef1 Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Tue, 19 May 2020 01:59:41 +0200 Subject: [PATCH 7/7] CMake: document the library name changes as incompatible change --- docs/changes.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/changes.txt b/docs/changes.txt index d579331b37..70ccbeb244 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -177,6 +177,13 @@ NOTE: This file is updated only before the release, please use $ git notes --ref=changelog add -m 'wxPort: description.' to update it. +INCOMPATIBLE CHANGES SINCE 3.1.3: + +- CMake library targets were renamed and now start with 'wx'. In addition, + aliases for the libraries have been added using the 'wx::' namespace. For + example, the core library is now named wxcore and has alias wx::core. + + 3.1.3: (released 2019-10-28) ----------------------------