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
.DS_Store

View file

@ -69,10 +69,10 @@ write_basic_package_version_file(
install(
TARGETS ${PROJECT_NAME}
EXPORT ${PROJECT_NAME}Targets
LIBRARY DESTINATION lib/${PROJECT_NAME}-${PROJECT_VERSION} COMPONENT Runtime
ARCHIVE DESTINATION lib/${PROJECT_NAME}-${PROJECT_VERSION} COMPONENT Development
LIBRARY DESTINATION lib COMPONENT Runtime
ARCHIVE DESTINATION lib COMPONENT Development
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
)
@ -81,12 +81,12 @@ include(CMakePackageConfigHelpers)
configure_package_config_file(
"${PROJECT_SOURCE_DIR}/cmake/Config.cmake.in"
"${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
INSTALL_DESTINATION lib/cmake/${PROJECT_NAME}-${PROJECT_VERSION}
INSTALL_DESTINATION lib/cmake
)
install(
EXPORT ${PROJECT_NAME}Targets
DESTINATION lib/cmake/${PROJECT_NAME}-${PROJECT_VERSION}
DESTINATION lib/cmake
)
install(
@ -94,10 +94,10 @@ install(
"${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake"
"${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
DESTINATION
lib/cmake/${PROJECT_NAME}-${PROJECT_VERSION}
lib/cmake
)
install(
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?
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

View file

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