-
Notifications
You must be signed in to change notification settings - Fork 13
/
CMakeLists.txt
109 lines (84 loc) · 2.63 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
cmake_minimum_required(VERSION 3.13)
project(std_otau_plugin VERSION 2.22.2 LANGUAGES C;CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(Qt5 COMPONENTS Core Widgets REQUIRED)
#--- deCONZ library ---------------------------------------------------
include(FetchContent)
if (NOT DECONZ_FULL_BUILD)
FetchContent_Declare(
deconzlib
GIT_REPOSITORY https://github.com/dresden-elektronik/deconz-lib.git
GIT_TAG main
)
# FetchContent_MakeAvailable(deconzlib)
# FetchContent_MakeAvailable requires CMake 3.14, but Debian Buster has only 3.13
FetchContent_GetProperties(deconzlib)
if (NOT deconzlib_POPULATED)
FetchContent_Populate(deconzlib)
add_subdirectory(${deconzlib_SOURCE_DIR} ${deconzlib_BINARY_DIR})
endif()
# --- actor model -----------------------------------------------------
FetchContent_Declare(
actormodel
GIT_REPOSITORY https://git.sr.ht/~cryo/actor_model
GIT_TAG master
)
# FetchContent_MakeAvailable(actormodel)
# FetchContent_MakeAvailable requires CMake 3.14, but Debian Buster has only 3.13
FetchContent_GetProperties(actormodel)
if (NOT actormodel_POPULATED)
FetchContent_Populate(actormodel)
add_subdirectory(${actormodel_SOURCE_DIR} ${actormodel_BINARY_DIR})
endif()
endif() # NOT DECONZ_FULL_BUILD
#----------------------------------------------------------------------
set(PLUGIN_INCLUDE_FILES
std_otau_plugin.h
std_otau_widget.h
otau_file.h
otau_file_loader.h
otau_model.h
otau_node.h
)
add_library(${PROJECT_NAME} SHARED
${PLUGIN_INCLUDE_FILES}
std_otau_widget.ui
std_otau_plugin.cpp
std_otau_widget.cpp
otau_file.cpp
otau_file_loader.cpp
otau_model.cpp
otau_node.cpp
)
target_compile_definitions(${PROJECT_NAME} PRIVATE USE_ACTOR_MODEL)
target_link_libraries(${PROJECT_NAME}
PRIVATE Qt5::Core
PRIVATE Qt5::Gui
PRIVATE Qt5::Widgets
PRIVATE deCONZLib
am_plugin_hdr
)
#--------------------------------------------------------------
include(GNUInstallDirs)
if (UNIX)
if (APPLE)
set_target_properties(${PROJECT_NAME} PROPERTIES
INSTALL_RPATH @loader_path)
else()
set_target_properties(${PROJECT_NAME} PROPERTIES
INSTALL_RPATH "${CMAKE_INSTALL_FULL_LIBDIR}")
endif()
endif()
if (${CMAKE_HOST_SYSTEM_NAME} MATCHES "Linux")
install(TARGETS ${PROJECT_NAME}
LIBRARY DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/deCONZ/plugins"
)
# following applies only when build as part of deCONZ package
# if (DECONZ_FULL_BUILD)
# endif()
endif()