Skip to content

Commit 8372739

Browse files
lebdronvitalybuka
authored andcommitted
Add CMake targets installation
Signed-off-by: Andrei Lebedev <[email protected]>
1 parent 9776d42 commit 8372739

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed

CMakeLists.txt

+5
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,11 @@ if (NOT "${LIB_PROTO_MUTATOR_FUZZER_LIBRARIES}" STREQUAL "" OR
150150
add_subdirectory(examples EXCLUDE_FROM_ALL)
151151
endif()
152152

153+
install(EXPORT libprotobuf-mutatorTargets FILE libprotobuf-mutatorTargets.cmake
154+
NAMESPACE libprotobuf-mutator:: DESTINATION lib/cmake/libprotobuf-mutator)
155+
configure_file(libprotobuf-mutatorConfig.cmake.in libprotobuf-mutatorConfig.cmake @ONLY)
156+
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libprotobuf-mutatorConfig.cmake"
157+
DESTINATION lib/cmake/libprotobuf-mutator)
153158
configure_file("libprotobuf-mutator.pc.in" "libprotobuf-mutator.pc" @ONLY)
154159
install(FILES "${CMAKE_BINARY_DIR}/libprotobuf-mutator.pc"
155160
DESTINATION ${PKG_CONFIG_PATH})

libprotobuf-mutatorConfig.cmake.in

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
include(CMakeFindDependencyMacro)
2+
3+
find_dependency(Protobuf REQUIRED)
4+
5+
include("${CMAKE_CURRENT_LIST_DIR}/libprotobuf-mutatorTargets.cmake")

src/CMakeLists.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -60,5 +60,7 @@ if (LIB_PROTO_MUTATOR_TESTING)
6060
endif()
6161

6262
install(TARGETS protobuf-mutator
63+
EXPORT libprotobuf-mutatorTargets
6364
ARCHIVE DESTINATION ${LIB_DIR}
64-
LIBRARY DESTINATION ${LIB_DIR})
65+
LIBRARY DESTINATION ${LIB_DIR}
66+
INCLUDES DESTINATION include/libprotobuf-mutator include/libprotobuf-mutator/src)

src/libfuzzer/CMakeLists.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@ set_target_properties(protobuf-mutator-libfuzzer PROPERTIES
2323
SOVERSION 0)
2424

2525
install(TARGETS protobuf-mutator-libfuzzer
26+
EXPORT libprotobuf-mutatorTargets
2627
ARCHIVE DESTINATION ${LIB_DIR}
27-
LIBRARY DESTINATION ${LIB_DIR})
28+
LIBRARY DESTINATION ${LIB_DIR}
29+
INCLUDES DESTINATION include/libprotobuf-mutator include/libprotobuf-mutator/src)
2830

2931
if (LIB_PROTO_MUTATOR_TESTING)
3032
add_executable(libfuzzer_test

0 commit comments

Comments
 (0)