forked from CloudCompare/CloudCompare
/
CMakeExternalLibs.cmake
49 lines (42 loc) · 1.8 KB
/
CMakeExternalLibs.cmake
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
# ------------------------------------------------------------------------------
# Qt
# ------------------------------------------------------------------------------
set( DESIRED_QT_VERSION 4 )
if ( MSVC )
#We need QtMain to use 'WIN32' mode (/subsystem:windows) with MSVC
find_package( Qt4 ${QT_VERSION} COMPONENTS QtMain QtCore QtGui QtOpenGL REQUIRED )
else()
find_package( Qt4 ${QT_VERSION} COMPONENTS QtCore QtGui QtOpenGL REQUIRED )
endif()
if( NOT QT_FOUND )
message( SEND_ERROR "Qt required, but not found with 'find_package()'" )
else()
include( ${QT_USE_FILE} )
endif()
#hack: we don't want to include Qt debug libs!
#foreach (qt_lib ${QT_LIBRARIES})
# string( REPLACE d4 4 qt_lib_corrected ${qt_lib})
# list(APPEND QT_LIBRARIES_NEW ${qt_lib_corrected})
#endforeach()
#set(QT_LIBRARIES ${QT_LIBRARIES_NEW})
# ------------------------------------------------------------------------------
# OpenGL
# ------------------------------------------------------------------------------
find_package( OpenGL REQUIRED )
if( NOT OPENGL_FOUND )
message( SEND_ERROR "OpenGL required, but not found with 'find_package()'" )
endif()
# ------------------------------------------------------------------------------
# CUDA
# ------------------------------------------------------------------------------
#if( USE_CUDA )
# find_package( CUDA REQUIRED )
# if( NOT CUDA_FOUND )
# message( SEND_ERROR "CUDA required, but not found with 'find_package()'" )
# endif()
#endif()
# ------------------------------------------------------------------------------
# Global variables
# ------------------------------------------------------------------------------
list( APPEND EXTERNAL_LIBS_INCLUDE_DIR ${QT_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR} )
list( APPEND EXTERNAL_LIBS_LIBRARIES ${QT_LIBRARIES} ${OPENGL_LIBRARIES} )