-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
55 lines (42 loc) · 1.75 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
# Main CMake file for NativeSolid project
PROJECT(NativeSolid)
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/../bin CACHE PATH
"Single output directory for building all libraries.")
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/../bin CACHE PATH
"Single output directory for building all executables.")
set(CMAKE_MACOSX_RPATH ON)
set(CMAKE_SKIP_BUILD_RPATH FALSE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
MARK_AS_ADVANCED(LIBRARY_OUTPUT_PATH EXECUTABLE_OUTPUT_PATH)
if( NOT CMAKE_BUILD_TYPE )
set( CMAKE_BUILD_TYPE Release CACHE STRING
"Choose the type of build, options are: None Debug Release RelWithDebInfo
MinSizeRel."
FORCE )
endif()
LIST(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/CMake")
# -- C++11 --
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()
# -- CBLAS/LAPACKE --
FIND_PACKAGE(LAPACKE REQUIRED)
FIND_PACKAGE(CBLAS REQUIRED)
# -- Python --
FIND_PACKAGE(PythonLibs REQUIRED)
MESSAGE(STATUS "PYTHON_INCLUDE_PATH=${PYTHON_INCLUDE_PATH}")
# -- SWIG --
FIND_PACKAGE(SWIG REQUIRED)
SET(CMAKE_SWIG_OUTDIR "${EXECUTABLE_OUTPUT_PATH}")
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/include ${PROJECT_SOURCE_DIR}/api ${LAPACKE_INCLUDE_DIR} ${CBLAS_INCLUDE_DIR} ${PYTHON_INCLUDE_PATH})
# -- Sub directories --
ADD_SUBDIRECTORY( src )
ADD_SUBDIRECTORY( _api )