forked from marty1885/liblinne
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
35 lines (26 loc) · 1.11 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
cmake_minimum_required (VERSION 3.0)
#set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
option(DEBUG_MODE "Enable debug flags and others" OFF)
#Some overdone optimization flags.
#This cause compile fail on some ARM devices. turn this off if this cause your compile to fail
option(NATIVE_COMPILE "Compile based on CPU native instruction support" ON)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
#Some over-engineered compile flags
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
if(DEBUG_MODE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O -g")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -funroll-loops")
#GCC only flags, these does not wotk on clang(on Ubuntu), icc isn't tested...
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -flto -pipe")
endif()
endif()
if(NATIVE_COMPILE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native")
endif()
include_directories("linne/include")
add_subdirectory(linne)
add_subdirectory(Examples)