CMake: Apply source groups using a function
This will add source groups to all projects, not only libraries. And there is no need anymore to include it in every project file.
This commit is contained in:
@@ -157,6 +157,7 @@ function(wx_set_common_target_properties target_name)
|
||||
set_target_properties(${target_name} PROPERTIES LINK_FLAGS "-pthread")
|
||||
endif()
|
||||
endif()
|
||||
wx_set_source_groups()
|
||||
endfunction()
|
||||
|
||||
# Set common properties on wx library target
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
# Licence: wxWindows licence
|
||||
#############################################################################
|
||||
|
||||
include(../source_groups.cmake)
|
||||
|
||||
if(wxBUILD_MONOLITHIC)
|
||||
# Initialize variables for monolithic build
|
||||
set(wxMONO_SRC_FILES)
|
||||
|
||||
@@ -7,6 +7,4 @@
|
||||
# Licence: wxWindows licence
|
||||
#############################################################################
|
||||
|
||||
include(../../source_groups.cmake)
|
||||
|
||||
wx_add_library(wxadv "${wxSOURCE_DIR}/src/common/dummy.cpp")
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
# Licence: wxWindows licence
|
||||
#############################################################################
|
||||
|
||||
include(../../source_groups.cmake)
|
||||
|
||||
wx_append_sources(AUI_FILES AUI_CMN)
|
||||
|
||||
if(WXMSW)
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
# Licence: wxWindows licence
|
||||
#############################################################################
|
||||
|
||||
include(../../source_groups.cmake)
|
||||
|
||||
wx_append_sources(BASE_FILES BASE_CMN)
|
||||
wx_append_sources(BASE_FILES BASE_AND_GUI_CMN)
|
||||
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
# Licence: wxWindows licence
|
||||
#############################################################################
|
||||
|
||||
include(../../source_groups.cmake)
|
||||
|
||||
wx_append_sources(CORE_SRC GUI_CMN)
|
||||
wx_append_sources(CORE_SRC BASE_AND_GUI_CMN)
|
||||
if(WIN32)
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
# Licence: wxWindows licence
|
||||
#############################################################################
|
||||
|
||||
include(../../source_groups.cmake)
|
||||
|
||||
wx_append_sources(GL_FILES OPENGL_CMN)
|
||||
|
||||
if(WXMSW)
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
# Licence: wxWindows licence
|
||||
#############################################################################
|
||||
|
||||
include(../../source_groups.cmake)
|
||||
|
||||
wx_append_sources(HTML_FILES HTML_CMN)
|
||||
|
||||
if(WIN32 OR wxUSE_LIBMSPACK)
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
# Licence: wxWindows licence
|
||||
#############################################################################
|
||||
|
||||
include(../../source_groups.cmake)
|
||||
|
||||
wx_append_sources(MEDIA_FILES MEDIA_CMN)
|
||||
|
||||
if(WXMSW)
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
# Licence: wxWindows licence
|
||||
#############################################################################
|
||||
|
||||
include(../../source_groups.cmake)
|
||||
|
||||
wx_append_sources(NET_FILES NET_CMN)
|
||||
|
||||
if(WIN32)
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
# Licence: wxWindows licence
|
||||
#############################################################################
|
||||
|
||||
include(../../source_groups.cmake)
|
||||
|
||||
wx_append_sources(PROPGRID_FILES PROPGRID)
|
||||
|
||||
wx_add_library(wxpropgrid ${PROPGRID_FILES})
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
# Licence: wxWindows licence
|
||||
#############################################################################
|
||||
|
||||
include(../../source_groups.cmake)
|
||||
|
||||
wx_append_sources(QA_FILES QA)
|
||||
|
||||
wx_add_library(wxqa ${QA_FILES})
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
# Licence: wxWindows licence
|
||||
#############################################################################
|
||||
|
||||
include(../../source_groups.cmake)
|
||||
|
||||
wx_append_sources(RIBBON_FILES RIBBON)
|
||||
|
||||
wx_add_library(wxribbon ${RIBBON_FILES})
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
# Licence: wxWindows licence
|
||||
#############################################################################
|
||||
|
||||
include(../../source_groups.cmake)
|
||||
|
||||
wx_append_sources(RICHTEXT_FILES RICHTEXT)
|
||||
|
||||
wx_add_library(wxrichtext ${RICHTEXT_FILES})
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
# Licence: wxWindows licence
|
||||
#############################################################################
|
||||
|
||||
include(../../source_groups.cmake)
|
||||
|
||||
wx_append_sources(STC_FILES STC_CMN)
|
||||
|
||||
if(WXOSX_COCOA)
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
# Licence: wxWindows licence
|
||||
#############################################################################
|
||||
|
||||
include(../../source_groups.cmake)
|
||||
|
||||
function(wx_webview_copy_webview2_loader target)
|
||||
if(NOT WXMSW OR NOT wxUSE_WEBVIEW_EDGE OR NOT TARGET ${target})
|
||||
return()
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
# Licence: wxWindows licence
|
||||
#############################################################################
|
||||
|
||||
include(../../source_groups.cmake)
|
||||
|
||||
wx_append_sources(XML_FILES XML)
|
||||
wx_add_library(wxxml IS_BASE ${XML_FILES})
|
||||
wx_lib_link_libraries(wxxml PRIVATE ${EXPAT_LIBRARIES})
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
# Licence: wxWindows licence
|
||||
#############################################################################
|
||||
|
||||
include(../../source_groups.cmake)
|
||||
|
||||
wx_append_sources(XRC_FILES XRC)
|
||||
|
||||
wx_add_library(wxxrc ${XRC_FILES})
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
list(APPEND CMAKE_MODULE_PATH "${wxSOURCE_DIR}/build/cmake/modules")
|
||||
|
||||
include(build/cmake/files.cmake) # Files list
|
||||
include(build/cmake/source_groups.cmake) # source group definitions
|
||||
include(build/cmake/functions.cmake) # wxWidgets functions
|
||||
include(build/cmake/toolkit.cmake) # Platform/toolkit settings
|
||||
include(build/cmake/options.cmake) # User options
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
|
||||
# Define source groups for supported IDEs
|
||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
|
||||
function(wx_set_source_groups)
|
||||
source_group("Common Headers" REGULAR_EXPRESSION "${wxSOURCE_DIR}/include/wx/.*\\.h")
|
||||
source_group("Common Sources" REGULAR_EXPRESSION "${wxSOURCE_DIR}/src/common/.*")
|
||||
source_group("GTK+ Sources" REGULAR_EXPRESSION "${wxSOURCE_DIR}/src/gtk/.*")
|
||||
@@ -26,3 +28,4 @@ source_group("wxUniv Headers" REGULAR_EXPRESSION "${wxSOURCE_DIR}/include/wx/uni
|
||||
source_group("wxHTML Headers" REGULAR_EXPRESSION "${wxSOURCE_DIR}/include/wx/html/.*")
|
||||
source_group("Setup Headers" FILES ${wxSETUP_HEADER_FILE})
|
||||
source_group("Resource Files" REGULAR_EXPRESSION "${wxSOURCE_DIR}/[^.]*.(rc|ico|png|icns)$")
|
||||
endfunction()
|
||||
|
||||
Reference in New Issue
Block a user