-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
134 lines (105 loc) · 4.47 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
cmake_minimum_required(VERSION 3.0)
project(CloudViewer)
set( CXX11_FLAG "-std=c++11")
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX11_FLAG} ${FPIC_FLAG}")
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${FPIC_FLAG}")
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
# find qt5 components
# find_package(Qt5 COMPONENTS OpenGL Widgets Core Gui PrintSupport Concurrent REQUIRED)
find_package(Qt5Widgets REQUIRED)
find_package(Qt5Core REQUIRED)
find_package(Qt5Gui REQUIRED)
find_package(Qt5PrintSupport REQUIRED)
find_package(Qt5Concurrent REQUIRED)
find_package(Qt5OpenGL REQUIRED)
find_package(Qt5OpenGLExtensions REQUIRED)
find_package(Qt5Svg REQUIRED)
find_package(PCL 1.9 REQUIRED)
include_directories(${PCL_INCLUDE_DIRS} include)
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})
include_directories(${Qt5OpenGL_INCLUDE_DIRS}
${Qt5Widgets_INCLUDE_DIRS}
${Qt5Core_INCLUDE_DIRS}
${Qt5Gui_INCLUDE_DIRS}
${Qt5Concurrent_INCLUDE_DIRS}
${Qt5PrintSupport_INCLUDE_DIRS}
)
# turn on QStringBuilder for more efficient string construction
# see https://doc.qt.io/qt-5/qstring.html#more-efficient-string-construction
add_definitions( -DQT_USE_QSTRINGBUILDER )
find_package(Qt5 COMPONENTS Core Gui Widgets OpenGL OpenGLExtensions REQUIRED)
# Libs requested by both qCC & ccViewer
add_subdirectory( ./CC )
add_subdirectory( ./common )
add_subdirectory( ./pclutils )
add_subdirectory( ./CCFbo )
add_subdirectory( ./qCC_db ) # must always be included after CCFbo (dependency)
add_subdirectory( ./qCC_io ) # must always be included after qCC_db (dependency)
add_subdirectory( ./qCC_glWindow ) # must always be included after qCC_db (dependency)
#add_subdirectory( ./plugins )
include_directories( ${CC_FBO_LIB_SOURCE_DIR}/include )
include_directories( ${CC_CORE_LIB_SOURCE_DIR}/include )
include_directories( ${QCC_DB_LIB_SOURCE_DIR} )
message(${QCC_DB_LIB_SOURCE_DIR})
if( MSVC )
include_directories( ${QCC_DB_LIB_SOURCE_DIR}/msvc )
endif()
include_directories( ${QCC_IO_LIB_SOURCE_DIR} )
include_directories( ${QCC_GL_LIB_SOURCE_DIR} )
include_directories( ${CC_CORE_LIB_SOURCE_DIR}/inlcude )
include_directories( ${CC_CORE_LIB_SOURCE_DIR}/src )
include_directories( ${COMMON_SOURCE_DIR} )
include_directories( ${CMAKE_CURRENT_SOURCE_DIR} )
include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/common)
include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/pclutils)
include_directories( ${CMAKE_CURRENT_BINARY_DIR} )
#include_directories( ${CloudComparePlugins_SOURCE_DIR} )
#MESSAGE(${CloudComparePlugins_SOURCE_DIR})
file( GLOB header_list_common common/*.h )
file( GLOB source_list_common common/*.cpp )
file( GLOB header_list_pclutils pclutils/*.h )
file( GLOB source_list_pclutils pclutils/*.cpp )
file( GLOB header_list ccViewer/*.h )
file( GLOB source_list ccViewer/*.cpp )
file( GLOB ui_list ccViewer/ui_templates/*.ui )
file( GLOB ui_list_common common/ui_templates/*.ui )
#add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/common)
# 3DX support (3dConnexion devices)
if ( ${OPTION_SUPPORT_3DCONNEXION_DEVICES} )
add_subdirectory( ../qCC/devices/3dConnexion devices/3dConnexion )
endif()
# Gamepad support (requires Qt 5.7+)
if ( ${OPTION_SUPPORT_GAMEPADS} )
add_subdirectory( ../qCC/devices/gamepad devices/gamepad )
endif()
qt5_wrap_ui( generated_ui_list ${ui_list} ${ui_list_common})
qt5_add_resources( generated_qrc_list ${qrc_list} )
if( TRUE )
# App icon with MSVC
#set( rc_list images/icon/cc_viewer_icon.rc )
#to get rid of the (system) console
add_executable( ${PROJECT_NAME} WIN32 ${header_list} ${source_list} ${generated_ui_list} ${generated_qrc_list} ${rc_list}
${header_list_common} ${source_list_common} ${ui_list_common}
${header_list_pclutils} ${source_list_pclutils} )
elseif( APPLE )
add_executable( ${PROJECT_NAME} MACOSX_BUNDLE ${header_list} ${source_list} ${generated_ui_list} ${generated_qrc_list} ${rc_list})
else()
add_executable( ${PROJECT_NAME} ${header_list} ${source_list} ${generated_ui_list} ${generated_qrc_list} ${rc_list})
endif()
target_link_libraries( ${PROJECT_NAME}
CC_FBO_LIB
CC_CORE_LIB
QCC_DB_LIB
QCC_IO_LIB
QCC_GL_LIB
${PCL_LIBRARIES}
#QCORE_IO_PLUGIN
)
# Qt
target_link_libraries(${PROJECT_NAME} Qt5::Core Qt5::Gui Qt5::Widgets Qt5::OpenGL ${PCL_LIBRARIES})
if (WIN32)
target_link_libraries( ${PROJECT_NAME} Qt5::WinMain ${PCL_LIBRARIES})
endif()