From 12744ab7ffadd2d2480a1924168f0162f0240bb6 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 28 Apr 2011 13:11:09 +0000 Subject: [PATCH] Track dependencies between libraries and examples/demos With this patch, when CGAL as been configured with WITH_examples and/or WITH_demos, then the executables of examples and demos depends on the CGAL libraries. That means if one change a file involved in a CGAL library, and ask the rebuild of an executable, then the CGAL library will be rebuilt first. --- Installation/cmake/modules/UseCGAL.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Installation/cmake/modules/UseCGAL.cmake b/Installation/cmake/modules/UseCGAL.cmake index adc60e1b260..93a299ad9e5 100644 --- a/Installation/cmake/modules/UseCGAL.cmake +++ b/Installation/cmake/modules/UseCGAL.cmake @@ -22,7 +22,11 @@ if(NOT USE_CGAL_FILE_INCLUDED) foreach ( CGAL_COMPONENT ${CGAL_REQUESTED_COMPONENTS} ) if(WITH_CGAL_${CGAL_COMPONENT}) - add_to_list( CGAL_LIBRARIES ${CGAL_${CGAL_COMPONENT}_LIBRARY} ) + if(TARGET CGAL_${CGAL_COMPONENT}) + add_to_list( CGAL_LIBRARIES CGAL_${CGAL_COMPONENT} ) + else() + add_to_list( CGAL_LIBRARIES ${CGAL_${CGAL_COMPONENT}_LIBRARY} ) + endif() add_to_list( CGAL_3RD_PARTY_LIBRARIES ${CGAL_${CGAL_COMPONENT}_3RD_PARTY_LIBRARIES} ) add_to_list( CGAL_3RD_PARTY_INCLUDE_DIRS ${CGAL_${CGAL_COMPONENT}_3RD_PARTY_INCLUDE_DIRS} )