-
Notifications
You must be signed in to change notification settings - Fork 0
/
common.cmake
29 lines (26 loc) · 1014 Bytes
/
common.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
# Access to VCPKG resources
if (NOT COMMAND fetch_variable)
macro (fetch_variable name)
if (NOT DEFINED ${name} AND DEFINED ENV{${name}})
set(${name} $ENV{${name}})
endif()
endmacro()
endif()
fetch_variable(VCPKG_DEFAULT_TRIPLET)
if (NOT DEFINED VCPKG_DEFAULT_TRIPLET)
set(VCPKG_DEFAULT_TRIPLET x64-windows)
endif()
message(STATUS "Using vcpkg triplet: ${VCPKG_DEFAULT_TRIPLET}")
if (NOT DEFINED VCPKG_TOOLCHAIN_FILE AND NOT DEFINED VCPKG_CHAINLOAD_TOOLCHAIN_FILE)
message(STATUS "No defined VCPKG toolchain file. Using local one if available.")
get_filename_component(VCPKG_TOOLCHAIN_FILE "./_vcpkg_/scripts/buildsystems/vcpkg.cmake" ABSOLUTE)
file(TO_CMAKE_PATH
${VCPKG_TOOLCHAIN_FILE}
CMAKE_TOOLCHAIN_FILE
)
endif()
message(STATUS "Using cmake toolchain files: ${CMAKE_TOOLCHAIN_FILE}")
message(STATUS "Using cmake prefix path: ${CMAKE_PREFIX_PATH}")
# Common C++ language settings
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)