diff options
Diffstat (limited to 'ports/boost-python')
| -rw-r--r-- | ports/boost-python/b2-options.cmake | 42 | ||||
| -rw-r--r-- | ports/boost-python/vcpkg.json | 11 |
2 files changed, 36 insertions, 17 deletions
diff --git a/ports/boost-python/b2-options.cmake b/ports/boost-python/b2-options.cmake index 3713424ed..f9f2e0f6a 100644 --- a/ports/boost-python/b2-options.cmake +++ b/ports/boost-python/b2-options.cmake @@ -1,28 +1,38 @@ -set(BUILD_PYTHON_VERSIONS)
+set(build_python_versions)
if("python2" IN_LIST FEATURES)
# Find Python2 libraries. Can't use find_package here, but we already know where everything is
- file(GLOB VCPKG_PYTHON2_INCLUDE "${CURRENT_INSTALLED_DIR}/include/python2.*")
- set(VCPKG_PYTHON2_LIBS_RELEASE "${CURRENT_INSTALLED_DIR}/lib")
- set(VCPKG_PYTHON2_LIBS_DEBUG "${CURRENT_INSTALLED_DIR}/debug/lib")
- string(REGEX REPLACE ".*python([0-9\.]+).*" "\\1" VCPKG_PYTHON2_VERSION "${VCPKG_PYTHON2_INCLUDE}")
- list(APPEND BUILD_PYTHON_VERSIONS "${VCPKG_PYTHON2_VERSION}")
+ file(GLOB python2_include_dir "${CURRENT_INSTALLED_DIR}/include/python2.*")
+ string(REGEX REPLACE ".*python([0-9\.]+).*" "\\1" python2_version "${python2_include_dir}")
+
+ string(APPEND USER_CONFIG_EXTRA_LINES
+ "using python : ${python2_version} : : \"${python2_include_dir}\" : \"${CURRENT_INSTALLED_DIR}/lib\" ;\n"
+ "using python : ${python2_version} : : \"${python2_include_dir}\" : \"${CURRENT_INSTALLED_DIR}/debug/lib\" : <python-debugging>on ;\n")
+ list(APPEND build_python_versions "${python2_version}")
endif()
-# Find Python3 libraries. Can't use find_package here, but we already know where everything is
-file(GLOB VCPKG_PYTHON3_INCLUDE "${CURRENT_INSTALLED_DIR}/include/python3.*")
-set(VCPKG_PYTHON3_LIBS_RELEASE "${CURRENT_INSTALLED_DIR}/lib")
-set(VCPKG_PYTHON3_LIBS_DEBUG "${CURRENT_INSTALLED_DIR}/debug/lib")
-string(REGEX REPLACE ".*python([0-9\.]+).*" "\\1" VCPKG_PYTHON3_VERSION "${VCPKG_PYTHON3_INCLUDE}")
-list(APPEND BUILD_PYTHON_VERSIONS "${VCPKG_PYTHON3_VERSION}")
+if("python3" IN_LIST FEATURES)
+ # Find Python3 libraries. Can't use find_package here, but we already know where everything is
+ file(GLOB python3_include_dir "${CURRENT_INSTALLED_DIR}/include/python3.*")
+ string(REGEX REPLACE ".*python([0-9\.]+).*" "\\1" python3_version "${python3_include_dir}")
-string(REPLACE ";" "," BUILD_PYTHON_VERSIONS "${BUILD_PYTHON_VERSIONS}")
+ string(APPEND USER_CONFIG_EXTRA_LINES
+ "using python : ${python3_version} : : \"${python3_include_dir}\" : \"${CURRENT_INSTALLED_DIR}/lib\" ;\n"
+ "using python : ${python3_version} : : \"${python3_include_dir}\" : \"${CURRENT_INSTALLED_DIR}/debug/lib\" : <python-debugging>on ;\n")
+ list(APPEND build_python_versions "${python3_version}")
+endif()
+if(NOT build_python_versions)
+ message(FATAL_ERROR "Boost.Python requires at least one Python specified as a feature.")
+endif()
+
+string(REPLACE ";" "," build_python_versions "${build_python_versions}")
list(APPEND B2_OPTIONS
- python=${BUILD_PYTHON_VERSIONS}
+ python=${build_python_versions}
)
-if(VCPKG_CXX_FLAGS_DEBUG MATCHES "BOOST_DEBUG_PYTHON")
- list(APPEND B2_OPTIONS_DBG
+
+if(CMAKE_CXX_FLAGS_DEBUG MATCHES "BOOST_DEBUG_PYTHON" AND CMAKE_BUILD_TYPE STREQUAL "Debug")
+ list(APPEND B2_OPTIONS
python-debugging=on
)
endif()
diff --git a/ports/boost-python/vcpkg.json b/ports/boost-python/vcpkg.json index 0ba6de705..51d50389b 100644 --- a/ports/boost-python/vcpkg.json +++ b/ports/boost-python/vcpkg.json @@ -1,6 +1,7 @@ { "name": "boost-python", "version": "1.77.0", + "port-version": 1, "description": "Boost python module", "homepage": "https://github.com/boostorg/python", "supports": "!uwp & !(arm & windows) & !emscripten", @@ -35,18 +36,26 @@ "boost-type-traits", "boost-utility", "boost-vcpkg-helpers", - "python3", { "name": "vcpkg-cmake", "host": true } ], + "default-features": [ + "python3" + ], "features": { "python2": { "description": "Build with Python2 support", "dependencies": [ "python2" ] + }, + "python3": { + "description": "Build with Python3 support", + "dependencies": [ + "python3" + ] } } } |
