-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
52 lines (41 loc) · 1.74 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
cmake_minimum_required(VERSION 2.8)
if(NOT CMAKE_BUILD_TYPE)
#set(CMAKE_BUILD_TYPE "Debug")
set(CMAKE_BUILD_TYPE "Release")
#set(CMAKE_BUILD_TYPE "RelWithDebInfo")
#set(CMAKE_BUILD_TYPE "MinSizeRel")
endif()
#-----------------------------------------------------------------
# Define flags for a Debug Profiler and a Release Profiler builds.
# -----------------------------------------------------------------
set(CMAKE_C_FLAGS_DPROFILER "${CMAKE_C_FLAGS_DEBUG} -pg")
set(CMAKE_CXX_FLAGS_DPROFILER "${CMAKE_CXX_FLAGS_DEBUG} -pg")
set(CMAKE_EXE_LINKER_FLAGS_DPROFILER "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -pg")
set(CMAKE_SHARED_LINKER_FLAGS_DPROFILER "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} -pg")
set(CMAKE_C_FLAGS_RPROFILER "${CMAKE_C_FLAGS_RELEASE} -pg")
set(CMAKE_CXX_FLAGS_RPROFILER "${CMAKE_CXX_FLAGS_RELEASE} -pg")
set(CMAKE_EXE_LINKER_FLAGS_RPROFILER "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -pg")
set(CMAKE_SHARED_LINKER_FLAGS_RPROFILER "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} -pg")
project(hsfc)
#set(CMAKE_CXX_FLAGS "-std=c++11")
add_subdirectory(libhsfc) # Build the base libhsfc
add_subdirectory(cpphsfc) # Build the cleaner C++ wrapper
# Test for python
set(PYTHON_VERSION 2.7)
find_package(PythonLibs ${PYTHON_VERSION})
if (NOT PYTHONLIBS_FOUND)
message(WARNING "Unable to find Python ${PYTHON_VERSION}")
set(DISABLE_PYHSFC 1)
endif()
# If no python or DISABLE_PYHSFC is set then don't build pyhsfc
if (DISABLE_PYHSFC)
message(STATUS "Not building PyHSFC")
else()
add_subdirectory(pyhsfc) # Build the Python wrapper
endif()
# Only set the CMAKE_INSTALL_PREFIX if the user hasn't
# specified a location
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX ${CMAKE_SOURCE_DIR})
endif()
enable_testing()