mirror of
https://github.com/TheLartians/ModernCppStarter.git
synced 2025-08-30 21:51:12 +02:00
FIXME: the packageProject() makes the problem
so the standalone project does not build! and the cmake project config files can't be installed this way?
This commit is contained in:
parent
5f9aa807b9
commit
e5c060387e
3 changed files with 18 additions and 13 deletions
|
@ -66,7 +66,8 @@ target_sources(Greeter PRIVATE ${headers} ${sources})
|
|||
# FIXME target_compile_options(Greeter PUBLIC "$<$<BOOL:${MSVC}>:/permissive->")
|
||||
|
||||
# Link dependencies (if required)
|
||||
target_link_libraries(Greeter PRIVATE fmt::fmt-header-only)
|
||||
target_link_libraries(Greeter PUBLIC fmt::fmt-header-only)
|
||||
# XXX target_link_libraries(Greeter PUBLIC fmt::fmt)
|
||||
|
||||
target_include_directories(
|
||||
Greeter PUBLIC $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
|
||||
|
@ -80,13 +81,16 @@ target_include_directories(
|
|||
# header paths
|
||||
string(TOLOWER ${PROJECT_NAME}/version.h VERSION_HEADER_LOCATION)
|
||||
|
||||
packageProject(
|
||||
NAME ${PROJECT_NAME}
|
||||
VERSION ${PROJECT_VERSION}
|
||||
NAMESPACE ${PROJECT_NAME}
|
||||
BINARY_DIR ${PROJECT_BINARY_DIR}
|
||||
INCLUDE_DIR ${PROJECT_SOURCE_DIR}/include
|
||||
INCLUDE_DESTINATION include/${PROJECT_NAME}-${PROJECT_VERSION}
|
||||
VERSION_HEADER "${VERSION_HEADER_LOCATION}"
|
||||
# XXX DEPENDENCIES fmt
|
||||
)
|
||||
# FIXME: CMake Error: install(EXPORT "GreeterTargets" ...) includes target
|
||||
# "Greeter" which requires target "fmt" that is not in any export set.
|
||||
|
||||
# packageProject(
|
||||
# NAME ${PROJECT_NAME}
|
||||
# VERSION ${PROJECT_VERSION}
|
||||
# NAMESPACE ${PROJECT_NAME}
|
||||
# BINARY_DIR ${PROJECT_BINARY_DIR}
|
||||
# INCLUDE_DIR ${PROJECT_SOURCE_DIR}/include
|
||||
# INCLUDE_DESTINATION include/${PROJECT_NAME}-${PROJECT_VERSION}
|
||||
# VERSION_HEADER "${VERSION_HEADER_LOCATION}"
|
||||
# # XXX DEPENDENCIES fmt
|
||||
# )
|
||||
|
|
|
@ -27,5 +27,6 @@ add_executable(GreeterStandalone ${sources})
|
|||
|
||||
# FIXME: WHY? CK
|
||||
# set_target_properties(GreeterStandalone PROPERTIES CXX_STANDARD 17 OUTPUT_NAME "Greeter")
|
||||
target_compile_features(GreeterStandalone PUBLIC cxx_std_17)
|
||||
|
||||
target_link_libraries(GreeterStandalone Greeter::Greeter cxxopts)
|
||||
target_link_libraries(GreeterStandalone PRIVATE Greeter::Greeter cxxopts)
|
||||
|
|
|
@ -39,7 +39,7 @@ CPMAddPackage(
|
|||
|
||||
file(GLOB sources CONFIGURE_DEPENDS source/*.cpp)
|
||||
add_executable(GreeterTests ${sources})
|
||||
target_link_libraries(GreeterTests doctest::doctest Greeter::Greeter)
|
||||
target_link_libraries(GreeterTests PRIVATE doctest::doctest Greeter::Greeter)
|
||||
target_compile_features(GreeterTests PUBLIC cxx_std_17)
|
||||
|
||||
# enable compiler warnings
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue