mirror of https://github.com/CGAL/cgal
Try to fix link issues with qt6 resources (#7915)
This commit is contained in:
commit
2e4139cbb3
|
|
@ -57,12 +57,6 @@ function(create_single_source_cgal_program firstfile )
|
||||||
set(NO_TESTING TRUE)
|
set(NO_TESTING TRUE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT NO_TESTING)
|
|
||||||
cgal_add_test(${exe_name})
|
|
||||||
else()
|
|
||||||
cgal_add_test(${exe_name} NO_EXECUTION)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
add_to_cached_list( CGAL_EXECUTABLE_TARGETS ${exe_name} )
|
add_to_cached_list( CGAL_EXECUTABLE_TARGETS ${exe_name} )
|
||||||
|
|
||||||
target_link_libraries(${exe_name} PRIVATE CGAL::CGAL CGAL::Data)
|
target_link_libraries(${exe_name} PRIVATE CGAL::CGAL CGAL::Data)
|
||||||
|
|
@ -75,14 +69,11 @@ function(create_single_source_cgal_program firstfile )
|
||||||
target_link_libraries(${exe_name} PRIVATE ${CGAL_3RD_PARTY_LIBRARIES})
|
target_link_libraries(${exe_name} PRIVATE ${CGAL_3RD_PARTY_LIBRARIES})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(POLICY CMP0064)
|
|
||||||
# CMake 3.4 or later
|
|
||||||
if(NOT NO_TESTING)
|
if(NOT NO_TESTING)
|
||||||
cgal_add_test(${exe_name})
|
cgal_add_test(${exe_name})
|
||||||
else()
|
else()
|
||||||
cgal_add_test(${exe_name} NO_EXECUTION)
|
cgal_add_test(${exe_name} NO_EXECUTION)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
|
||||||
|
|
||||||
else()
|
else()
|
||||||
message(AUTHOR_WARNING "The executable ${exe_name} will not be created because the source file ${firstfile} does not exist.")
|
message(AUTHOR_WARNING "The executable ${exe_name} will not be created because the source file ${firstfile} does not exist.")
|
||||||
|
|
|
||||||
|
|
@ -117,16 +117,15 @@ function(cgal_add_compilation_test exe_name)
|
||||||
add_test(NAME "check build system"
|
add_test(NAME "check build system"
|
||||||
COMMAND "${CMAKE_COMMAND}" --build "${CMAKE_BINARY_DIR}" --target "cgal_check_build_system" --config "$<CONFIG>")
|
COMMAND "${CMAKE_COMMAND}" --build "${CMAKE_BINARY_DIR}" --target "cgal_check_build_system" --config "$<CONFIG>")
|
||||||
set_property(TEST "check build system"
|
set_property(TEST "check build system"
|
||||||
APPEND PROPERTY LABELS "CGAL_build_system")
|
APPEND PROPERTY LABELS "CGAL_build_system" "Installation")
|
||||||
set_property(TEST "check build system"
|
set_property(TEST "check build system"
|
||||||
PROPERTY FIXTURES_SETUP "check_build_system_SetupFixture")
|
PROPERTY FIXTURES_SETUP "check_build_system_SetupFixture")
|
||||||
endif()
|
endif()
|
||||||
if(TARGET CGAL_Qt6_moc_and_resources) # if CGAL_Qt6 was searched, and is header-only
|
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)
|
get_property(linked_libraries TARGET "${exe_name}" PROPERTY LINK_LIBRARIES)
|
||||||
# message(STATUS "${exe_name} depends on ${linked_libraries}")
|
# message(STATUS "${exe_name} depends on ${linked_libraries}")
|
||||||
string(FIND "${linked_libraries}" "CGAL::CGAL_Qt6" link_with_CGAL_Qt6)
|
if( ("CGAL_Qt6" IN_LIST linked_libraries OR "CGAL::CGAL_Qt6" IN_LIST linked_libraries OR "CGAL::CGAL_Basic_viewer" IN_LIST linked_libraries)
|
||||||
if(link_with_CGAL_Qt6 STRGREATER "-1" AND
|
AND NOT TARGET "compilation_of__CGAL_Qt6_moc_and_resources")
|
||||||
NOT TARGET "compilation_of__CGAL_Qt6_moc_and_resources")
|
|
||||||
# This custom target is useless. It is used only as a flag to
|
# This custom target is useless. It is used only as a flag to
|
||||||
# detect that the test has already been created.
|
# detect that the test has already been created.
|
||||||
add_custom_target("compilation_of__CGAL_Qt6_moc_and_resources")
|
add_custom_target("compilation_of__CGAL_Qt6_moc_and_resources")
|
||||||
|
|
@ -134,7 +133,7 @@ function(cgal_add_compilation_test exe_name)
|
||||||
add_test(NAME "compilation of CGAL_Qt6_moc_and_resources"
|
add_test(NAME "compilation of CGAL_Qt6_moc_and_resources"
|
||||||
COMMAND "${CMAKE_COMMAND}" --build "${CMAKE_BINARY_DIR}" --target "CGAL_Qt6_moc_and_resources" --config "$<CONFIG>")
|
COMMAND "${CMAKE_COMMAND}" --build "${CMAKE_BINARY_DIR}" --target "CGAL_Qt6_moc_and_resources" --config "$<CONFIG>")
|
||||||
set_property(TEST "compilation of CGAL_Qt6_moc_and_resources"
|
set_property(TEST "compilation of CGAL_Qt6_moc_and_resources"
|
||||||
APPEND PROPERTY LABELS "CGAL_build_system")
|
APPEND PROPERTY LABELS "CGAL_build_system" "Installation")
|
||||||
set_property(TEST "compilation of CGAL_Qt6_moc_and_resources"
|
set_property(TEST "compilation of CGAL_Qt6_moc_and_resources"
|
||||||
PROPERTY FIXTURES_SETUP "CGAL_Qt6_moc_and_resources_Fixture")
|
PROPERTY FIXTURES_SETUP "CGAL_Qt6_moc_and_resources_Fixture")
|
||||||
set_property(TEST "compilation of CGAL_Qt6_moc_and_resources"
|
set_property(TEST "compilation of CGAL_Qt6_moc_and_resources"
|
||||||
|
|
|
||||||
|
|
@ -110,7 +110,7 @@ function(CGAL_hook_fix_ctest_depending_on_Qt6)
|
||||||
continue()
|
continue()
|
||||||
endif()
|
endif()
|
||||||
get_property(_target_links TARGET ${_target} PROPERTY LINK_LIBRARIES)
|
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)
|
set_property(TEST "compilation of ${_target}" APPEND PROPERTY FIXTURES_REQUIRED CGAL_Qt6_moc_and_resources_Fixture)
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
|
||||||
|
|
@ -45,11 +45,11 @@ include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
|
||||||
COMMAND "${CMAKE_COMMAND}" --build "${CMAKE_BINARY_DIR}" --target "demo_framework" --config "$<CONFIG>")
|
COMMAND "${CMAKE_COMMAND}" --build "${CMAKE_BINARY_DIR}" --target "demo_framework" --config "$<CONFIG>")
|
||||||
|
|
||||||
set_property(TEST "compilation of demo_framework"
|
set_property(TEST "compilation of demo_framework"
|
||||||
APPEND PROPERTY LABELS "CGAL_build_system")
|
APPEND PROPERTY LABELS "CGAL_build_system" "Installation" "${PROJECT_NAME}")
|
||||||
set_property(TEST "compilation of demo_framework"
|
set_property(TEST "compilation of demo_framework"
|
||||||
APPEND PROPERTY FIXTURES_SETUP "demo_framework_SetupFixture")
|
APPEND PROPERTY FIXTURES_SETUP "demo_framework_SetupFixture")
|
||||||
set_property(TEST "compilation of demo_framework"
|
set_property(TEST "compilation of demo_framework"
|
||||||
APPEND PROPERTY DEPENDS "compilation_of__CGAL_Qt6_moc_and_resources")
|
APPEND PROPERTY DEPENDS "check build system" "compilation of CGAL_Qt6_moc_and_resources")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
|
|
@ -61,7 +61,7 @@ include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
|
||||||
endif()
|
endif()
|
||||||
# Link with CGAL
|
# Link with CGAL
|
||||||
target_link_libraries( ${plugin_name} PUBLIC CGAL::CGAL )
|
target_link_libraries( ${plugin_name} PUBLIC CGAL::CGAL )
|
||||||
if(TARGET Polyhedron_3)
|
if(NOT CGAL_TEST_SUITE AND TARGET Polyhedron_3)
|
||||||
add_dependencies( ${plugin_name} Polyhedron_3 )
|
add_dependencies( ${plugin_name} Polyhedron_3 )
|
||||||
endif()
|
endif()
|
||||||
if(NOT TARGET CGALlab_all_plugins)
|
if(NOT TARGET CGALlab_all_plugins)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue