Skip to content

Commit 8327ac0

Browse files
feihongmrbean-bremen
authored andcommitted
adapting more Qt header file include paths
1 parent f48f396 commit 8327ac0

1 file changed

Lines changed: 7 additions & 10 deletions

File tree

generator/CMakeLists.txt

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,20 +58,19 @@ foreach(wrapper IN LISTS wrapper_list)
5858
set(PYTHONQT_WRAPPER_${WRAPPER}_SOURCES ${PYTHONQT_WRAPPER_${WRAPPER}_SOURCES} PARENT_SCOPE)
5959
endforeach()
6060

61-
get_target_property(_qt_include_dirs Qt${QT_VERSION_MAJOR}::Core INTERFACE_INCLUDE_DIRECTORIES)
62-
foreach(_qt_include_dir IN LISTS _qt_include_dirs)
63-
get_filename_component(_qt_install_prefix "${_qt_include_dir}" PATH)
64-
if (EXISTS "${_qt_install_prefix}/include/QtCore")
65-
set(_qt_dir "${_qt_install_prefix}")
61+
get_target_property(_qtcore_include_dirs Qt${QT_VERSION_MAJOR}::Core INTERFACE_INCLUDE_DIRECTORIES)
62+
foreach(_qtcore_include_dir IN LISTS _qtcore_include_dirs)
63+
if (EXISTS "${_qtcore_include_dir}/QtCore")
64+
set(_qt_include_prefix "${_qtcore_include_dir}")
6665
break()
6766
endif()
6867
endforeach()
6968

7069
add_custom_command(OUTPUT ${PYTHONQT_WRAPPER_SOURCES}
71-
COMMAND ${CMAKE_COMMAND} -E env QTDIR=${_qt_dir} --modify ${LIBRARY_SEARCH_PATH}=path_list_prepend:$<TARGET_FILE_DIR:Qt${QT_VERSION_MAJOR}::Widgets> $<TARGET_FILE:${PROJECT_NAME}>
72-
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} #[[$<TARGET_FILE_DIR:${PROJECT_NAME}>]]
70+
COMMAND ${CMAKE_COMMAND} -E env --modify ${LIBRARY_SEARCH_PATH}=path_list_prepend:$<TARGET_FILE_DIR:Qt${QT_VERSION_MAJOR}::Widgets>
71+
$<TARGET_FILE:${PROJECT_NAME}> --qt-include-prefix="${_qt_include_prefix}"
72+
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
7373
DEPENDS ${PROJECT_NAME}
74-
VERBATIM
7574
)
7675

7776
set_source_files_properties(${PYTHONQT_WRAPPER_SOURCES} PROPERTIES
@@ -82,5 +81,3 @@ set_source_files_properties(${PYTHONQT_WRAPPER_SOURCES} PROPERTIES
8281
add_custom_target(PythonQtWrapper
8382
DEPENDS ${PROJECT_NAME} ${PYTHONQT_WRAPPER_SOURCES}
8483
)
85-
86-
message("_qt5Core_install_prefix " ${_qt5Core_install_prefix})

0 commit comments

Comments
 (0)