-
Notifications
You must be signed in to change notification settings - Fork 101
/
Copy pathCMakeLists.txt
45 lines (37 loc) · 1.49 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
cmake_minimum_required(VERSION 2.6)
project(CMPTrie)
SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
set(EXECUTABLE_OUTPUT_PATH "${CMAKE_BINARY_DIR}/bin")
option (BUILD_WITH_DEBUG_INFO "Build with debugging information" ON)
option(BUILD_SHARED_LIBS "Build shared libraries (.dll/.so) instead of static ones (.lib/.a)" OFF )
option(BUILD_PARALLEL "With OpenMP" On )
set(python_version "2" CACHE STRING "Specify which Python version to use")
set(MODULES_DIR "${PROJECT_SOURCE_DIR}")
if (MSVC)
add_definitions( -DNOMINMAX )
add_definitions( -D_VARIADIC_MAX=10 )
endif()
set(CMAKE_CXX_FLAGS "-std=c++11 -fPIC")
#-------------------Extra libraries -----------------------------------
#extra flags for OpenMP for flann
if(NOT WIN32)
if(BUILD_PARALLEL)
find_package(OpenMP)
if(OPENMP_FOUND)
if(NOT WIN32)
set(EXTRA_PERF_LIBS gomp)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
add_definitions( -DPARALLEL )
endif(NOT WIN32)
endif(OPENMP_FOUND)
else(BUILD_PARALLEL)
message( STATUS "ANDROID BUILD")
endif(BUILD_PARALLEL)
endif(NOT WIN32)
#-------------------Extra libraries -----------------------------------
CMAKE_POLICY(SET CMP0012 NEW)
# ----------------------------------------------------------------------------
# Output directories
# ----------------------------------------------------------------------------
add_subdirectory(src)