-
Notifications
You must be signed in to change notification settings - Fork 32
/
CMakeLists.txt
39 lines (28 loc) · 1.16 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
cmake_minimum_required(VERSION 2.8.12)
PROJECT(savgol)
SET(CMAKE_BUILD_TYPE RelWithDebInfo)
SET(MY_DIR ${savgol_SOURCE_DIR})
find_package(PkgConfig)
pkg_check_modules( EIGEN3 REQUIRED eigen3 )
include_directories( ${EIGEN3_INCLUDE_DIRS} )
add_definitions(${EIGEN_DEFINITIONS})
OPTION(ENABLE_CXX11 "Enable C++11 support" ON)
IF(ENABLE_CXX11)
INCLUDE(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
IF(COMPILER_SUPPORTS_CXX11)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
ELSEIF(COMPILER_SUPPORTS_CXX0X)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
ELSE()
MESSAGE(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
ENDIF()
ENDIF(ENABLE_CXX11)
INCLUDE_DIRECTORIES(EIGEN3_INCLUDE_DIRS
AND "${MY_DIR}/include")
message(STATUS " savgol include path:\n")
message(STATUS "${MY_DIR}/include")
message(STATUS "\neigen3 include path: ${EIGEN3_INCLUDE_DIRS}\n")
#Declare the executable target built from your sources
add_executable(savgol savgol.cpp example.cpp)