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")
|
set_target_properties(${target_name} PROPERTIES LINK_FLAGS "-pthread")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
wx_set_source_groups()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
# Set common properties on wx library target
|
# Set common properties on wx library target
|
||||||
|
|||||||
@@ -7,8 +7,6 @@
|
|||||||
# Licence: wxWindows licence
|
# Licence: wxWindows licence
|
||||||
#############################################################################
|
#############################################################################
|
||||||
|
|
||||||
include(../source_groups.cmake)
|
|
||||||
|
|
||||||
if(wxBUILD_MONOLITHIC)
|
if(wxBUILD_MONOLITHIC)
|
||||||
# Initialize variables for monolithic build
|
# Initialize variables for monolithic build
|
||||||
set(wxMONO_SRC_FILES)
|
set(wxMONO_SRC_FILES)
|
||||||
|
|||||||
@@ -7,6 +7,4 @@
|
|||||||
# Licence: wxWindows licence
|
# Licence: wxWindows licence
|
||||||
#############################################################################
|
#############################################################################
|
||||||
|
|
||||||
include(../../source_groups.cmake)
|
|
||||||
|
|
||||||
wx_add_library(wxadv "${wxSOURCE_DIR}/src/common/dummy.cpp")
|
wx_add_library(wxadv "${wxSOURCE_DIR}/src/common/dummy.cpp")
|
||||||
|
|||||||
@@ -7,8 +7,6 @@
|
|||||||
# Licence: wxWindows licence
|
# Licence: wxWindows licence
|
||||||
#############################################################################
|
#############################################################################
|
||||||
|
|
||||||
include(../../source_groups.cmake)
|
|
||||||
|
|
||||||
wx_append_sources(AUI_FILES AUI_CMN)
|
wx_append_sources(AUI_FILES AUI_CMN)
|
||||||
|
|
||||||
if(WXMSW)
|
if(WXMSW)
|
||||||
|
|||||||
@@ -7,8 +7,6 @@
|
|||||||
# Licence: wxWindows licence
|
# Licence: wxWindows licence
|
||||||
#############################################################################
|
#############################################################################
|
||||||
|
|
||||||
include(../../source_groups.cmake)
|
|
||||||
|
|
||||||
wx_append_sources(BASE_FILES BASE_CMN)
|
wx_append_sources(BASE_FILES BASE_CMN)
|
||||||
wx_append_sources(BASE_FILES BASE_AND_GUI_CMN)
|
wx_append_sources(BASE_FILES BASE_AND_GUI_CMN)
|
||||||
|
|
||||||
|
|||||||
@@ -7,8 +7,6 @@
|
|||||||
# Licence: wxWindows licence
|
# Licence: wxWindows licence
|
||||||
#############################################################################
|
#############################################################################
|
||||||
|
|
||||||
include(../../source_groups.cmake)
|
|
||||||
|
|
||||||
wx_append_sources(CORE_SRC GUI_CMN)
|
wx_append_sources(CORE_SRC GUI_CMN)
|
||||||
wx_append_sources(CORE_SRC BASE_AND_GUI_CMN)
|
wx_append_sources(CORE_SRC BASE_AND_GUI_CMN)
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
|
|||||||
@@ -7,8 +7,6 @@
|
|||||||
# Licence: wxWindows licence
|
# Licence: wxWindows licence
|
||||||
#############################################################################
|
#############################################################################
|
||||||
|
|
||||||
include(../../source_groups.cmake)
|
|
||||||
|
|
||||||
wx_append_sources(GL_FILES OPENGL_CMN)
|
wx_append_sources(GL_FILES OPENGL_CMN)
|
||||||
|
|
||||||
if(WXMSW)
|
if(WXMSW)
|
||||||
|
|||||||
@@ -7,8 +7,6 @@
|
|||||||
# Licence: wxWindows licence
|
# Licence: wxWindows licence
|
||||||
#############################################################################
|
#############################################################################
|
||||||
|
|
||||||
include(../../source_groups.cmake)
|
|
||||||
|
|
||||||
wx_append_sources(HTML_FILES HTML_CMN)
|
wx_append_sources(HTML_FILES HTML_CMN)
|
||||||
|
|
||||||
if(WIN32 OR wxUSE_LIBMSPACK)
|
if(WIN32 OR wxUSE_LIBMSPACK)
|
||||||
|
|||||||
@@ -7,8 +7,6 @@
|
|||||||
# Licence: wxWindows licence
|
# Licence: wxWindows licence
|
||||||
#############################################################################
|
#############################################################################
|
||||||
|
|
||||||
include(../../source_groups.cmake)
|
|
||||||
|
|
||||||
wx_append_sources(MEDIA_FILES MEDIA_CMN)
|
wx_append_sources(MEDIA_FILES MEDIA_CMN)
|
||||||
|
|
||||||
if(WXMSW)
|
if(WXMSW)
|
||||||
|
|||||||
@@ -7,8 +7,6 @@
|
|||||||
# Licence: wxWindows licence
|
# Licence: wxWindows licence
|
||||||
#############################################################################
|
#############################################################################
|
||||||
|
|
||||||
include(../../source_groups.cmake)
|
|
||||||
|
|
||||||
wx_append_sources(NET_FILES NET_CMN)
|
wx_append_sources(NET_FILES NET_CMN)
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
|
|||||||
@@ -7,8 +7,6 @@
|
|||||||
# Licence: wxWindows licence
|
# Licence: wxWindows licence
|
||||||
#############################################################################
|
#############################################################################
|
||||||
|
|
||||||
include(../../source_groups.cmake)
|
|
||||||
|
|
||||||
wx_append_sources(PROPGRID_FILES PROPGRID)
|
wx_append_sources(PROPGRID_FILES PROPGRID)
|
||||||
|
|
||||||
wx_add_library(wxpropgrid ${PROPGRID_FILES})
|
wx_add_library(wxpropgrid ${PROPGRID_FILES})
|
||||||
|
|||||||
@@ -7,8 +7,6 @@
|
|||||||
# Licence: wxWindows licence
|
# Licence: wxWindows licence
|
||||||
#############################################################################
|
#############################################################################
|
||||||
|
|
||||||
include(../../source_groups.cmake)
|
|
||||||
|
|
||||||
wx_append_sources(QA_FILES QA)
|
wx_append_sources(QA_FILES QA)
|
||||||
|
|
||||||
wx_add_library(wxqa ${QA_FILES})
|
wx_add_library(wxqa ${QA_FILES})
|
||||||
|
|||||||
@@ -7,8 +7,6 @@
|
|||||||
# Licence: wxWindows licence
|
# Licence: wxWindows licence
|
||||||
#############################################################################
|
#############################################################################
|
||||||
|
|
||||||
include(../../source_groups.cmake)
|
|
||||||
|
|
||||||
wx_append_sources(RIBBON_FILES RIBBON)
|
wx_append_sources(RIBBON_FILES RIBBON)
|
||||||
|
|
||||||
wx_add_library(wxribbon ${RIBBON_FILES})
|
wx_add_library(wxribbon ${RIBBON_FILES})
|
||||||
|
|||||||
@@ -7,8 +7,6 @@
|
|||||||
# Licence: wxWindows licence
|
# Licence: wxWindows licence
|
||||||
#############################################################################
|
#############################################################################
|
||||||
|
|
||||||
include(../../source_groups.cmake)
|
|
||||||
|
|
||||||
wx_append_sources(RICHTEXT_FILES RICHTEXT)
|
wx_append_sources(RICHTEXT_FILES RICHTEXT)
|
||||||
|
|
||||||
wx_add_library(wxrichtext ${RICHTEXT_FILES})
|
wx_add_library(wxrichtext ${RICHTEXT_FILES})
|
||||||
|
|||||||
@@ -7,8 +7,6 @@
|
|||||||
# Licence: wxWindows licence
|
# Licence: wxWindows licence
|
||||||
#############################################################################
|
#############################################################################
|
||||||
|
|
||||||
include(../../source_groups.cmake)
|
|
||||||
|
|
||||||
wx_append_sources(STC_FILES STC_CMN)
|
wx_append_sources(STC_FILES STC_CMN)
|
||||||
|
|
||||||
if(WXOSX_COCOA)
|
if(WXOSX_COCOA)
|
||||||
|
|||||||
@@ -7,8 +7,6 @@
|
|||||||
# Licence: wxWindows licence
|
# Licence: wxWindows licence
|
||||||
#############################################################################
|
#############################################################################
|
||||||
|
|
||||||
include(../../source_groups.cmake)
|
|
||||||
|
|
||||||
function(wx_webview_copy_webview2_loader target)
|
function(wx_webview_copy_webview2_loader target)
|
||||||
if(NOT WXMSW OR NOT wxUSE_WEBVIEW_EDGE OR NOT TARGET ${target})
|
if(NOT WXMSW OR NOT wxUSE_WEBVIEW_EDGE OR NOT TARGET ${target})
|
||||||
return()
|
return()
|
||||||
|
|||||||
@@ -7,8 +7,6 @@
|
|||||||
# Licence: wxWindows licence
|
# Licence: wxWindows licence
|
||||||
#############################################################################
|
#############################################################################
|
||||||
|
|
||||||
include(../../source_groups.cmake)
|
|
||||||
|
|
||||||
wx_append_sources(XML_FILES XML)
|
wx_append_sources(XML_FILES XML)
|
||||||
wx_add_library(wxxml IS_BASE ${XML_FILES})
|
wx_add_library(wxxml IS_BASE ${XML_FILES})
|
||||||
wx_lib_link_libraries(wxxml PRIVATE ${EXPAT_LIBRARIES})
|
wx_lib_link_libraries(wxxml PRIVATE ${EXPAT_LIBRARIES})
|
||||||
|
|||||||
@@ -7,8 +7,6 @@
|
|||||||
# Licence: wxWindows licence
|
# Licence: wxWindows licence
|
||||||
#############################################################################
|
#############################################################################
|
||||||
|
|
||||||
include(../../source_groups.cmake)
|
|
||||||
|
|
||||||
wx_append_sources(XRC_FILES XRC)
|
wx_append_sources(XRC_FILES XRC)
|
||||||
|
|
||||||
wx_add_library(wxxrc ${XRC_FILES})
|
wx_add_library(wxxrc ${XRC_FILES})
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
list(APPEND CMAKE_MODULE_PATH "${wxSOURCE_DIR}/build/cmake/modules")
|
list(APPEND CMAKE_MODULE_PATH "${wxSOURCE_DIR}/build/cmake/modules")
|
||||||
|
|
||||||
include(build/cmake/files.cmake) # Files list
|
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/functions.cmake) # wxWidgets functions
|
||||||
include(build/cmake/toolkit.cmake) # Platform/toolkit settings
|
include(build/cmake/toolkit.cmake) # Platform/toolkit settings
|
||||||
include(build/cmake/options.cmake) # User options
|
include(build/cmake/options.cmake) # User options
|
||||||
|
|||||||
@@ -9,20 +9,23 @@
|
|||||||
|
|
||||||
# Define source groups for supported IDEs
|
# Define source groups for supported IDEs
|
||||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||||
source_group("Common Headers" REGULAR_EXPRESSION "${wxSOURCE_DIR}/include/wx/.*\\.h")
|
|
||||||
source_group("Common Sources" REGULAR_EXPRESSION "${wxSOURCE_DIR}/src/common/.*")
|
function(wx_set_source_groups)
|
||||||
source_group("GTK+ Sources" REGULAR_EXPRESSION "${wxSOURCE_DIR}/src/gtk/.*")
|
source_group("Common Headers" REGULAR_EXPRESSION "${wxSOURCE_DIR}/include/wx/.*\\.h")
|
||||||
source_group("MSW Sources" REGULAR_EXPRESSION "${wxSOURCE_DIR}/src/msw/.*")
|
source_group("Common Sources" REGULAR_EXPRESSION "${wxSOURCE_DIR}/src/common/.*")
|
||||||
source_group("OSX Sources" REGULAR_EXPRESSION "${wxSOURCE_DIR}/src/osx/.*")
|
source_group("GTK+ Sources" REGULAR_EXPRESSION "${wxSOURCE_DIR}/src/gtk/.*")
|
||||||
source_group("Generic Sources" REGULAR_EXPRESSION "${wxSOURCE_DIR}/src/generic/.*")
|
source_group("MSW Sources" REGULAR_EXPRESSION "${wxSOURCE_DIR}/src/msw/.*")
|
||||||
source_group("wxUniv Sources" REGULAR_EXPRESSION "${wxSOURCE_DIR}/src/univ/.*")
|
source_group("OSX Sources" REGULAR_EXPRESSION "${wxSOURCE_DIR}/src/osx/.*")
|
||||||
source_group("wxHTML Sources" REGULAR_EXPRESSION "${wxSOURCE_DIR}/src/html/.*")
|
source_group("Generic Sources" REGULAR_EXPRESSION "${wxSOURCE_DIR}/src/generic/.*")
|
||||||
source_group("Setup Headers" REGULAR_EXPRESSION "${wxSOURCE_DIR}/include/.*/setup.h")
|
source_group("wxUniv Sources" REGULAR_EXPRESSION "${wxSOURCE_DIR}/src/univ/.*")
|
||||||
source_group("GTK+ Headers" REGULAR_EXPRESSION "${wxSOURCE_DIR}/include/wx/gtk/.*")
|
source_group("wxHTML Sources" REGULAR_EXPRESSION "${wxSOURCE_DIR}/src/html/.*")
|
||||||
source_group("MSW Headers" REGULAR_EXPRESSION "${wxSOURCE_DIR}/include/wx/msw/.*")
|
source_group("Setup Headers" REGULAR_EXPRESSION "${wxSOURCE_DIR}/include/.*/setup.h")
|
||||||
source_group("OSX Headers" REGULAR_EXPRESSION "${wxSOURCE_DIR}/include/wx/osx/.*")
|
source_group("GTK+ Headers" REGULAR_EXPRESSION "${wxSOURCE_DIR}/include/wx/gtk/.*")
|
||||||
source_group("Generic Headers" REGULAR_EXPRESSION "${wxSOURCE_DIR}/include/wx/generic/.*")
|
source_group("MSW Headers" REGULAR_EXPRESSION "${wxSOURCE_DIR}/include/wx/msw/.*")
|
||||||
source_group("wxUniv Headers" REGULAR_EXPRESSION "${wxSOURCE_DIR}/include/wx/univ/.*")
|
source_group("OSX Headers" REGULAR_EXPRESSION "${wxSOURCE_DIR}/include/wx/osx/.*")
|
||||||
source_group("wxHTML Headers" REGULAR_EXPRESSION "${wxSOURCE_DIR}/include/wx/html/.*")
|
source_group("Generic Headers" REGULAR_EXPRESSION "${wxSOURCE_DIR}/include/wx/generic/.*")
|
||||||
source_group("Setup Headers" FILES ${wxSETUP_HEADER_FILE})
|
source_group("wxUniv Headers" REGULAR_EXPRESSION "${wxSOURCE_DIR}/include/wx/univ/.*")
|
||||||
source_group("Resource Files" REGULAR_EXPRESSION "${wxSOURCE_DIR}/[^.]*.(rc|ico|png|icns)$")
|
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