-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
executable file
·42 lines (33 loc) · 1.28 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# define CMake Version required
cmake_minimum_required(VERSION 2.6)
# define project name
project(BINTYPE)
# recurse into these subdirectories
add_subdirectory(libtracereader)
# add included header files from these directories
include_directories(${BINTYPE_SOURCE_DIR}/)
include_directories(${BINTYPE_SOURCE_DIR}/libtracereader)
if(CMAKE_SIZEOF_VOID_P EQUAL 8 )
include_directories(${BINTYPE_SOURCE_DIR}/xed2/xed2-intel64/include)
else()
include_directories(${BINTYPE_SOURCE_DIR}/xed2/xed2-ia32/include)
endif()
# add linked library from these directories
link_directories(${BINTYPE_SOURCE_DIR}/libtracereader)
if(CMAKE_SIZEOF_VOID_P EQUAL 8 )
link_directories(${BINTYPE_SOURCE_DIR}/xed2/xed2-intel64/lib)
else()
link_directories(${BINTYPE_SOURCE_DIR}/xed2/xed2-ia32/lib)
endif()
# compile options
add_definitions(-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE)
add_definitions(-Wall -O3 -g3 -Wno-unused-result -Wformat=0)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
add_definitions(-D_BINTYPE_DEBUG -D_BINTYPE_COLLECTOR)
endif()
# add all current source files to $DIR_SRCS
aux_source_directory(${BINTYPE_SOURCE_DIR} DIR_SRCS)
# compile these source files into executable
add_executable(trace_creader ${DIR_SRCS})
# link objects to executable
target_link_libraries(trace_creader tracereader xed)