diff options
author | Andrei Lebedev <lebdron@gmail.com> | 2020-09-23 21:50:46 +0300 |
---|---|---|
committer | Vitaly Buka <vitalybuka@gmail.com> | 2020-11-05 17:13:42 -0800 |
commit | 8372739ac3643bb0562dfa55ae307185449e80b8 (patch) | |
tree | 62680f0d7f753dc8f8c9707a3afac934575f2d09 | |
parent | 9776d42db2d285432a24cd79a991ba3ff4e307ba (diff) | |
download | libprotobuf-mutator-8372739ac3643bb0562dfa55ae307185449e80b8.tar.gz |
Add CMake targets installation
Signed-off-by: Andrei Lebedev <lebdron@gmail.com>
-rw-r--r-- | CMakeLists.txt | 5 | ||||
-rw-r--r-- | libprotobuf-mutatorConfig.cmake.in | 5 | ||||
-rw-r--r-- | src/CMakeLists.txt | 4 | ||||
-rw-r--r-- | src/libfuzzer/CMakeLists.txt | 4 |
4 files changed, 16 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index d9be154..a8fe9e6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -150,6 +150,11 @@ if (NOT "${LIB_PROTO_MUTATOR_FUZZER_LIBRARIES}" STREQUAL "" OR add_subdirectory(examples EXCLUDE_FROM_ALL) endif() +install(EXPORT libprotobuf-mutatorTargets FILE libprotobuf-mutatorTargets.cmake + NAMESPACE libprotobuf-mutator:: DESTINATION lib/cmake/libprotobuf-mutator) +configure_file(libprotobuf-mutatorConfig.cmake.in libprotobuf-mutatorConfig.cmake @ONLY) +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libprotobuf-mutatorConfig.cmake" + DESTINATION lib/cmake/libprotobuf-mutator) configure_file("libprotobuf-mutator.pc.in" "libprotobuf-mutator.pc" @ONLY) install(FILES "${CMAKE_BINARY_DIR}/libprotobuf-mutator.pc" DESTINATION ${PKG_CONFIG_PATH}) diff --git a/libprotobuf-mutatorConfig.cmake.in b/libprotobuf-mutatorConfig.cmake.in new file mode 100644 index 0000000..f62a501 --- /dev/null +++ b/libprotobuf-mutatorConfig.cmake.in @@ -0,0 +1,5 @@ +include(CMakeFindDependencyMacro) + +find_dependency(Protobuf REQUIRED) + +include("${CMAKE_CURRENT_LIST_DIR}/libprotobuf-mutatorTargets.cmake") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 19f4406..d0af1b6 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -60,5 +60,7 @@ if (LIB_PROTO_MUTATOR_TESTING) endif() install(TARGETS protobuf-mutator + EXPORT libprotobuf-mutatorTargets ARCHIVE DESTINATION ${LIB_DIR} - LIBRARY DESTINATION ${LIB_DIR}) + LIBRARY DESTINATION ${LIB_DIR} + INCLUDES DESTINATION include/libprotobuf-mutator include/libprotobuf-mutator/src) diff --git a/src/libfuzzer/CMakeLists.txt b/src/libfuzzer/CMakeLists.txt index 8fc78e6..85e9f4d 100644 --- a/src/libfuzzer/CMakeLists.txt +++ b/src/libfuzzer/CMakeLists.txt @@ -23,8 +23,10 @@ set_target_properties(protobuf-mutator-libfuzzer PROPERTIES SOVERSION 0) install(TARGETS protobuf-mutator-libfuzzer + EXPORT libprotobuf-mutatorTargets ARCHIVE DESTINATION ${LIB_DIR} - LIBRARY DESTINATION ${LIB_DIR}) + LIBRARY DESTINATION ${LIB_DIR} + INCLUDES DESTINATION include/libprotobuf-mutator include/libprotobuf-mutator/src) if (LIB_PROTO_MUTATOR_TESTING) add_executable(libfuzzer_test |