-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
100 lines (66 loc) · 3.44 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
cmake_minimum_required(VERSION 3.10)
################################################################################
# Project name
#
# many targets will be created:
# myProject::warnings
# myProject:
################################################################################
project( gvu
VERSION 1.0.0.0
LANGUAGES CXX)
################################################################################
set(CMAKE_CXX_STANDARD_REQUIRED ON)
################################################################################
# Extra targets. adds coverage::coverage, warning::all, warning:error
SET(PROJECT_TARGETS_PREFIX ${PROJECT_NAME})
get_directory_property( gvu_is_sub_project PARENT_DIRECTORY)
if(gvu_is_sub_project)
option( ${PROJECT_NAME}_ENABLE_COVERAGE "Enable Coverage." FALSE)
option( ${PROJECT_NAME}_ENABLE_WARNINGS "Enable Strict Warnings" FALSE)
option( ${PROJECT_NAME}_ENABLE_TESTING "Enable Unit Tests" FALSE)
else()
option( ${PROJECT_NAME}_ENABLE_COVERAGE "Enable Coverage. " TRUE)
option( ${PROJECT_NAME}_ENABLE_WARNINGS "Enable Strict Warnings" TRUE)
option( ${PROJECT_NAME}_ENABLE_TESTING "Enable Unit Tests" TRUE)
endif()
#######################################################################################
# Custom targets so that these files show up in QtCreator for easy editing
#######################################################################################
add_custom_target(gvu_otherfiles SOURCES conanfile.txt .gitignore README.md)
#######################################################################################
################################################################################
################################################################################
add_library(gvu INTERFACE)
add_library(gvu::gvu ALIAS gvu)
target_include_directories(gvu INTERFACE "include")
target_compile_features( gvu INTERFACE cxx_std_17)
################################################################################
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test" AND IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/test")
if( ${PROJECT_NAME}_ENABLE_TESTING )
################################################################################
# If the conan file exists, include it
################################################################################
if( EXISTS ${CMAKE_CURRENT_BINARY_DIR}/conanbuildinfo.cmake )
include(${CMAKE_CURRENT_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup(NO_OUTPUT_DIRS TARGETS)
endif()
################################################################################
################################################################################
# Build the SDLVulkanWindow as a library so that we can use it for the
# examples/unit tests
################################################################################
find_package(Vulkan)
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/third_party_sym")
add_subdirectory(third_party_sym/vkw)
add_subdirectory(third_party_sym/gul)
else()
add_subdirectory(third_party/vkw)
add_subdirectory(third_party/gul)
endif()
################################################################################
enable_testing()
add_subdirectory(test)
endif()
endif()
return()