Add auto-PLATFORM check; add flag for building 32-bit RTlib on 64-bit platforms.
[dyninst.git] / CMakeLists.txt
1 cmake_minimum_required (VERSION 2.6)
2 project (Dyninst)
3
4 set (SOVERSION "8.1")
5 set (LIBVERSION "8.1.1")
6
7 set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake/Modules")
8 include (cmake/platform.cmake)
9 include (cmake/cap_arch_def.cmake)
10 include (cmake/c++11.cmake)
11 include (cmake/warnings.cmake)
12 include (cmake/packages.cmake)
13 include (cmake/options.cmake)
14
15 set (BUILD_SHARED_LIBS ON)
16
17 include_directories (
18                     ${PROJECT_SOURCE_DIR}
19                     ${PROJECT_SOURCE_DIR}/external
20   )
21
22 set (HEADER_DIRS dataflowAPI
23                  dwarf
24                  dyninstAPI
25                  dyninstAPI_RT
26                  dynutil
27                  elf
28                  instructionAPI
29                  parseAPI
30                  patchAPI
31                  proccontrol
32                  stackwalk
33                  symlite
34                  symtabAPI
35     )
36
37 foreach (dir ${HEADER_DIRS})
38   include_directories ( ${PROJECT_SOURCE_DIR}/${dir}/h )
39 endforeach()
40
41 # Component time
42 add_subdirectory (dynutil)
43 add_subdirectory (common)
44 add_subdirectory (elf)
45 add_subdirectory (dwarf)
46 add_subdirectory (instructionAPI)
47 add_subdirectory (symtabAPI)
48 add_subdirectory (symlite)
49 add_subdirectory (parseAPI)
50 add_subdirectory (patchAPI)
51 add_subdirectory (proccontrol)
52 add_subdirectory (stackwalk)
53 add_subdirectory (dyninstAPI)
54 add_subdirectory (dyninstAPI_RT)
55
56 SET_TARGET_PROPERTIES (
57    common dynElf dynDwarf instructionAPI symtabAPI symLite parseAPI
58    patchAPI pcontrol stackwalker dyninstAPI dyninstAPI_RT
59    PROPERTIES
60      SOVERSION ${SOVERSION}
61      VERSION ${LIBVERSION}
62 )
63
64 # RTlib properties are set in its CMakeLists.txt; it seems
65 # like multiple set_target_properties calls override instead
66 # of accumulating