2
0
mirror of https://github.com/boostorg/winapi.git synced 2026-01-19 04:52:07 +00:00

Added BOOST_USE_WINAPI_VERSION CMake option.

This allows users to specify BOOST_USE_WINAPI_VERSION in the CMake command
line to select the Windows version for Boost to target.

Requested in https://github.com/boostorg/cmake/issues/63.
This commit is contained in:
Andrey Semashev
2024-05-28 20:07:40 +03:00
parent 39396bd782
commit c5fb9c86e8

View File

@@ -7,11 +7,18 @@ cmake_minimum_required(VERSION 3.5...3.20)
project(boost_winapi VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX)
set(BOOST_USE_WINAPI_VERSION "" CACHE STRING "Target Windows API version for Boost")
add_library(boost_winapi INTERFACE)
add_library(Boost::winapi ALIAS boost_winapi)
target_include_directories(boost_winapi INTERFACE include)
if ((WIN32 OR CYGWIN) AND BOOST_USE_WINAPI_VERSION)
message(STATUS "Setting BOOST_USE_WINAPI_VERSION to ${BOOST_USE_WINAPI_VERSION}")
target_compile_definitions(boost_winapi INTERFACE BOOST_USE_WINAPI_VERSION=${BOOST_USE_WINAPI_VERSION})
endif()
target_link_libraries(boost_winapi
INTERFACE
Boost::config