-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
44 lines (34 loc) · 966 Bytes
/
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
PROJECT (gp)
SET(QT_USE_QTNETWORK TRUE)
SET(CMAKE_AUTOMOC ON)
if(QT5_BUILD)
find_package(Qt5Core REQUIRED)
find_package(Qt5Network REQUIRED)
set(QT_INCLUDES ${Qt5Network_INCLUDE_DIRS})
include_directories(${QT_INCLUDES})
else()
find_package(Qt4 REQUIRED)
endif()
file (GLOB src "*.cpp")
file (GLOB headers "*.h")
file (GLOB resources "*.qrc")
if(QT5_BUILD)
QT5_WRAP_CPP(gp_HEADERS_MOC ${gp_HEADERS})
QT5_ADD_RESOURCES(gp_RESOURCES_RCC ${resources})
else()
QT4_WRAP_CPP(gp_HEADERS_MOC ${gp_HEADERS})
QT4_ADD_RESOURCES(gp_RESOURCES_RCC ${resources})
endif()
if (NOT QT5_BUILD)
INCLUDE(${QT_USE_FILE})
endif()
ADD_DEFINITIONS(${QT_DEFINITIONS})
ADD_DEFINITIONS( -DGP_LIBRARY -DQT_USE_QSTRINGBUILDER )
ADD_LIBRARY(gp SHARED ${src} ${headers})
if (QT5_BUILD)
TARGET_LINK_LIBRARIES(gp Qt5::Core Qt5::Network)
endif()
TARGET_LINK_LIBRARIES(gp ${QT_LIBRARIES})
if (NOT WIN32)
INSTALL(TARGETS gp LIBRARY DESTINATION lib)
endif()