-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
95 lines (80 loc) · 2.04 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
project(SMILE)
set( CMAKE_EXPORT_COMPILE_COMMANDS 1 )
#
# SPARKSEE version (major.minor.release)
#
set(VERSION_MAJOR "0")
set(VERSION_MINOR "0")
set(VERSION_RELEASE "1")
#
# RELEASE is the default build type
#
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE RELEASE)
endif(NOT CMAKE_BUILD_TYPE)
#
# Check 64bits architecture
#
if(CMAKE_SIZEOF_VOID_P MATCHES "4")
set(ARCHTYPE "32")
else(CMAKE_SIZEOF_VOID_P MATCHES "4")
set(ARCHTYPE "64")
endif(CMAKE_SIZEOF_VOID_P MATCHES "4")
#
# Set default definitions
#
set(DEFAULT_DEFINES
)
#
# Set default platform definitions
#
if(UNIX)
set(LINUX 1)
set(SO "linux")
else(UNIX)
set(SO "OTHER")
endif(UNIX)
#
# Set project paths
#
#set(SMILE_DIR "${SMILE_SOURCE_DIR}/src")
#set(SMILE_INCLUDE_DIR "${SMILE_DIR}/")
MESSAGE(STATUS ${SMILE_INCLUDE_DIR})
#
# Enabling testing
#
add_subdirectory(libs/gtest)
set(GTEST_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/libs/gtest/include" )
enable_testing()
set(GTEST_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/tools/gtest/include/")
set(GTEST_LIBRARIES "gtest")
#
# Boost
#
set(Boost_USE_STATIC_LIBS OFF)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME OFF)
FIND_PACKAGE(Boost 1.66 COMPONENTS program_options date_time thread system locale context REQUIRED)
#
# Numa
#
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules/;${CMAKE_MODULE_PATH}")
FIND_PACKAGE(NUMA REQUIRED)
#
# Set output folders
#
set(SMILE_LIB_OUTPUT_DIR "${CMAKE_BINARY_DIR}/lib")
set(SMILE_BIN_OUTPUT_DIR "${CMAKE_BINARY_DIR}/bin")
set(SMILE_TEST_OUTPUT_DIR "${SMILE_BIN_OUTPUT_DIR}/test")
set(SMILE_REGTEST_OUTPUT_DIR "${SMILE_BIN_OUTPUT_DIR}/regtest")
#
# Summary messages
#
message(STATUS "SMILE v" ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_RELEASE})
message(STATUS "PLATFORM ${SO} ${ARCHTYPE}bits")
message(STATUS "BUILD_TYPE ${CMAKE_BUILD_TYPE}")
message(STATUS "DEFAULT DEFINES: " ${DEFAULT_DEFINES})
message(STATUS "CMAKE_SYSTEM_NAME: " ${CMAKE_SYSTEM_NAME})
message(STATUS "CMAKE_SYSTEM_PROCESSOR: " ${CMAKE_SYSTEM_PROCESSOR})
add_subdirectory(src)