Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try to fix link issues with qt6 resources #7915

Merged
merged 8 commits into from
Jan 19, 2024
5 changes: 2 additions & 3 deletions Installation/cmake/modules/CGAL_add_test.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,8 @@ function(cgal_add_compilation_test exe_name)
if(TARGET CGAL_Qt6_moc_and_resources) # if CGAL_Qt6 was searched, and is header-only
get_property(linked_libraries TARGET "${exe_name}" PROPERTY LINK_LIBRARIES)
# message(STATUS "${exe_name} depends on ${linked_libraries}")
string(FIND "${linked_libraries}" "CGAL::CGAL_Qt6" link_with_CGAL_Qt6)
if(link_with_CGAL_Qt6 STRGREATER "-1" AND
NOT TARGET "compilation_of__CGAL_Qt6_moc_and_resources")
if( ("CGAL_Qt6" IN_LIST linked_libraries OR "CGAL::CGAL_Qt6" IN_LIST linked_libraries OR "CGAL::CGAL_Basic_viewer" IN_LIST linked_libraries)
AND NOT TARGET "compilation_of__CGAL_Qt6_moc_and_resources")
# This custom target is useless. It is used only as a flag to
# detect that the test has already been created.
add_custom_target("compilation_of__CGAL_Qt6_moc_and_resources")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This module install a hook (with `variable_watch()`) on CMAKE_CURRENT_LIST_DIR
#
#
# That uses the non-documented fact that CMAKE_CURRENT_LIST_DIR is cleared
# by CMake at the end of the configuration process. So, if the value of
# that variable gets empty, that means that CMake has reached the end of
Expand Down Expand Up @@ -110,7 +110,7 @@ function(CGAL_hook_fix_ctest_depending_on_Qt6)
continue()
endif()
get_property(_target_links TARGET ${_target} PROPERTY LINK_LIBRARIES)
if("CGAL_Qt6" IN_LIST _target_links OR "CGAL::CGAL_Qt6" IN_LIST _target_links)
if("CGAL_Qt6" IN_LIST _target_links OR "CGAL::CGAL_Qt6" IN_LIST _target_links OR "CGAL::CGAL_Basic_viewer" IN_LIST _target_links)
set_property(TEST "compilation of ${_target}" APPEND PROPERTY FIXTURES_REQUIRED CGAL_Qt6_moc_and_resources_Fixture)
endif()
endforeach()
Expand Down