-
Notifications
You must be signed in to change notification settings - Fork 13
/
CMakeLists.txt
82 lines (74 loc) · 2.3 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
cmake_minimum_required(VERSION 3.7)
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.13)
project(libxdf
VERSION 0.99.8
DESCRIPTION "C++ library for loading multimodal, multi-rate signals stored in XDF files."
HOMEPAGE_URL https://xdf-modules.github.io/libxdf/)
option(XDF_NO_SYSTEM_PUGIXML "Force use of bundled pugixml" OFF)
set(SOURCES
xdf.h
xdf.cpp
smarc/filtering.h
smarc/filtering.c
smarc/multi_stage.h
smarc/multi_stage.c
smarc/polyfilt.h
smarc/polyfilt.c
smarc/remez_lp.h
smarc/remez_lp.c
smarc/smarc.h
smarc/smarc.c
smarc/stage_impl.h
smarc/stage_impl.c
)
add_library(xdf ${SOURCES})
find_package(pugixml 1.9 QUIET)
if(TARGET pugixml AND NOT XDF_NO_SYSTEM_PUGIXML)
message(STATUS "Using system pugixml")
target_link_libraries(xdf PRIVATE pugixml)
else()
message(STATUS "Using bundled pugixml")
target_sources(xdf PRIVATE pugixml/pugixml.cpp)
target_include_directories(xdf PRIVATE pugixml)
endif()
target_compile_features(xdf PUBLIC cxx_std_20)
set_target_properties(xdf PROPERTIES OUTPUT_NAME xdf PUBLIC_HEADER xdf.h)
target_include_directories(xdf PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}>
$<INSTALL_INTERFACE:include>
)
include(CMakePackageConfigHelpers)
include(GNUInstallDirs)
configure_package_config_file(
${CMAKE_CURRENT_LIST_DIR}/libxdfConfig.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/libxdfConfig.cmake
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
)
install(TARGETS xdf
EXPORT "${PROJECT_NAME}Targets"
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
install(EXPORT "${PROJECT_NAME}Targets"
COMPONENT ${PROJECT_NAME}
NAMESPACE "XDF::"
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libxdfConfig.cmake
COMPONENT ${PROJECT_NAME}
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
)
# set(CPACK_STRIP_FILES ON)
# set(CPACK_ARCHIVE_COMPONENT_INSTALL ON)
set(CPACK_PACKAGE_CONTACT "[email protected]")
if(APPLE)
set(CPACK_GENERATOR TBZ2)
elseif(WIN32)
set(CPACK_GENERATOR ZIP)
elseif(UNIX)
set(CPACK_GENERATOR DEB)
set(CPACK_DEBIAN_LIBLSL_PACKAGE_SHLIBDEPS ON)
set(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS ON)
endif()
include(CPack)