From 61e61220eb43ea8c3d4a6ebd84d44b0510d8533d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20M=C3=B6ller?= Date: Mon, 22 Jun 2015 11:14:04 +0200 Subject: [PATCH 1/2] Use get_filename_component to manipulate paths This caused a bug in CMake>=3.3.0 when file(GLOB) is not adding multiple slashes. The lack of trailing slashes is guaranteed and documented in get_filename_component. --- Installation/src/CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Installation/src/CMakeLists.txt b/Installation/src/CMakeLists.txt index 2cfbf2b00a4..bee51f07f34 100644 --- a/Installation/src/CMakeLists.txt +++ b/Installation/src/CMakeLists.txt @@ -117,8 +117,9 @@ set(CGAL_CONFIGURED_LIBRARIES "") foreach(package ${CGAL_CONFIGURED_PACKAGES}) file(GLOB CONFIGURED_LIBS_IN_PACKAGE ${package}/src/CGAL_*/CMakeLists.txt) foreach (libconfigfile ${CONFIGURED_LIBS_IN_PACKAGE}) - string(REPLACE "${package}/src/" "" libconfigfile ${libconfigfile}) - string(REPLACE "//CMakeLists.txt" "" CGAL_CONFIGURED_LIBRARY_NAME ${libconfigfile}) + get_filename_component(CGAL_CONFIGURED_LIBRARY_NAME ${libconfigfile} DIRECTORY) + get_filename_component(CGAL_CONFIGURED_LIBRARY_NAME ${CGAL_CONFIGURED_LIBRARY_NAME} NAME) + if (NOT ${CGAL_CONFIGURED_LIBRARY_NAME} STREQUAL "CGAL") message(STATUS "Sources for CGAL component library '${CGAL_CONFIGURED_LIBRARY_NAME}' detected") From 06a17381a6661ae0a34d577622b6043e08316f4e Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 23 Jun 2015 11:22:01 +0200 Subject: [PATCH 2/2] Fix the use of get_filename_component For CMake<=2.8.11, the option DIRECTORY must be renamed to PATH, the legacy name of the option. --- Installation/src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Installation/src/CMakeLists.txt b/Installation/src/CMakeLists.txt index bee51f07f34..ff31b802b6c 100644 --- a/Installation/src/CMakeLists.txt +++ b/Installation/src/CMakeLists.txt @@ -117,7 +117,7 @@ set(CGAL_CONFIGURED_LIBRARIES "") foreach(package ${CGAL_CONFIGURED_PACKAGES}) file(GLOB CONFIGURED_LIBS_IN_PACKAGE ${package}/src/CGAL_*/CMakeLists.txt) foreach (libconfigfile ${CONFIGURED_LIBS_IN_PACKAGE}) - get_filename_component(CGAL_CONFIGURED_LIBRARY_NAME ${libconfigfile} DIRECTORY) + get_filename_component(CGAL_CONFIGURED_LIBRARY_NAME ${libconfigfile} PATH) get_filename_component(CGAL_CONFIGURED_LIBRARY_NAME ${CGAL_CONFIGURED_LIBRARY_NAME} NAME) if (NOT ${CGAL_CONFIGURED_LIBRARY_NAME} STREQUAL "CGAL")