Skip to content

Commit

Permalink
Add CMake targets installation
Browse files Browse the repository at this point in the history
Signed-off-by: Andrei Lebedev <[email protected]>
  • Loading branch information
lebdron authored and vitalybuka committed Nov 6, 2020
1 parent 9776d42 commit 8372739
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down
5 changes: 5 additions & 0 deletions libprotobuf-mutatorConfig.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
include(CMakeFindDependencyMacro)

find_dependency(Protobuf REQUIRED)

include("${CMAKE_CURRENT_LIST_DIR}/libprotobuf-mutatorTargets.cmake")
4 changes: 3 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
4 changes: 3 additions & 1 deletion src/libfuzzer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8372739

Please sign in to comment.