From 1056d74eba45af236ae56e6e91b885ceff37e022 Mon Sep 17 00:00:00 2001 From: Fabien Spindler Date: Tue, 14 May 2024 09:34:59 +0200 Subject: [PATCH] Fix vp_add_subdirectory that produced an issue on macos complaining about apps/ folder that already exists --- cmake/VISPUtils.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmake/VISPUtils.cmake b/cmake/VISPUtils.cmake index 521ca00859..0b10ab4cec 100644 --- a/cmake/VISPUtils.cmake +++ b/cmake/VISPUtils.cmake @@ -1095,7 +1095,10 @@ macro(vp_add_subdirectories lst subdir) file(GLOB __subdirs RELATIVE "${__path}/${subdir}" "${__path}/${subdir}/*") foreach(__s ${__subdirs}) if(EXISTS "${__path}/${subdir}/${__s}/CMakeLists.txt") - add_subdirectory("${__path}/${subdir}/${__s}" "${CMAKE_BINARY_DIR}/${subdir}/${__s}") + # Add subdir only if ut doesn't exist + if(NOT EXISTS "${CMAKE_BINARY_DIR}/${subdir}/${__s}") + add_subdirectory("${__path}/${subdir}/${__s}" "${CMAKE_BINARY_DIR}/${subdir}/${__s}") + endif() endif() endforeach() endif()