From c766fda8c5f0c72ca58ab745b7323347f8d63867 Mon Sep 17 00:00:00 2001 From: ladevieq Date: Sat, 13 Feb 2021 22:59:25 +0100 Subject: Support VCPKG to manage deps --- .gitignore | 2 ++ .gitmodules | 3 +++ CMakeLists.txt | 2 ++ src/CMakeLists.txt | 7 ++++++- 4 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 .gitmodules diff --git a/.gitignore b/.gitignore index 796b96d..02fc619 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ /build +/out +/vcpkg diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..fe07c99 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "vcpkg"] + path = vcpkg + url = https://github.com/microsoft/vcpkg diff --git a/CMakeLists.txt b/CMakeLists.txt index 898e2db..9a90f9c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,6 +4,8 @@ set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) +set(CMAKE_TOOLCHAIN_FILE=${CMAKE_CURRENT_SOURCE_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake CACHE STRING "Vcpkg toolchain file") +set(VCPKG_TARGET_TRIPLET "x64-windows") project(path-tracer VERSION 1.0 LANGUAGES CXX) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2b75d3e..04a57a3 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,5 +1,8 @@ add_definitions(-DNOMINMAX -D_USE_MATH_DEFINES) +# VCPKG includes +include_directories(./vcpkg/installed/$ENV{VCPKG_TARGET_TRIPLET}/include) + include_directories(${CMAKE_SOURCE_DIR}/include) include_directories(${Vulkan_INCLUDE_DIRS}) @@ -22,9 +25,11 @@ add_executable( window.cpp ) +# VCPKG libs +link_directories(./vcpkg/installed/$ENV{VCPKG_TARGET_TRIPLET}/lib) + if(UNIX) target_link_libraries(path-tracer ${CMAKE_DL_LIBS} ${X11_xcb_LIB}) target_link_libraries(path-tracer ${CMAKE_DL_LIBS} ${X11_xkbcommon_LIB}) target_link_libraries(path-tracer ${CMAKE_DL_LIBS} ${X11_xkbcommon_X11_LIB}) - endif() -- cgit v1.3