From b22a86c1c12512f2ef3ed885a3a481f17d2d755f Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Fri, 3 Aug 2012 15:38:26 +0000 Subject: [PATCH] Fix the CGALConfig.cmake that is installed, on Windows --- Installation/CMakeLists.txt | 29 +++++++++++-------- .../cmake/modules/CGALConfig_install.cmake.in | 12 ++++---- 2 files changed, 23 insertions(+), 18 deletions(-) diff --git a/Installation/CMakeLists.txt b/Installation/CMakeLists.txt index 8e7647e029d..678b36f6bf8 100644 --- a/Installation/CMakeLists.txt +++ b/Installation/CMakeLists.txt @@ -768,21 +768,26 @@ endif() # #-------------------------------------------------------------------------------------------------- -# Set CGAL_LIBRARY_NAME, CGAL_Qt3_LIBRARY_NAME and so on. Those variables -# are the name of CGAL libraries, without the path. Used in the generation -# of the installed CGALConfig.cmake -get_filename_component(CGAL_LIBRARY_NAME "${CGAL_LIBRARY}" NAME) -hide_variable(CGAL_LIBRARY_NAME) -foreach(lib ${CGAL_CONFIGURED_LIBRARIES}) - get_filename_component(CGAL_${lib}_LIBRARY_NAME "${CGAL_${lib}_LIBRARY}" NAME) - hide_variable(CGAL_${lib}_LIBRARY_NAME) -endforeach() - # fake to simplify loop set(CGAL_CGAL_LIBRARY ${CGAL_LIBRARY}) hide_variable(CGAL_CGAL_LIBRARY) -set(CGAL_CGAL_LIBRARY_NAME ${CGAL_LIBRARY_NAME}) -hide_variable(CGAL_CGAL_LIBRARY_NAME) + +# Set CGAL_INSTALLED_LIBRARY, CGAL_INSTALLED_Qt3_LIBRARY and so on. Those +# variables are the path to the libraries installed by the install +# target. Used in the generation of the installed CGALConfig.cmake +foreach(lib ${CGAL_CONFIGURED_LIBRARIES} CGAL) # note the added fake 'CGAL' + if(CGAL_${lib}_LIBRARY) + get_filename_component(lib_name "${CGAL_${lib}_LIBRARY}" NAME) + set(CGAL_INSTALLED_${lib}_LIBRARY "${CMAKE_INSTALL_PREFIX}/${CGAL_INSTALL_LIB_DIR}/${lib_name}") + else() + set(CGAL_INSTALLED_${lib}_LIBRARY "") + endif() + hide_variable(CGAL_INSTALLED_${lib}_LIBRARY) +endforeach() + +# set back from the fake +set(CGAL_INSTALLED_LIBRARY ${CGAL_INSTALLED_CGAL_LIBRARY}) +hide_variable(CGAL_INSTALLED_LIBRARY) create_CGALconfig_files() diff --git a/Installation/cmake/modules/CGALConfig_install.cmake.in b/Installation/cmake/modules/CGALConfig_install.cmake.in index df6515bfaf2..e770b323787 100644 --- a/Installation/cmake/modules/CGALConfig_install.cmake.in +++ b/Installation/cmake/modules/CGALConfig_install.cmake.in @@ -39,12 +39,12 @@ set(WITH_CGAL_ImageIO "@WITH_CGAL_ImageIO@" ) set(WITH_CGAL_Qt3 "@WITH_CGAL_Qt3@" ) set(WITH_CGAL_Qt4 "@WITH_CGAL_Qt4@" ) -set(CGAL_LIBRARY "@CMAKE_INSTALL_PREFIX@/@CGAL_INSTALL_LIB_DIR@/@CGAL_LIBRARY_NAME@") -set(CGAL_CGAL_LIBRARY "@CMAKE_INSTALL_PREFIX@/@CGAL_INSTALL_LIB_DIR@/@CGAL_CGAL_LIBRARY_NAME@") -set(CGAL_Core_LIBRARY "@CMAKE_INSTALL_PREFIX@/@CGAL_INSTALL_LIB_DIR@/@CGAL_Core_LIBRARY_NAME@") -set(CGAL_ImageIO_LIBRARY "@CMAKE_INSTALL_PREFIX@/@CGAL_INSTALL_LIB_DIR@/@CGAL_ImageIO_LIBRARY_NAME@") -set(CGAL_Qt3_LIBRARY "@CMAKE_INSTALL_PREFIX@/@CGAL_INSTALL_LIB_DIR@/@CGAL_Qt3_LIBRARY_NAME@" ) -set(CGAL_Qt4_LIBRARY "@CMAKE_INSTALL_PREFIX@/@CGAL_INSTALL_LIB_DIR@/@CGAL_Qt4_LIBRARY_NAME@" ) +set(CGAL_LIBRARY "@CGAL_INSTALLED_LIBRARY@") +set(CGAL_CGAL_LIBRARY "@CGAL_INSTALLED_CGAL_LIBRARY@") +set(CGAL_Core_LIBRARY "@CGAL_INSTALLED_Core_LIBRARY@") +set(CGAL_ImageIO_LIBRARY "@CGAL_INSTALLED_ImageIO_LIBRARY@") +set(CGAL_Qt3_LIBRARY "@CGAL_INSTALLED_Qt3_LIBRARY@") +set(CGAL_Qt4_LIBRARY "@CGAL_INSTALLED_Qt4_LIBRARY@") set(CGAL_3RD_PARTY_INCLUDE_DIRS "@CGAL_3RD_PARTY_INCLUDE_DIRS@" ) set(CGAL_3RD_PARTY_DEFINITIONS "@CGAL_3RD_PARTY_DEFINITIONS@" )