diff --git a/Installation/cmake/modules/CGAL_CreateSingleSourceCGALProgram.cmake b/Installation/cmake/modules/CGAL_CreateSingleSourceCGALProgram.cmake index c5a7fc5b4ec..18d7f418ce7 100644 --- a/Installation/cmake/modules/CGAL_CreateSingleSourceCGALProgram.cmake +++ b/Installation/cmake/modules/CGAL_CreateSingleSourceCGALProgram.cmake @@ -70,7 +70,9 @@ function(create_single_source_cgal_program firstfile ) target_link_libraries(${exe_name} PRIVATE CGAL::CGAL) foreach(comp ${CGAL_REQUESTED_COMPONENTS}) - target_link_libraries(${exe_name} PRIVATE CGAL::CGAL_${comp}) + if(TARGET CGAL::CGAL_${comp}) + target_link_libraries(${exe_name} PRIVATE CGAL::CGAL_${comp}) + endif() endforeach() if(CGAL_3RD_PARTY_LIBRARIES) target_link_libraries(${exe_name} PRIVATE ${CGAL_3RD_PARTY_LIBRARIES})