From 33a550d97f983c24e58c0a6b420adfed21326deb Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Thu, 6 Dec 2018 22:35:31 +0100 Subject: [PATCH] CMake: Set wx-config base, gui and built libraries Remove unused propagated variables. --- build/cmake/config.cmake | 21 ++++++++++++++++++--- build/cmake/functions.cmake | 3 --- build/cmake/lib/CMakeLists.txt | 5 ----- build/cmake/tests/CMakeLists.txt | 3 --- 4 files changed, 18 insertions(+), 14 deletions(-) diff --git a/build/cmake/config.cmake b/build/cmake/config.cmake index 9a1b9b855a..fe54de54f4 100644 --- a/build/cmake/config.cmake +++ b/build/cmake/config.cmake @@ -79,11 +79,26 @@ function(wx_write_config) endif() set(BUILT_WX_LIBS) - foreach(lib IN LISTS wxLIB_TARGETS) - wx_string_append(BUILT_WX_LIBS " ${lib}") - endforeach() set(STD_BASE_LIBS) set(STD_GUI_LIBS) + 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) + if(TARGET ${lib}) + wx_string_append(BUILT_WX_LIBS "${lib} ") + list(FIND STD_BASE_LIBS_ALL ${lib} index) + if (index GREATER -1) + wx_string_append(STD_BASE_LIBS "${lib} ") + endif() + list(FIND STD_GUI_LIBS_ALL ${lib} index) + if (index GREATER -1) + wx_string_append(STD_GUI_LIBS "${lib} ") + endif() + endif() + endforeach() + string(STRIP ${BUILT_WX_LIBS} BUILT_WX_LIBS) + string(STRIP ${STD_BASE_LIBS} STD_BASE_LIBS) + string(STRIP ${STD_GUI_LIBS} STD_GUI_LIBS) set(WX_RELEASE ${wxMAJOR_VERSION}.${wxMINOR_VERSION}) set(WX_VERSION ${wxVERSION}) diff --git a/build/cmake/functions.cmake b/build/cmake/functions.cmake index b12e60d13c..57c24ea068 100644 --- a/build/cmake/functions.cmake +++ b/build/cmake/functions.cmake @@ -313,8 +313,6 @@ macro(wx_add_library name) RUNTIME DESTINATION "lib${wxPLATFORM_LIB_DIR}" BUNDLE DESTINATION Applications/wxWidgets ) - - list(APPEND wxLIB_TARGETS ${name}) endif() endmacro() @@ -349,7 +347,6 @@ endmacro() # Enable precompiled headers for wx libraries macro(wx_finalize_lib target_name) - set(wxLIB_TARGETS ${wxLIB_TARGETS} PARENT_SCOPE) if(wxBUILD_PRECOMP) if(TARGET ${target_name}) wx_target_enable_precomp(${target_name} "${wxSOURCE_DIR}/include/wx/wxprec.h") diff --git a/build/cmake/lib/CMakeLists.txt b/build/cmake/lib/CMakeLists.txt index 4f8fc884c2..4974d48fea 100644 --- a/build/cmake/lib/CMakeLists.txt +++ b/build/cmake/lib/CMakeLists.txt @@ -9,7 +9,6 @@ include(../source_groups.cmake) -set(wxLIB_TARGETS) if(wxBUILD_MONOLITHIC) # Initialize variables for monolithic build set(wxMONO_SRC_FILES) @@ -98,7 +97,3 @@ if(wxBUILD_MONOLITHIC) endforeach() wx_finalize_lib(mono) endif() - -# Propagate variable(s) to parent scope -set(wxLIB_TARGETS ${wxLIB_TARGETS} PARENT_SCOPE) -set(wxTHIRD_PARTY_LIBRARIES ${wxTHIRD_PARTY_LIBRARIES} PARENT_SCOPE) diff --git a/build/cmake/tests/CMakeLists.txt b/build/cmake/tests/CMakeLists.txt index e0f449f9b7..8065a14edf 100644 --- a/build/cmake/tests/CMakeLists.txt +++ b/build/cmake/tests/CMakeLists.txt @@ -16,6 +16,3 @@ add_subdirectory(drawing) add_subdirectory(gui) endif() - -# Propagate variable(s) to parent scope -set(wxTHIRD_PARTY_LIBRARIES ${wxTHIRD_PARTY_LIBRARIES} PARENT_SCOPE)