From c8824470c98eb91f8efea6e541e8ed9ddee7181e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 31 Dec 2024 13:39:58 +0100 Subject: [PATCH] python: provide a MagnumBindings::Python library for CMake superprojects. The FindMagnumBindings so far worked for bindings as a subprojects due to some weird magic, but as of 2bcc7b94d39c9a4545e89d4f1c2f3455599b14a7 it no longer does, which is how it should be as no such target was created by the subproject buildsystem at all until now. --- src/python/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/python/CMakeLists.txt b/src/python/CMakeLists.txt index ccfbab9..775985f 100644 --- a/src/python/CMakeLists.txt +++ b/src/python/CMakeLists.txt @@ -86,3 +86,10 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/setup.py.cmake ${CMAKE_CURRENT_BINARY_DIR}/setup.py.in) file(GENERATE OUTPUT ${output_dir}/setup.py INPUT ${CMAKE_CURRENT_BINARY_DIR}/setup.py.in) + +# MagnumPythonBindings library and alias, just for superprojects to have +# something to link to get to the headers +add_library(MagnumPythonBindings INTERFACE) +set_target_properties(MagnumPythonBindings PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES ${PROJECT_SOURCE_DIR}/src) +add_library(MagnumBindings::Python ALIAS MagnumPythonBindings)