diff options
Diffstat (limited to 'sources/shiboken6/shibokenmodule/CMakeLists.txt')
-rw-r--r-- | sources/shiboken6/shibokenmodule/CMakeLists.txt | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/sources/shiboken6/shibokenmodule/CMakeLists.txt b/sources/shiboken6/shibokenmodule/CMakeLists.txt index cd0dc176d..702750450 100644 --- a/sources/shiboken6/shibokenmodule/CMakeLists.txt +++ b/sources/shiboken6/shibokenmodule/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2023 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + project(shibokenmodule) configure_file("${CMAKE_CURRENT_SOURCE_DIR}/shibokenmodule.txt.in" @@ -7,25 +10,30 @@ set(sample_SRC ${CMAKE_CURRENT_BINARY_DIR}/Shiboken/shiboken_module_wrapper.cpp) set(shibokenmodule_TYPESYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_shiboken.xml) +shiboken_get_tool_shell_wrapper(shiboken tool_wrapper) + add_custom_command( -OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/mjb_rejected_classes.log" -BYPRODUCTS ${sample_SRC} -# Note: shiboken6 is an executable target. By not specifying its explicit -# path, CMAKE figures it out, itself! -# This fixes an issue with Visual Studio, see https://github.com/PySide/shiboken6/pull/11 -COMMAND Shiboken6::shiboken6 - --project-file=${CMAKE_CURRENT_BINARY_DIR}/shibokenmodule.txt ${GENERATOR_EXTRA_FLAGS} -DEPENDS ${shibokenmodule_TYPESYSTEM} -WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} -COMMENT "Running generator for 'Shiboken'..." + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/mjb_rejected_classes.log" + BYPRODUCTS ${sample_SRC} + COMMAND + ${tool_wrapper} + $<TARGET_FILE:Shiboken6::shiboken6> + --project-file=${CMAKE_CURRENT_BINARY_DIR}/shibokenmodule.txt + ${GENERATOR_EXTRA_FLAGS} + DEPENDS ${shibokenmodule_TYPESYSTEM} + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + COMMENT "Running generator for 'Shiboken'..." ) add_library(shibokenmodule MODULE ${sample_SRC}) target_include_directories(shibokenmodule PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}) -set_property(TARGET shibokenmodule PROPERTY PREFIX "") -# PYSIDE-1497: This `..` is the crucial trick to unify the path location of `Shiboken`. -set_property(TARGET shibokenmodule PROPERTY OUTPUT_NAME "../Shiboken${PYTHON_EXTENSION_SUFFIX}") + +set_target_properties(shibokenmodule PROPERTIES + PREFIX "" + OUTPUT_NAME "Shiboken${PYTHON_EXTENSION_SUFFIX}" + LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/.." + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/..") if(WIN32) set_property(TARGET shibokenmodule PROPERTY SUFFIX ".pyd") |