-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
executable file
·72 lines (49 loc) · 1.94 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
project(VenusReadJson)
cmake_minimum_required(VERSION 2.8.11)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
find_package(Qt5 COMPONENTS Core REQUIRED)
find_package(Qt5Widgets REQUIRED) # find and setup Qt5 for this project
find_package(Qt5Script REQUIRED)
find_package(Qt5Xml REQUIRED)
find_package(Qt5Network REQUIRED)
find_package(Qt5Sql REQUIRED)
find_package(Qt5Concurrent REQUIRED)
find_package(Qt5OpenGL REQUIRED)
find_package(Qt5PrintSupport REQUIRED)
find_package(Qt5WebSockets REQUIRED)
find_package(RthLibs REQUIRED)
if(NOT Log4cxx_FOUND)
find_package(Log4cxx REQUIRED)
endif()
# https://cmake.org/cmake/help/latest/module/FindMatlab.html
# CMake 3.13.4
# the variable "qtproject_SRCS" contains all .cpp files of this project
set(VenusReadJson_SRCS
VenusReadJson.cpp
VenusReadJsonPlugin.cpp
)
set(VenusReadJson_MOC_HDRS
VenusReadJson.h
VenusReadJsonPlugin.h
)
include_directories(${Qt5Core_INCLUDE_DIRS})
include_directories(${Qt5Script_INCLUDE_DIRS})
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${CMAKE_CURRENT_BINARY_DIR})
include_directories(${RTHLIBS_INCLUDE_DIR})
include_directories(${LOG4CXX_INCLUDE_DIR})
message(RTHLIBS_INCLUDE_DIR="${RTHLIBS_INCLUDE_DIR}")
add_definitions(${Qt5Core_DEFINITIONS})
add_definitions(${Qt5Script_DEFINITIONS})
QT5_WRAP_CPP(VenusReadJson_MOC_SRCS ${VenusReadJson_MOC_HDRS})
# Don't forget to include output directory, otherwise
# the UI file won't be wrapped!
ADD_DEFINITIONS(-DQT_PLUGIN)
ADD_DEFINITIONS(-DQT_SHARED)
#ADD_DEFINITIONS(-DQT_NO_DEBUG)
#ADD_DEFINITIONS(-std=c++11 -Wall -Wextra)
ADD_DEFINITIONS(-Wall -Wextra -Werror)
#SET(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}")
ADD_LIBRARY(VenusReadJsonPlugin MODULE ${VenusReadJson_SRCS} ${VenusReadJson_MOC_SRCS} ${INCS})
target_link_libraries(VenusReadJsonPlugin Qt5::Core Qt5::Widgets Qt5::Script ${RTHLIBS_LIBRARIES} ${LOG4CXX_LIBRARIES})
INSTALL(TARGETS VenusReadJsonPlugin LIBRARY DESTINATION ~/HeartVista/script)