-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
executable file
·84 lines (69 loc) · 2.19 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
cmake_minimum_required(VERSION 2.8.12)
project(Latency_test)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
###
# Configuration Options
###
###
# CMake Modules
###
include(EnableExtraCompilerWarnings)
include(SetDefaultBuildType)
set_default_build_type(RelWithDebInfo)
include(MSVCMultipleProcessCompile)
include(CopyImportedTarget)
include(InstallRequiredSystemLibraries)
if(WIN32)
# Flat install for docs on Windows.
set(CMAKE_INSTALL_DOCDIR .)
endif()
include(GNUInstallDirs)
if(NOT CMAKE_INSTALL_DOCDIR)
set(CMAKE_INSTALL_DOCDIR ${CMAKE_INSTALL_DATAROOTDIR}/doc/${PROJECT_NAME})
endif()
###
# Dependencies
###
# Find includes in corresponding build directories
set(CMAKE_INCLUDE_CURRENT_DIR ON)
# Instruct CMake to run moc automatically when needed.
list(APPEND CMAKE_PREFIX_PATH "C:\\Qt\\5.4\\msvc2013_64_opengl\\")
set(CMAKE_AUTOMOC ON)
find_package(Qt5Widgets REQUIRED)
find_package(Qt5OpenGL REQUIRED)
find_package(OpenGL REQUIRED)
find_package(VRPN REQUIRED)
INCLUDE_DIRECTORIES(${QUATLIB_INCLUDE_DIR} ${VRPN_INCLUDE_DIR})
if(MSVC)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
endif()
set(SOURCES
main.cpp
mainwindow.cpp
mainwindow.h
opengl_widget.cpp
opengl_widget.h)
qt5_wrap_ui(UI_HEADERS mainwindow.ui)
add_executable(Latency_test ${SOURCES} ${UI_HEADERS})
target_link_libraries(Latency_test
Qt5::Widgets
Qt5::OpenGL
${OPENGL_LIBRARIES}
${VRPN_LIBRARIES} ${QUATLIB_LIBRARIES})
install(TARGETS Latency_test
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
set(deps Qt5::Core Qt5::Gui Qt5::Widgets Qt5::OpenGL)
foreach(dep ${deps})
copy_imported_targets(Latency_test ${dep})
install_imported_target(${dep} DESTINATION ${CMAKE_INSTALL_BINDIR})
endforeach()
if(WIN32)
install_imported_target(Qt5::QWindowsIntegrationPlugin DESTINATION ${CMAKE_INSTALL_BINDIR}/platforms)
list(APPEND deps Qt5::QWindowsIntegrationPlugin)
endif()
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/GetSearchDirs.cmake)
get_search_dirs(libSearchDirs ${deps})
set(APPS
"\${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}/Latency_test${CMAKE_EXECUTABLE_SUFFIX}")
install(CODE "include(BundleUtilities)
fixup_bundle(\"${APPS}\" \"\" \"${libSearchDirs}\")")