Skip to content

Commit

Permalink
Added "make install" and pkg-config file.
Browse files Browse the repository at this point in the history
  • Loading branch information
Allen-Webb authored and vitalybuka committed Sep 26, 2018
1 parent c4fa591 commit d5e434f
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ endif()

enable_testing()

set(LIB_DIR "lib${LIB_SUFFIX}")

include(googletest)

if (NOT LIB_PROTO_MUTATOR_CTEST_JOBS)
Expand All @@ -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")
8 changes: 8 additions & 0 deletions libprotobuf-mutator.pc.in
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
2 changes: 2 additions & 0 deletions src/libfuzzer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})

0 comments on commit d5e434f

Please sign in to comment.