Link with the CGAL *target* we possible (instead of linking with the library)

That is a late follow-up to the following commit:

  | commit 12744ab7ff
  | Author: Laurent Rineau <Laurent.Rineau__CGAL@normalesup.org>
  | Date:   Thu Apr 28 13:11:09 2011 +0000
  |
  |     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.
  |
  | Notes:
  |     r63187 branches/next

Or maybe the bug was re-introduced by recent modifications of our CMake
scripts.
This commit is contained in:
Laurent Rineau 2013-08-20 15:45:29 +02:00
parent e2aca14121
commit 85eeaca873
1 changed files with 5 additions and 1 deletions

View File

@ -46,7 +46,11 @@ if(NOT USE_CGAL_FILE_INCLUDED)
if ( NOT CGAL_LIBRARY )
cache_get(CGAL_LIBRARY)
endif()
add_to_list( CGAL_LIBRARIES ${CGAL_LIBRARY} )
if(TARGET CGAL)
add_to_list( CGAL_LIBRARIES CGAL )
else()
add_to_list( CGAL_LIBRARIES ${CGAL_LIBRARY} )
endif()
#message (STATUS "LIB: ${CGAL_LIBRARY}")
#message (STATUS "LIBS: ${CGAL_LIBRARIES}")