-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
80 lines (61 loc) · 1.73 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
cmake_minimum_required(VERSION 3.10)
project(vsgQt6
VERSION 0.0.1
DESCRIPTION "Qt6 integration with VulkanSceneGraph"
LANGUAGES CXX
)
set(VSGQT6_SOVERSION 3)
set(VSGQT6_RELEASE_CANDIDATE 0)
set(VSGQT6_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}" CACHE INTERNAL "Root source directory of vsgQt6")
set(VSGQT6_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}" CACHE INTERNAL "Root binary directory of vsgQt6")
# set the use of C++17 globally as all examples require it
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(QT_PACKAGE_NAME Qt6 CACHE STRING "Set Qt package name, i.e. Qt5 or Qt6.")
# Cmake includes
include(cmake/CPM.cmake)
add_subdirectory(ext)
find_package(vsg 1.1.2)
vsg_setup_dir_vars()
vsg_setup_build_vars()
find_package(vsgXchange) # only used by examples
# if Qt5 then we need 5.10 or later
find_package(${QT_PACKAGE_NAME} COMPONENTS Widgets REQUIRED)
vsg_add_target_clang_format(
FILES
include/*/*.h
src/*/*.cpp
)
vsg_add_target_clobber()
vsg_add_target_cppcheck(
FILES
include/*/*.h
src/*/*.cpp
)
vsg_add_target_docs(
FILES
src
include/*/*.h
src/*/*.cpp
)
vsg_add_target_uninstall()
# only provide custom targets if not building as a submodule/FetchContent
if (${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_SOURCE_DIR})
vsg_add_option_maintainer(
PREFIX v
RCLEVEL ${VSGQT6_RELEASE_CANDIDATE}
)
endif()
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
if(WIN32)
add_definitions(-DNOMINMAX)
set(MODE WIN32)
endif()
add_subdirectory(src/vsgQt6)
option(VSGQT6_BUILD_EXAMPLES "Build Examples. Defaults to ON." ON)
if(VSGQT6_BUILD_EXAMPLES)
add_subdirectory(examples)
endif()
vsg_add_feature_summary()