Fix CMakeLists.txt syntax error and update build script to use Visual Studio 2022

This commit is contained in:
2025-08-28 09:27:23 +02:00
parent 90d9a23dd2
commit 41b17022c7
2 changed files with 5 additions and 3 deletions

View File

@ -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))
install(FILES ${HEADERS} DESTINATION include/privatebinapi)

View File

@ -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