1
0
Fork 0
mirror of https://github.com/TheLartians/ModernCppStarter.git synced 2025-08-30 21:51:12 +02:00

revert install path and set find_package in tests to REQUIRED

This commit is contained in:
Lars Melchior 2020-04-14 11:01:15 +02:00
parent 9084218192
commit 991d397433
4 changed files with 10 additions and 10 deletions

2
.gitignore vendored
View file

@ -1,3 +1,3 @@
/build /build*
/.vscode /.vscode
.DS_Store .DS_Store

View file

@ -69,10 +69,10 @@ write_basic_package_version_file(
install( install(
TARGETS ${PROJECT_NAME} TARGETS ${PROJECT_NAME}
EXPORT ${PROJECT_NAME}Targets EXPORT ${PROJECT_NAME}Targets
LIBRARY DESTINATION lib/${PROJECT_NAME}-${PROJECT_VERSION} COMPONENT Runtime LIBRARY DESTINATION lib COMPONENT Runtime
ARCHIVE DESTINATION lib/${PROJECT_NAME}-${PROJECT_VERSION} COMPONENT Development ARCHIVE DESTINATION lib COMPONENT Development
RUNTIME DESTINATION bin COMPONENT Runtime RUNTIME DESTINATION bin COMPONENT Runtime
PUBLIC_HEADER DESTINATION include/${PROJECT_NAME}-${PROJECT_VERSION} COMPONENT Development PUBLIC_HEADER DESTINATION include COMPONENT Development
BUNDLE DESTINATION bin COMPONENT Runtime BUNDLE DESTINATION bin COMPONENT Runtime
) )
@ -81,12 +81,12 @@ include(CMakePackageConfigHelpers)
configure_package_config_file( configure_package_config_file(
"${PROJECT_SOURCE_DIR}/cmake/Config.cmake.in" "${PROJECT_SOURCE_DIR}/cmake/Config.cmake.in"
"${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake" "${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
INSTALL_DESTINATION lib/cmake/${PROJECT_NAME}-${PROJECT_VERSION} INSTALL_DESTINATION lib/cmake
) )
install( install(
EXPORT ${PROJECT_NAME}Targets EXPORT ${PROJECT_NAME}Targets
DESTINATION lib/cmake/${PROJECT_NAME}-${PROJECT_VERSION} DESTINATION lib/cmake
) )
install( install(
@ -94,10 +94,10 @@ install(
"${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake" "${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
"${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake" "${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
DESTINATION DESTINATION
lib/cmake/${PROJECT_NAME}-${PROJECT_VERSION} lib/cmake
) )
install( install(
DIRECTORY ${PROJECT_SOURCE_DIR}/include/ DIRECTORY ${PROJECT_SOURCE_DIR}/include/
DESTINATION include/${PROJECT_NAME}-${PROJECT_VERSION} DESTINATION include
) )

View file

@ -80,7 +80,7 @@ See [Format.cmake](https://github.com/TheLartians/Format.cmake) for more options
- How do I package my library / executable into an installer? - How do I package my library / executable into an installer?
See the [CPack](https://cmake.org/cmake/help/latest/module/CPack.html) documentation. As there are a lot of possible options and configurations, this is not in the scope of this template. See the [CPack documentation](https://cmake.org/cmake/help/latest/module/CPack.html) for more info.
## Coming soon ## Coming soon

View file

@ -21,7 +21,7 @@ CPMAddPackage(
) )
if (TEST_INSTALLED_VERSION) if (TEST_INSTALLED_VERSION)
find_package(Greeter) find_package(Greeter REQUIRED)
else() else()
CPMAddPackage( CPMAddPackage(
NAME Greeter NAME Greeter