1 # Copyright (c) Facebook, Inc. 2 # Licensed under the Apache License, Version 2.0 (the "License") 3 4 include_directories(${CMAKE_SOURCE_DIR}/src/cc) 5 include_directories(${CMAKE_SOURCE_DIR}/src/cc/api) 6 7 option(INSTALL_CPP_EXAMPLES "Install C++ examples. Those binaries are statically linked and can take plenty of disk space" OFF) 8 9 add_executable(HelloWorld HelloWorld.cc) 10 target_link_libraries(HelloWorld bcc-static) 11 12 add_executable(CPUDistribution CPUDistribution.cc) 13 target_link_libraries(CPUDistribution bcc-static) 14 15 add_executable(RecordMySQLQuery RecordMySQLQuery.cc) 16 target_link_libraries(RecordMySQLQuery bcc-static) 17 18 add_executable(TCPSendStack TCPSendStack.cc) 19 target_link_libraries(TCPSendStack bcc-static) 20 21 add_executable(RandomRead RandomRead.cc) 22 target_link_libraries(RandomRead bcc-static) 23 24 add_executable(LLCStat LLCStat.cc) 25 target_link_libraries(LLCStat bcc-static) 26 27 add_executable(FollyRequestContextSwitch FollyRequestContextSwitch.cc) 28 target_link_libraries(FollyRequestContextSwitch bcc-static) 29 30 add_executable(UseExternalMap UseExternalMap.cc) 31 target_link_libraries(UseExternalMap bcc-static) 32 33 if(INSTALL_CPP_EXAMPLES) 34 install (TARGETS HelloWorld DESTINATION share/bcc/examples/cpp) 35 install (TARGETS CPUDistribution DESTINATION share/bcc/examples/cpp) 36 install (TARGETS RecordMySQLQuery DESTINATION share/bcc/examples/cpp) 37 install (TARGETS TCPSendStack DESTINATION share/bcc/examples/cpp) 38 install (TARGETS RandomRead DESTINATION share/bcc/examples/cpp) 39 install (TARGETS LLCStat DESTINATION share/bcc/examples/cpp) 40 install (TARGETS FollyRequestContextSwitch DESTINATION share/bcc/examples/cpp) 41 install (TARGETS UseExternalMap DESTINATION share/bcc/examples/cpp) 42 endif(INSTALL_CPP_EXAMPLES) 43