From 41b17022c79c5190da310875e603005fd99e0bd5 Mon Sep 17 00:00:00 2001 From: elpatron Date: Thu, 28 Aug 2025 09:27:23 +0200 Subject: [PATCH] Fix CMakeLists.txt syntax error and update build script to use Visual Studio 2022 --- CMakeLists.txt | 6 ++++-- build.bat | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e661ea7..dd4c3e1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,13 +31,15 @@ else() if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/external/json/include/nlohmann/json.hpp") set(NLOHMANN_JSON_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/external/json/include") else() - # Try to download it + # Try to download it with compatibility settings include(FetchContent) FetchContent_Declare( nlohmann_json GIT_REPOSITORY https://github.com/nlohmann/json.git GIT_TAG v3.11.2 ) + # Set compatibility flag for older CMake versions + set(CMAKE_POLICY_VERSION_MINIMUM 3.5) FetchContent_MakeAvailable(nlohmann_json) set(NLOHMANN_JSON_INCLUDE_DIRS ${nlohmann_json_SOURCE_DIR}/include) endif() @@ -85,4 +87,4 @@ install(TARGETS privatebinapi ARCHIVE DESTINATION lib ) -install(FILES ${HEADERS} DESTINATION include/privatebinapi)) \ No newline at end of file +install(FILES ${HEADERS} DESTINATION include/privatebinapi) \ No newline at end of file diff --git a/build.bat b/build.bat index f31e53c..93e2078 100644 --- a/build.bat +++ b/build.bat @@ -6,7 +6,7 @@ if not exist "build" mkdir build cd build REM Generate build files with CMake -cmake .. -G "Visual Studio 16 2019" +cmake .. -G "Visual Studio 17 2022" REM Build the project cmake --build . --config Release