forked from CloudCompare/CloudCompare
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
92 lines (72 loc) · 2.72 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
cmake_minimum_required( VERSION 3.10 )
project( CloudCompareProjects )
# One shouldn't generate the BUILD project directly in the SOURCES folder!
if ( ${CMAKE_CURRENT_BINARY_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR} )
if ( NOT SAME_BUILD_AND_SOURCE_FOLDER_WARNING_ALREADY_ISSUED )
message(FATAL_ERROR "It is not advised to BUILD the binaries directly in the SOURCE folder!\n If you want to proceed with this option, just CONFIGURE the project once again" )
set( SAME_BUILD_AND_SOURCE_FOLDER_WARNING_ALREADY_ISSUED TRUE )
endif()
endif()
# Add our cmake module path so we don't need relative paths for these
list( APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/" )
include( CMakePolicies )
include( CMakeSetCompilerOptions )
include( DeployQt )
# CCViewer
option( OPTION_BUILD_CCVIEWER "Check to compile CCViewer project" ON )
# Quad buffer stereo support
option( OPTION_GL_QUAD_BUFFER_SUPPORT "Check to compile CloudCompare and ccViewer with Quad Buffer support" OFF )
if ( OPTION_GL_QUAD_BUFFER_SUPPORT )
# Add the define for all libs and applications
add_definitions( -DCC_GL_WINDOW_USE_QWINDOW )
endif()
# Testing
option( BUILD_TESTING "Build tests for CC" OFF )
if ( BUILD_TESTING )
include( CTest )
endif()
# Default debug suffix for libraries.
set( CMAKE_DEBUG_POSTFIX "d" )
# Define target folders
# (now that ccViewer can have its own plugins, qCC and ccViewer must fall in separate folders!
if(WIN32 OR APPLE)
set( CLOUDCOMPARE_DEST_FOLDER CloudCompare )
set( CCVIEWER_DEST_FOLDER ccViewer )
if (OPTION_GL_QUAD_BUFFER_SUPPORT)
set ( CLOUDCOMPARE_DEST_FOLDER ${CLOUDCOMPARE_DEST_FOLDER}Stereo )
set ( CCVIEWER_DEST_FOLDER ${CCVIEWER_DEST_FOLDER}Stereo )
endif()
else()
set( CLOUDCOMPARE_DEST_FOLDER bin )
set( CCVIEWER_DEST_FOLDER bin )
endif()
if( WIN32 )
set( INSTALL_DESTINATIONS ${CLOUDCOMPARE_DEST_FOLDER} )
if( ${OPTION_BUILD_CCVIEWER} )
list( APPEND INSTALL_DESTINATIONS ${CCVIEWER_DEST_FOLDER} )
endif()
elseif( UNIX AND NOT APPLE )
# RPATH Linux/Unix: (dynamic) libs are put in $prefix/$lib/cloudcompare,
# since they are only used by qCC/ccViewer
include( GNUInstallDirs )
set( LINUX_INSTALL_SHARED_DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}/cloudcompare" )
set( CMAKE_INSTALL_RPATH ${LINUX_INSTALL_SHARED_DESTINATION} )
set( INSTALL_DESTINATIONS ${CMAKE_INSTALL_PREFIX})
endif()
# Load advanced scripts
include( CMakeInclude )
include( Install )
# Add external libraries
include( CMakeExternalLibs )
# Contrib. libraries (mainly for I/O)
include( AllSupport )
# Internal libs used by both CloudCompare & ccViewer
add_subdirectory( libs )
# Plugins
add_subdirectory( plugins )
# qCC
add_subdirectory( qCC )
# CCViewer
if( OPTION_BUILD_CCVIEWER )
add_subdirectory( ccViewer )
endif()