-
Notifications
You must be signed in to change notification settings - Fork 4
/
CMakeLists.txt
84 lines (71 loc) · 2.04 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
cmake_minimum_required(VERSION 3.10)
project(XDFStreamer
LANGUAGES CXX
VERSION 1.14.0
DESCRIPTION "Application that streams signals from XDF files to lab streaming layer."
HOMEPAGE_URL https://github.com/labstreaminglayer/App-XDFStreamer
)
find_package(LSL REQUIRED
HINTS ${LSL_INSTALL_ROOT}
PATH_SUFFIXES share/LSL
)
find_package(libxdf REQUIRED
HINTS ${XDF_INSTALL_ROOT}
PATH_SUFFIXES share
)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)
find_package(Qt5 REQUIRED COMPONENTS Widgets)
find_package(Threads REQUIRED)
add_executable(${PROJECT_NAME} MACOSX_BUNDLE #WIN32
XdfStreamer/main.cpp
XdfStreamer/xdfstreamer.h
XdfStreamer/xdfstreamer.cpp
XdfStreamer/xdfstreamer.ui
)
set_target_properties(${PROJECT_NAME}
PROPERTIES
CXX_STANDARD 17
CXX_STANDARD_REQUIRED YES
CXX_EXTENSIONS NO
)
target_link_libraries(${PROJECT_NAME}
PRIVATE
Qt5::Widgets
Threads::Threads
LSL::lsl
XDF::xdf
)
installLSLApp(${PROJECT_NAME})
installLSLAuxFiles(${PROJECT_NAME}
LICENSE README.md # ${PROJECT_NAME}.cfg
)
set(CPACK_PACKAGE_CONTACT "yl3842@columbia.edu")
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)
if (WIN32)
get_target_property(QT_QMAKE_EXECUTABLE Qt::qmake IMPORTED_LOCATION)
get_filename_component(QT_WINDEPLOYQT_EXECUTABLE ${QT_QMAKE_EXECUTABLE} PATH)
set(QT_WINDEPLOYQT_EXECUTABLE "${QT_WINDEPLOYQT_EXECUTABLE}/windeployqt.exe")
add_custom_command(
TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${QT_WINDEPLOYQT_EXECUTABLE}
--no-translations --no-system-d3d-compiler
--qmldir ${CMAKE_CURRENT_SOURCE_DIR}
$<TARGET_FILE_DIR:${PROJECT_NAME}>)
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
$<TARGET_FILE:LSL::lsl>
# $<TARGET_FILE:XDF::xdf> # not needed as it is statically linked.
$<TARGET_FILE_DIR:${PROJECT_NAME}>)
endif()