From 10f26c9eccb57a131f5ae6640b60d00afffe7fa9 Mon Sep 17 00:00:00 2001 From: richinseattle Date: Sat, 30 Nov 2024 20:05:55 -0800 Subject: [PATCH] Fix build for windows FIX: When using vcpkg to install dependencies as directed, cmake was not finding the needed files to build --- CMakeLists.txt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 68209d6..f57bf76 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,14 @@ cmake_minimum_required(VERSION 3.13) project(liboai) +IF(WIN32) + set(VCPKG_CMAKE_PATH $ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake CACHE FILEPATH "Location of vcpkg.cmake") + include(${VCPKG_CMAKE_PATH}) + find_package(ZLIB REQUIRED) + find_package(nlohmann_json CONFIG REQUIRED) + find_package(CURL REQUIRED) +ENDIF() + option(BUILD_EXAMPLES "Build example applications" OFF) set_property(GLOBAL PROPERTY USE_FOLDERS ON) @@ -11,4 +19,4 @@ if(BUILD_EXAMPLES) add_subdirectory(documentation) endif() -set_property(DIRECTORY PROPERTY VS_STARTUP_PROJECT oai) \ No newline at end of file +set_property(DIRECTORY PROPERTY VS_STARTUP_PROJECT oai)