From 95b861fd21c4ffad328eaae1336868f277ea95db Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Wed, 14 Feb 2024 10:20:19 +0100 Subject: [PATCH 1/2] YCMEPHelper: If CMAKE_EXPORT_COMPILE_COMMANDS is defined and ON, pass it to all subprojects --- modules/YCMEPHelper.cmake | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/YCMEPHelper.cmake b/modules/YCMEPHelper.cmake index 27d4ed95..2fa2a1c8 100644 --- a/modules/YCMEPHelper.cmake +++ b/modules/YCMEPHelper.cmake @@ -255,6 +255,12 @@ macro(_YCM_SETUP) "-DCMAKE_PREFIX_PATH:PATH=${_CMAKE_PREFIX_PATH}") # Path used by cmake for finding stuff list(APPEND _YCM_EP_CMAKE_ARGS ${_YCM_EP_ADDITIONAL_CMAKE_ARGS}) + # If CMAKE_EXPORT_COMPILE_COMMANDS is defined, pass it along to the sub-projects + # See https://github.com/robotology/robotology-superbuild/issues/1596 + if(DEFINED CMAKE_EXPORT_COMPILE_COMMANDS AND ${CMAKE_EXPORT_COMPILE_COMMANDS}) + list(APPEND _YCM_EP_CMAKE_ARGS "-DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=${CMAKE_EXPORT_COMPILE_COMMANDS}") + endif() + # Default CMAKE_CACHE_ARGS (Initial cache, forced) set(_YCM_EP_CMAKE_CACHE_ARGS "-DCMAKE_INSTALL_PREFIX:PATH=${YCM_EP_INSTALL_DIR}") # Where to do the installation From 22dc15595ed34cdd1c037fa64ebfcf1ec4a3b243 Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Wed, 14 Feb 2024 10:23:46 +0100 Subject: [PATCH 2/2] Update CHANGELOG.md --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2db6d9c9..4068c5a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [Unreleased Patch] +### Changed + +* YCMEPHelper: If CMAKE_EXPORT_COMPILE_COMMANDS is defined and ON, pass it to all subprojects (https://github.com/robotology/ycm/pull/442). + ### Deprecated * FindGLFW3: Use glfw3Config.cmake and mark module as deprecated. Instead of using `find_package(GLFW3)`, please use `find_package(glfw3 NO_MODULE)` and link the `glfw` imported target (https://github.com/robotology/ycm/pull/441).