Skip to content

Commit 5d46ee4

Browse files
committed
Fix build and install for pre-cmake 3.23
1 parent 80261ce commit 5d46ee4

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ target_sources(
157157
src/platform/dbghelp_utils.cpp
158158
)
159159

160-
if(HAS_CXX20_MODULES)
160+
if(HAS_CXX20_MODULES AND CMAKE_VERSION VERSION_GREATER_EQUAL "3.23")
161161
target_sources(
162162
${target_name} PUBLIC
163163
FILE_SET CXX_MODULES

cmake/InstallRules.cmake

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,15 @@ install(
1414

1515
# copy target build output artifacts to OS dependent locations
1616
# (Except includes, that just sets a compiler flag with the path)
17+
18+
if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.23")
19+
set(
20+
FILE_SET_ARGS
21+
FILE_SET CXX_MODULES
22+
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/cpptrace"
23+
)
24+
endif()
25+
1726
install(
1827
TARGETS ${target_name}
1928
EXPORT ${package_name}-targets
@@ -26,8 +35,7 @@ install(
2635
COMPONENT ${package_name}_development
2736
INCLUDES #
2837
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
29-
FILE_SET CXX_MODULES
30-
DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/cpptrace"
38+
${FILE_SET_ARGS}
3139
)
3240

3341
# create config file that points to targets file

0 commit comments

Comments
 (0)