Merge pull request #513 from jmellorcrummey/fix-openmp-link
[dyninst.git] / examples / CMakeLists.txt
1
2
3 add_executable(unstrip unstrip.dir/unstrip.C
4                        unstrip.dir/util.C
5                        unstrip.dir/types.C
6                        unstrip.dir/semanticDescriptor.C
7                        unstrip.dir/database.C
8                        unstrip.dir/fingerprint.C
9                        unstrip.dir/callback.C)
10 add_dependencies(unstrip parseAPI symtabAPI instructionAPI common)
11 target_link_libraries(unstrip parseAPI symtabAPI instructionAPI common dynDwarf dynElf ${Boost_LIBRARIES})
12
13 add_executable(codeCoverage codeCoverage.dir/codeCoverage.C)
14 add_dependencies(codeCoverage dyninstAPI patchAPI parseAPI symtabAPI instructionAPI pcontrol common stackwalk dynDwarf dynElf)
15 target_link_libraries(codeCoverage dyninstAPI patchAPI parseAPI symtabAPI instructionAPI pcontrol common stackwalk dynDwarf dynElf ${Boost_LIBRARIES})
16
17 add_library(Inst SHARED codeCoverage.dir/libInst.C)
18
19 add_executable(cfg_to_dot ../parseAPI/doc/example.cc)
20 add_dependencies(cfg_to_dot parseAPI symtabAPI instructionAPI common dynDwarf dynElf)
21 target_link_libraries(cfg_to_dot parseAPI symtabAPI instructionAPI common dynDwarf dynElf ${Boost_LIBRARIES})
22 #add_executable(retee)
23
24 if (USE_OpenMP MATCHES "ON")
25 set_target_properties (unstrip PROPERTIES LINK_FLAGS "-fopenmp")
26 set_target_properties (codeCoverage PROPERTIES LINK_FLAGS "-fopenmp")
27 set_target_properties (cfg_to_dot PROPERTIES LINK_FLAGS "-fopenmp")
28 endif()
29
30
31 install (TARGETS cfg_to_dot unstrip codeCoverage Inst
32         RUNTIME DESTINATION ${INSTALL_BIN_DIR}
33         LIBRARY DESTINATION ${INSTALL_LIB_DIR}
34         ARCHIVE DESTINATION ${INSTALL_LIB_DIR}
35         PUBLIC_HEADER DESTINATION ${INSTALL_INCLUDE_DIR}
36 )
37
38 install (
39         FILES unstrip.dir/ddb.db unstrip.dir/params.db unstrip.dir/unistd.db DESTINATION ${INSTALL_BIN_DIR}
40 )