Skip to content

Commit

Permalink
Add module cmake file
Browse files Browse the repository at this point in the history
  • Loading branch information
z4kn4fein committed Aug 22, 2024
1 parent d8fd63e commit 4ed578e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
13 changes: 1 addition & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,7 @@ message(VERBOSE " CMAKE_CXX_COMPILER_VERSION: ${CMAKE_CXX_COMPILER_VERSION}")
message(VERBOSE " CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}")

if(SEMVER_BUILD_MODULE)
add_library(${PROJECT_NAME})
set_target_properties(${PROJECT_NAME} PROPERTIES
CXX_STANDARD_REQUIRED ON
CXX_EXTENSIONS OFF)
target_sources(${PROJECT_NAME}
PUBLIC
FILE_SET CXX_MODULES FILES module/semver.cppm)
target_include_directories(${PROJECT_NAME}
PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)
target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_20)
add_subdirectory(module)
else()
add_library(${PROJECT_NAME} INTERFACE)
target_include_directories(
Expand Down
10 changes: 10 additions & 0 deletions module/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
add_library(${PROJECT_NAME})
set_target_properties(${PROJECT_NAME} PROPERTIES
CXX_STANDARD_REQUIRED ON
CXX_EXTENSIONS OFF)
target_sources(${PROJECT_NAME} PUBLIC
FILE_SET CXX_MODULES FILES semver.cppm)
target_include_directories(${PROJECT_NAME} PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)
target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_20)

0 comments on commit 4ed578e

Please sign in to comment.