-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathCMakeLists.txt
104 lines (90 loc) · 3.46 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
########################################################################
# Project setup
########################################################################
cmake_minimum_required(VERSION 2.8)
project(spuce)
enable_language(CXX)
include(FeatureSummary)
include(CMakeDependentOption)
if (NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE "RELEASE")
endif()
# Shouldn't have to do this
if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Windows")
message(STATUS "Adding -std=c++11")
add_definitions("-std=c++11")
endif()
include_directories("${CMAKE_CURRENT_SOURCE_DIR}")
set(SPUCE_MAJOR_VERSION 0)
set(SPUCE_MINOR_VERSION 4)
set(SPUCE_PATCH_VERSION 4)
SET(SPUCE_LIBVER ${SPUCE_MAJOR_VERSION}.${SPUCE_MINOR_VERSION}.${SPUCE_PATCH_VERSION})
SET(SPUCE_SOVER "${SPUCE_LIBVER}")
set(SPUCE_VERSION "${SPUCE_LIBVER}")
add_subdirectory(spuce)
FIND_PACKAGE(Qt5 COMPONENTS Gui Core Widgets)
if (NOT Qt5_FOUND)
message(STATUS "QT5 not found - will skip building QT5 Apps")
endif()
cmake_dependent_option(ENABLE_GUI "Enable QT application" ON "Qt5_FOUND" OFF)
add_feature_info(ENABLE_GUI ENABLE_GUI "This enables the QT applications to be built")
if (ENABLE_GUI)
add_subdirectory(qt_fir)
add_subdirectory(qt_iir)
add_subdirectory(qt_window)
add_subdirectory(qt_other)
endif()
FIND_PACKAGE(PythonLibs)
if (NOT PYTHONLIBS_FOUND)
message(STATUS "PythonLibs not found - will skip building test programs")
endif()
cmake_dependent_option(BUILD_TESTING "Enable python based tests" ON "PYTHONLIBS_FOUND" OFF)
add_feature_info(BUILD_TESTING BUILD_TESTING "This enables python testing with matplotlib graphs")
if (BUILD_TESTING)
add_subdirectory(test_spuce)
endif()
########################################################################
# Install cmake helper modules
########################################################################
configure_file(
${PROJECT_SOURCE_DIR}/cmake/SpuceConfigVersion.in.cmake
${PROJECT_BINARY_DIR}/SpuceConfigVersion.cmake
@ONLY)
set(cmake_files
${PROJECT_SOURCE_DIR}/cmake/SpuceConfig.cmake
${PROJECT_BINARY_DIR}/SpuceConfigVersion.cmake)
if (UNIX)
install(FILES ${cmake_files} DESTINATION share/cmake/${PROJECT_NAME})
elseif (WIN32)
install(FILES ${cmake_files} DESTINATION cmake)
endif ()
########################################################################
# install include files
########################################################################
install(
DIRECTORY spuce
DESTINATION include
COMPONENT spuce_dev
FILES_MATCHING PATTERN "*.h"
)
# uninstall target
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY)
# only add uninstall if this is the main project
if(${CMAKE_PROJECT_NAME} STREQUAL ${PROJECT_NAME})
add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
endif()
#########################################################################
# print features summary
#########################################################################
message(STATUS "######################################################")
message(STATUS "## Enabled features")
message(STATUS "######################################################")
feature_summary(WHAT ENABLED_FEATURES)
message(STATUS "######################################################")
message(STATUS "## Disabled features")
message(STATUS "######################################################")
feature_summary(WHAT DISABLED_FEATURES)