diff --git a/CMakeLists.txt b/CMakeLists.txt index c018d45..19db93d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -112,6 +112,8 @@ endif() enable_testing() +set(LIB_DIR "lib${LIB_SUFFIX}") + include(googletest) if (NOT LIB_PROTO_MUTATOR_CTEST_JOBS) @@ -127,3 +129,8 @@ if (NOT "${LIB_PROTO_MUTATOR_FUZZER_LIBRARIES}" STREQUAL "" OR add_subdirectory(examples EXCLUDE_FROM_ALL) endif() +configure_file("libprotobuf-mutator.pc.in" "libprotobuf-mutator.pc" @ONLY) +install(FILES "${CMAKE_BINARY_DIR}/libprotobuf-mutator.pc" + DESTINATION share/pkgconfg) +install(DIRECTORY ./port ./src DESTINATION include/libprotobuf-mutator + FILES_MATCHING PATTERN "*.h") diff --git a/libprotobuf-mutator.pc.in b/libprotobuf-mutator.pc.in new file mode 100644 index 0000000..ac5224e --- /dev/null +++ b/libprotobuf-mutator.pc.in @@ -0,0 +1,8 @@ +prefix=@CMAKE_INSTALL_PREFIX@ +includedir=${prefix}/include/libprotobuf-mutator + +Name: libprotobuf-mutator +Description: randomly mutate protobuffers for fuzzing +Version: 0 +Cflags: -I${includedir} -I${includedir}/src +Libs: -lprotobuf-mutator-libfuzzer -lprotobuf-mutator diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5c13d2d..9d174db 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -52,3 +52,5 @@ foreach(SHARD RANGE ${TEST_SHARDS_MAX}) endforeach(SHARD) add_dependencies(check mutator_test) + +install(TARGETS protobuf-mutator ARCHIVE DESTINATION ${LIB_DIR}) diff --git a/src/libfuzzer/CMakeLists.txt b/src/libfuzzer/CMakeLists.txt index 6677f5e..e72fb65 100644 --- a/src/libfuzzer/CMakeLists.txt +++ b/src/libfuzzer/CMakeLists.txt @@ -20,3 +20,5 @@ target_link_libraries(protobuf-mutator-libfuzzer ${PROTOBUF_LIBRARIES}) set_property(TARGET protobuf-mutator-libfuzzer PROPERTY COMPILE_FLAGS "${NO_FUZZING_FLAGS}") + +install(TARGETS protobuf-mutator-libfuzzer ARCHIVE DESTINATION ${LIB_DIR})