forked from pothosware/PothosCore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
146 lines (122 loc) · 5.4 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
########################################################################
# Project setup
########################################################################
cmake_minimum_required(VERSION 2.8.9)
project(Pothos)
enable_language(CXX)
enable_testing()
set(Pothos_DIR ${PROJECT_SOURCE_DIR}/pothos-library/cmake)
set(POTHOS_IN_TREE_SOURCE_DIR ${PROJECT_SOURCE_DIR})
#args to set the CMAKE_PREFIX_PATH environment variable
if (CMAKE_PREFIX_PATH)
set(ENV{CMAKE_PREFIX_PATH} ${CMAKE_PREFIX_PATH})
endif (CMAKE_PREFIX_PATH)
########################################################################
# Clang required flag because only libc++ supports C++11.
# Poco must be built with this flag when using clang.
# Mixing versions of the stdlib would cause ABI errors.
########################################################################
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
#The stdlib flag setting supports c++11 library features.
set(CMAKE_CXX_FLAGS "-stdlib=libc++")
endif()
########################################################################
# POCO dependency - search for Poco or build if not found
########################################################################
include(${Pothos_DIR}/SetupPoco.cmake)
set(POCO_DIR poco154)
if (NOT Poco_FOUND)
message(STATUS "Poco not found - using built-in Poco")
if (NOT EXISTS ${PROJECT_SOURCE_DIR}/${POCO_DIR}/CMakeLists.txt)
message(FATAL_ERROR "poco submodule not configured (git submodule init && git submodule update)")
endif ()
#mark that the in-tree poco build is used
#used by uninstall target and PothosConfig
set(POCO_IN_TREE TRUE)
set(ENABLE_MONGODB OFF CACHE INTERNAL "")
set(ENABLE_PDF OFF CACHE INTERNAL "")
set(ENABLE_NETSSL OFF CACHE INTERNAL "")
set(ENABLE_CRYPTO OFF CACHE INTERNAL "")
set(ENABLE_DATA OFF CACHE INTERNAL "")
set(ENABLE_SEVENZIP OFF CACHE INTERNAL "")
set(ENABLE_ZIP OFF CACHE INTERNAL "")
set(ENABLE_APACHECONNECTOR OFF CACHE INTERNAL "")
# Include the Pothos library config into the top level.
# This brings in LIB_SUFFIX and RPATH settings for Poco.
include(${Pothos_DIR}/PothosLibraryConfig.cmake)
#set top level dirs, go into submodule, and restore
set(POTHOS_MODULE_PATH ${CMAKE_MODULE_PATH})
set(CMAKE_SOURCE_DIR ${PROJECT_SOURCE_DIR}/${POCO_DIR})
set(CMAKE_BINARY_DIR ${PROJECT_BINARY_DIR}/${POCO_DIR})
unset(CMAKE_MODULE_PATH)
add_subdirectory(${POCO_DIR})
set(CMAKE_SOURCE_DIR ${PROJECT_SOURCE_DIR})
set(CMAKE_BINARY_DIR ${PROJECT_BINARY_DIR})
set(CMAKE_MODULE_PATH ${POTHOS_MODULE_PATH})
list(APPEND Poco_INCLUDE_DIRS
${PROJECT_SOURCE_DIR}/${POCO_DIR}/Foundation/include
${PROJECT_SOURCE_DIR}/${POCO_DIR}/Util/include
${PROJECT_SOURCE_DIR}/${POCO_DIR}/XML/include
${PROJECT_SOURCE_DIR}/${POCO_DIR}/Net/include
${PROJECT_SOURCE_DIR}/${POCO_DIR}/JSON/include
)
list(APPEND Poco_LIBRARIES
PocoFoundation
PocoUtil
PocoXML
PocoNet
PocoJSON
)
endif()
########################################################################
# Build serialization library
########################################################################
add_subdirectory(pothos-serialization)
########################################################################
# Build main pothos library
########################################################################
add_subdirectory(pothos-library)
#########################################################################
## Build in-tree modules
#########################################################################
#ensure that local headers get precedent over installed headers
include_directories(pothos-library/include)
include_directories(${Poco_INCLUDE_DIRS})
add_subdirectory(pothos-gui)
add_subdirectory(pothos-widgets)
add_subdirectory(pothos-blocks)
add_subdirectory(pothos-python)
add_subdirectory(pothos-java)
add_subdirectory(pothos-util)
add_subdirectory(pothos-opencl)
add_subdirectory(pothos-sdr)
add_subdirectory(pothos-audio)
#########################################################################
# uninstall target
#########################################################################
if (POCO_IN_TREE)
# use poco's uninstall target, but overwrite the script
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/${POCO_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY)
else (POCO_IN_TREE)
add_custom_target(uninstall
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY)
endif (POCO_IN_TREE)
#########################################################################
# print features summary
#########################################################################
include(FeatureSummary)
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)