-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
107 lines (87 loc) · 4.1 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
cmake_minimum_required(VERSION 3.0.4)
project(RTest
VERSION 0.7.2)
set(BUILD_NUMBER "0" CACHE STRING "Build-Number")
set(VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}+${BUILD_NUMBER})
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
include(GNUInstallDirs)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_CXX_STANDARD 14)
find_package(Qt5Core)
find_package(Qt5Widgets)
find_package(Qt5Quick)
find_package(Qt5QuickWidgets)
find_package(Qt5Qml)
find_package(Qt5Xml)
find_package(Qt5Network)
add_subdirectory(src)
set(BUILD_SWIG TRUE CACHE BOOL "Enable building SWIG modules.")
add_subdirectory(RBase)
qt5_add_resources(RTEST_RSCS_SRCS
${CMAKE_CURRENT_SOURCE_DIR}/ressources/rtest.qrc)
add_library(rtest SHARED ${SRCS} ${RTEST_RSCS_SRCS})
add_library(rtests STATIC ${SRCS})
target_link_libraries(rtest Qt5::Widgets Qt5::Quick Qt5::QuickWidgets Qt5::Qml Qt5::Xml)
target_link_libraries(rtest rcomm)
target_link_libraries(rtest rregistry)
target_link_libraries(rtest rsupport)
target_link_libraries(rtests Qt5::Widgets Qt5::Quick Qt5::QuickWidgets Qt5::Qml Qt5::Xml)
target_link_libraries(rtests rcomm)
target_link_libraries(rtests rregistrys)
target_link_libraries(rtests rsupports)
add_executable(RTest ${EXECUTABLE_SRCS} ${FORMS_HPP} ${RTEST_RSCS_SRCS})
target_link_libraries(RTest rtests)
set_property(SOURCE ${CMAKE_CURRENT_BINARY_DIR}/qrc_rtest.cpp PROPERTY SKIP_AUTOMOC ON)
set_property(SOURCE ${CMAKE_CURRENT_BINARY_DIR}/qrc_rtest.cpp PROPERTY SKIP_AUTOGEN ON)
include(GNUInstallDirs)
install(TARGETS RTest
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/static)
install(TARGETS rtest
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/static)
# Install Python Libraries for RTest
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/RBase/swig/python/RRegistry.py
${CMAKE_CURRENT_BINARY_DIR}/RBase/swig/python/_RRegistry.so
${CMAKE_CURRENT_BINARY_DIR}/RBase/swig/python/RSupport.py
${CMAKE_CURRENT_BINARY_DIR}/RBase/swig/python/_RSupport.so
DESTINATION share/RTest/python3
)
# Install RBase shared libraries for python modules.
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/RBase/RRegistry/librregistry.so
${CMAKE_CURRENT_BINARY_DIR}/RBase/RSupport/librsupport.so
DESTINATION share/RTest/
)
# This is a workaround for installing required shared objects with RTest.
# This does not fit with other packages of the rover codebase, but should not be a problem.
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/RBase/RCore/librbp/librbp.so
${CMAKE_CURRENT_BINARY_DIR}/RBase/RCore/librcore/librcore.so
${CMAKE_CURRENT_BINARY_DIR}/RBase/RCore/librcp/librcp.so
${CMAKE_CURRENT_BINARY_DIR}/RBase/RCore/librsp/librsp.so
DESTINATION ${CMAKE_INSTALL_LIBDIR})
set(CPACK_GENERATOR "DEB")
set(CPACK_PACKAGE_DESCRIPTION_FILE ${CMAKE_CURRENT_SOURCE_DIR}/README.md)
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Fully integrated regulation kernel test-tool for VERNER RKs.")
set(CPACK_PACKAGE_NAME "RTest")
set(CPACK_PACKAGE_VENDOR "Harptech")
set(CPACK_PACKAGE_VERSION ${VERSION})
set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
set(CPACK_RESSOURCE_FILE_LICENSE ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.md)
set(CPACK_RESSOURCE_FILE_README ${CMAKE_CURRENT_SOURCE_DIR}/README.md)
set(CPACK_OUTPUT_FILE_PREFIX ${CMAKE_CURRENT_SOURCE_DIR}/packages)
set(CPACK_PACKAGE_CONTACT "Max Heisinger <mail@maximaximal.com>")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "python3, python3-numpy, qml-module-qtquick-controls, qml-module-qtquick-layouts, qml-module-qtquick2, libqt5widgets5, libqt5gui5, libqt5quick5, libqt5qml5, libqt5quickwidgets5, swig, sqlite3")
set(CPACK_DEBIAN_PACKAGE_CONFLICTS "rbase")
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64")
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_SOURCE_DIR}/postinst;${CMAKE_CURRENT_SOURCE_DIR}/prerm")
include(CPack)