From b9465c31ec7e9609296e036dd3e11b458298ab3d Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 28 Jul 2016 16:33:41 +0200 Subject: [PATCH 1/2] Fix the indentation --- Installation/src/CMakeLists.txt | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Installation/src/CMakeLists.txt b/Installation/src/CMakeLists.txt index 92d2649f740..feff2060e0e 100644 --- a/Installation/src/CMakeLists.txt +++ b/Installation/src/CMakeLists.txt @@ -45,18 +45,18 @@ function (collect_cgal_library LIBRARY_NAME ADDITIONAL_FILES) endif() if (NOT CGAL_HEADER_ONLY) - add_library (${LIBRARY_NAME} - ${CMAKE_CURRENT_BINARY_DIR}/all_files.cpp - ${rc_file} - ${ADDITIONAL_FILES}) - # add_library (${LIBRARY_NAME} ${CGAL_LIBRARY_SOURCE_FILES} ${rc_file} ${ADDITIONAL_FILES}) # builing not creating temporary all_files.cpp - if(CGAL_SOVERSION AND CGAL_SONAME_VERSION) - set_target_properties(${LIBRARY_NAME} PROPERTIES - VERSION "${CGAL_SOVERSION}" - SOVERSION "${CGAL_SONAME_VERSION}") - endif() + add_library (${LIBRARY_NAME} + ${CMAKE_CURRENT_BINARY_DIR}/all_files.cpp + ${rc_file} + ${ADDITIONAL_FILES}) + # add_library (${LIBRARY_NAME} ${CGAL_LIBRARY_SOURCE_FILES} ${rc_file} ${ADDITIONAL_FILES}) # builing not creating temporary all_files.cpp + if(CGAL_SOVERSION AND CGAL_SONAME_VERSION) + set_target_properties(${LIBRARY_NAME} PROPERTIES + VERSION "${CGAL_SOVERSION}" + SOVERSION "${CGAL_SONAME_VERSION}") + endif() else() - add_library(${LIBRARY_NAME} INTERFACE) + add_library(${LIBRARY_NAME} INTERFACE) endif() if(CGAL_AUTO_LINK_ENABLED) From acf339d27f708d14e4569e25b4a648501a8d15c6 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 28 Jul 2016 16:36:42 +0200 Subject: [PATCH 2/2] Hack to fix a bug with CGAL_HEADER_ONLY If a `CMakeCache.txt ` is first created without `CGAL_HEADER_ONLY`, and then `CGAL_HEADER_ONLY` is set, then CMake displays error messages like: ``` CMake Error: Target CGAL has dependency information when it shouldn't. Your cache is probably stale. Please remove the entry CGAL_LIB_DEPENDS from the cache. ``` The problem comes from the fact that the target `CGAL` was first created as a library target, and then turned into an "interface library" target. This patch fixes the error the simplest way: remove the aforementioned variable from the cache if it is present. --- Installation/src/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Installation/src/CMakeLists.txt b/Installation/src/CMakeLists.txt index feff2060e0e..da2b92f5bad 100644 --- a/Installation/src/CMakeLists.txt +++ b/Installation/src/CMakeLists.txt @@ -56,6 +56,11 @@ function (collect_cgal_library LIBRARY_NAME ADDITIONAL_FILES) SOVERSION "${CGAL_SONAME_VERSION}") endif() else() + if(${LIBRARY_NAME}_LIB_DEPENDS) + # Fix a bug when CGAL is configured first without `CGAL_HEADER_ONLY` + # and then `CGAL_HEADER_ONLY` is set without cleaning the cache. + unset(${LIBRARY_NAME}_LIB_DEPENDS CACHE) + endif() add_library(${LIBRARY_NAME} INTERFACE) endif()