From 163eb004a8b21eec31188867a9a4bc2bafb3e10d Mon Sep 17 00:00:00 2001 From: Joris Vaillant Date: Fri, 29 Nov 2024 10:57:47 +0100 Subject: [PATCH 1/3] cmake: Turn hpp-fcl into an interface library --- hpp-fclConfig.cmake | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/hpp-fclConfig.cmake b/hpp-fclConfig.cmake index 1e2664285..7139c9d4f 100644 --- a/hpp-fclConfig.cmake +++ b/hpp-fclConfig.cmake @@ -5,10 +5,22 @@ message(WARNING "Please update your CMake from 'hpp-fcl' to 'coal'") find_package(coal REQUIRED) if(NOT TARGET hpp-fcl::hpp-fcl) - add_library(hpp-fcl::hpp-fcl SHARED IMPORTED) - target_link_libraries(hpp-fcl::hpp-fcl INTERFACE coal::coal) - get_property(_cfg TARGET coal::coal PROPERTY IMPORTED_CONFIGURATIONS) - get_property(_loc TARGET coal::coal PROPERTY "IMPORTED_LOCATION_${_cfg}") - set_property(TARGET hpp-fcl::hpp-fcl PROPERTY IMPORTED_LOCATION "${_loc}") - target_compile_definitions(hpp-fcl::hpp-fcl INTERFACE COAL_BACKWARD_COMPATIBILITY_WITH_HPP_FCL) + add_library(hpp-fcl::hpp-fcl INTERFACE IMPORTED) + + # Compute the installation prefix relative to this file. + # This code is taken from generated cmake xxxTargets.cmake. + get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH) + get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) + get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) + get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) + if(_IMPORT_PREFIX STREQUAL "/") + set(_IMPORT_PREFIX "") + endif() + + set_target_properties( + hpp-fcl::hpp-fcl + PROPERTIES INTERFACE_COMPILE_DEFINITIONS + "COAL_BACKWARD_COMPATIBILITY_WITH_HPP_FCL" + INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include" + INTERFACE_LINK_LIBRARIES "coal::coal") endif() From bf525f7dd60e3480e264c97cc5206c379f95e030 Mon Sep 17 00:00:00 2001 From: Joris Vaillant Date: Fri, 29 Nov 2024 11:18:39 +0100 Subject: [PATCH 2/3] changelog: Add entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c8c583d6..fd1ba085d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Remove CMake CMP0167 warnings ([#630](https://github.com/coal-library/coal/pull/630)) - Allow to run test in the build directory on Windows ([#630](https://github.com/coal-library/coal/pull/630)) - Updated nix flake from `hpp-fcl` to `coal` ([#632](https://github.com/coal-library/coal/pull/632) +- Fix hpp-fclConfig.cmake on Windows ([#633](https://github.com/coal-library/coal/pull/633)) ### Added - Add Pixi support ([#629](https://github.com/coal-library/coal/pull/629)) From c5efc62ce25973b4eb5fd72638f282b2fb53e000 Mon Sep 17 00:00:00 2001 From: Joris Vaillant Date: Tue, 3 Dec 2024 13:20:44 +0100 Subject: [PATCH 3/3] core: Fix pragma message use with clang-cl --- include/hpp/fcl/coal.hpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/include/hpp/fcl/coal.hpp b/include/hpp/fcl/coal.hpp index e4fdb758c..8b53cc15a 100644 --- a/include/hpp/fcl/coal.hpp +++ b/include/hpp/fcl/coal.hpp @@ -6,12 +6,8 @@ #define COAL_BACKWARD_COMPATIBILITY_WITH_HPP_FCL -#ifdef _MSC_VER -#pragma message COAL_DEPRECATED_HEADER( \ - "Please update your includes from 'hpp/fcl' to 'coal'") -#else -#warning "Please update your includes from 'hpp/fcl' to 'coal'" -#endif +// Don't setup warning because there can be ignored by -isystem +#pragma message("Please update your includes from 'hpp/fcl' to 'coal'") #define HPP_FCL_VERSION_AT_LEAST(major, minor, patch) \ COAL_VERSION_AT_LEAST(major, minor, patch)