Commit f387f5dd authored by Brenden Blanco's avatar Brenden Blanco Committed by GitHub

Merge pull request #1050 from palmtenor/exampleinstall

Add build option for installing C++ examples
parents dd3867d3 db4d4267
...@@ -3,30 +3,35 @@ ...@@ -3,30 +3,35 @@
include_directories(${CMAKE_SOURCE_DIR}/src/cc) include_directories(${CMAKE_SOURCE_DIR}/src/cc)
option(INSTALL_CPP_EXAMPLES "Install C++ examples. Those binaries are statically linked and can take plenty of disk space" OFF)
add_executable(HelloWorld HelloWorld.cc) add_executable(HelloWorld HelloWorld.cc)
target_link_libraries(HelloWorld bcc-static) target_link_libraries(HelloWorld bcc-static)
install (TARGETS HelloWorld DESTINATION share/bcc/examples/cpp)
add_executable(CPUDistribution CPUDistribution.cc) add_executable(CPUDistribution CPUDistribution.cc)
target_link_libraries(CPUDistribution bcc-static) target_link_libraries(CPUDistribution bcc-static)
install (TARGETS CPUDistribution DESTINATION share/bcc/examples/cpp)
add_executable(RecordMySQLQuery RecordMySQLQuery.cc) add_executable(RecordMySQLQuery RecordMySQLQuery.cc)
target_link_libraries(RecordMySQLQuery bcc-static) target_link_libraries(RecordMySQLQuery bcc-static)
install (TARGETS RecordMySQLQuery DESTINATION share/bcc/examples/cpp)
add_executable(TCPSendStack TCPSendStack.cc) add_executable(TCPSendStack TCPSendStack.cc)
target_link_libraries(TCPSendStack bcc-static) target_link_libraries(TCPSendStack bcc-static)
install (TARGETS TCPSendStack DESTINATION share/bcc/examples/cpp)
add_executable(RandomRead RandomRead.cc) add_executable(RandomRead RandomRead.cc)
target_link_libraries(RandomRead bcc-static) target_link_libraries(RandomRead bcc-static)
install (TARGETS RandomRead DESTINATION share/bcc/examples/cpp)
add_executable(LLCStat LLCStat.cc) add_executable(LLCStat LLCStat.cc)
target_link_libraries(LLCStat bcc-static) target_link_libraries(LLCStat bcc-static)
install (TARGETS LLCStat DESTINATION share/bcc/examples/cpp)
add_executable(FollyRequestContextSwitch FollyRequestContextSwitch.cc) add_executable(FollyRequestContextSwitch FollyRequestContextSwitch.cc)
target_link_libraries(FollyRequestContextSwitch bcc-static) target_link_libraries(FollyRequestContextSwitch bcc-static)
install (TARGETS FollyRequestContextSwitch DESTINATION share/bcc/examples/cpp)
if(INSTALL_CPP_EXAMPLES)
install (TARGETS HelloWorld DESTINATION share/bcc/examples/cpp)
install (TARGETS CPUDistribution DESTINATION share/bcc/examples/cpp)
install (TARGETS RecordMySQLQuery DESTINATION share/bcc/examples/cpp)
install (TARGETS TCPSendStack DESTINATION share/bcc/examples/cpp)
install (TARGETS RandomRead DESTINATION share/bcc/examples/cpp)
install (TARGETS LLCStat DESTINATION share/bcc/examples/cpp)
install (TARGETS FollyRequestContextSwitch DESTINATION share/bcc/examples/cpp)
endif(INSTALL_CPP_EXAMPLES)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment