Skip to content

Commit

Permalink
test 3
Browse files Browse the repository at this point in the history
  • Loading branch information
Mizux committed Sep 13, 2023
1 parent 2b9c557 commit 4c4a0b0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file is just an orchestration
cmake_minimum_required(VERSION 3.21)
cmake_minimum_required(VERSION 3.21..3.27)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")

option(CMAKE_EXPORT_COMPILE_COMMANDS "Export compile command" TRUE)
Expand Down
19 changes: 14 additions & 5 deletions cmake/cpp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,15 @@ add_subdirectory(Foo)
add_subdirectory(Bar)
add_subdirectory(FooBar)

add_library(Full INTERFACE)
target_link_libraries(Full INTERFACE
add_library(Full)
target_include_directories(Full
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/Foo/include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/Bar/include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/FooBar/include>
$<INSTALL_INTERFACE:include>)
#target_link_libraries(Full INTERFACE
target_sources(Full PRIVATE
$<TARGET_OBJECTS:Bar>
$<TARGET_OBJECTS:Foo>
$<TARGET_OBJECTS:FooBar>
Expand Down Expand Up @@ -146,9 +153,11 @@ function(add_cpp_example FILE_NAME)
target_include_directories(${EXAMPLE_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_compile_features(${EXAMPLE_NAME} PRIVATE cxx_std_20)
target_link_libraries(${EXAMPLE_NAME} PRIVATE
${PROJECT_NAMESPACE}::Foo
${PROJECT_NAMESPACE}::Bar
${PROJECT_NAMESPACE}::FooBar)
Full
#${PROJECT_NAMESPACE}::Foo
#${PROJECT_NAMESPACE}::Bar
#${PROJECT_NAMESPACE}::FooBar
)

include(GNUInstallDirs)
install(TARGETS ${EXAMPLE_NAME})
Expand Down

0 comments on commit 4c4a0b0

Please sign in to comment.