From b363160d5212ac9ea118eb343b204efa9c74eb5a Mon Sep 17 00:00:00 2001 From: bergmann Date: Mon, 22 Jul 2019 18:49:27 +0200 Subject: [PATCH] Added support to export cmake targets --- CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c209683..dd2e3fb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,6 +45,7 @@ set_target_properties(json-schema-validator SOVERSION 1) install(TARGETS json-schema-validator + EXPORT json-schema-validator LIBRARY DESTINATION lib ARCHIVE DESTINATION lib RUNTIME DESTINATION bin) @@ -55,7 +56,8 @@ install(DIRECTORY src/ target_include_directories(json-schema-validator PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR}/src) + $ + $) target_compile_features(json-schema-validator PUBLIC @@ -117,3 +119,7 @@ if (BUILD_TESTS) enable_testing() add_subdirectory(test) endif() + +install ( EXPORT json-schema-validator + NAMESPACE json-schema-validator:: + DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}" )