Skip to content

Commit cbf081d

Browse files
MaartenBentvadz
authored andcommitted
CMake: fix RegularExpression::compile errors
When the wxWidgets sources are in a path containing '++', CMake would show errors on the command line: [cmake] RegularExpression::compile(): Nested *?+. [cmake] RegularExpression::compile(): Error in compile This happens because the full path was interpreted as a regular expression when creating the source_groups. Without wxSOURCE_DIR the regular expressions still match and create correct source groups, so remove it. See wxWidgets#22738, wxWidgets#23943. (cherry picked from commit b9b0724)
1 parent e30a6a3 commit cbf081d

File tree

2 files changed

+17
-16
lines changed

2 files changed

+17
-16
lines changed

build/cmake/source_groups.cmake

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,22 @@
1111
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
1212

1313
function(wx_set_source_groups)
14-
source_group("Common Headers" REGULAR_EXPRESSION "${wxSOURCE_DIR}/include/wx/.*\\.h")
15-
source_group("Common Sources" REGULAR_EXPRESSION "${wxSOURCE_DIR}/src/common/.*")
16-
source_group("GTK+ Sources" REGULAR_EXPRESSION "${wxSOURCE_DIR}/src/gtk/.*")
17-
source_group("MSW Sources" REGULAR_EXPRESSION "${wxSOURCE_DIR}/src/msw/.*")
18-
source_group("OSX Sources" REGULAR_EXPRESSION "${wxSOURCE_DIR}/src/osx/.*")
19-
source_group("Generic Sources" REGULAR_EXPRESSION "${wxSOURCE_DIR}/src/generic/.*")
20-
source_group("wxUniv Sources" REGULAR_EXPRESSION "${wxSOURCE_DIR}/src/univ/.*")
21-
source_group("wxHTML Sources" REGULAR_EXPRESSION "${wxSOURCE_DIR}/src/html/.*")
22-
source_group("Setup Headers" REGULAR_EXPRESSION "${wxSOURCE_DIR}/include/.*/setup.h")
23-
source_group("GTK+ Headers" REGULAR_EXPRESSION "${wxSOURCE_DIR}/include/wx/gtk/.*")
24-
source_group("MSW Headers" REGULAR_EXPRESSION "${wxSOURCE_DIR}/include/wx/msw/.*")
25-
source_group("OSX Headers" REGULAR_EXPRESSION "${wxSOURCE_DIR}/include/wx/osx/.*")
26-
source_group("Generic Headers" REGULAR_EXPRESSION "${wxSOURCE_DIR}/include/wx/generic/.*")
27-
source_group("wxUniv Headers" REGULAR_EXPRESSION "${wxSOURCE_DIR}/include/wx/univ/.*")
28-
source_group("wxHTML Headers" REGULAR_EXPRESSION "${wxSOURCE_DIR}/include/wx/html/.*")
14+
source_group("Common Headers" REGULAR_EXPRESSION "/include/wx/.*\\.h")
15+
source_group("Common Sources" REGULAR_EXPRESSION "/src/common/.*")
16+
source_group("GTK+ Sources" REGULAR_EXPRESSION "/src/gtk/.*")
17+
source_group("MSW Sources" REGULAR_EXPRESSION "/src/msw/.*")
18+
source_group("OSX Sources" REGULAR_EXPRESSION "/src/osx/.*")
19+
source_group("Generic Sources" REGULAR_EXPRESSION "/src/generic/.*")
20+
source_group("wxUniv Sources" REGULAR_EXPRESSION "/src/univ/.*")
21+
source_group("wxHTML Sources" REGULAR_EXPRESSION "/src/html/.*")
22+
source_group("Setup Headers" REGULAR_EXPRESSION "/include/.*/setup.h")
23+
source_group("GTK+ Headers" REGULAR_EXPRESSION "/include/wx/gtk/.*")
24+
source_group("MSW Headers" REGULAR_EXPRESSION "/include/wx/msw/.*")
25+
source_group("OSX Headers" REGULAR_EXPRESSION "/include/wx/osx/.*")
26+
source_group("Generic Headers" REGULAR_EXPRESSION "/include/wx/generic/.*")
27+
source_group("wxUniv Headers" REGULAR_EXPRESSION "/include/wx/univ/.*")
28+
source_group("wxHTML Headers" REGULAR_EXPRESSION "/include/wx/html/.*")
2929
source_group("Setup Headers" FILES ${wxSETUP_HEADER_FILE})
30-
source_group("Resource Files" REGULAR_EXPRESSION "${wxSOURCE_DIR}/[^.]*.(rc|ico|png|icns|manifest|plist)$")
30+
source_group("Resource Files" REGULAR_EXPRESSION "/[^.]*.(rc|ico|png|icns|manifest|plist)$")
3131
source_group("CMake" REGULAR_EXPRESSION "(CMakeLists\\.txt|cmake_pch.*|.*_CXX_prefix\\.hxx\\.rule)$")
3232
endfunction()

docs/changes.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ All:
249249
- Use /etc/os-release if lsb_release isn't available (Scott Talbert, #23712).
250250
- Add wxUILocale::GetMonthName() and GetWeekDayName() (Ulrich Telle, #23556).
251251
- Support WAV files with LIST chunks under Unix (A. Jiang, #23859).
252+
- Fix CMake build if wxWidgets directory contained "++" (Maarten Bent, #22738).
252253

253254
All (GUI):
254255

0 commit comments

Comments
 (0)