Skip to content

Commit 6c5522b

Browse files
authored
[O2-1977][CMake](fix) Filter out macros in build directory if any (#5241)
1 parent f637b25 commit 6c5522b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cmake/O2GetListOfMacros.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,9 @@ function(o2_get_list_of_macros dir varname)
1818
file(GLOB_RECURSE listOfMacros RELATIVE ${CMAKE_SOURCE_DIR} ${dir}/*.C)
1919
# Case sensitive filtering of .C files (to avoid .c files on Mac)
2020
list(FILTER listOfMacros INCLUDE REGEX "^.*\\.C$")
21+
# Remove macros that were copied to the build directory, to deal with
22+
# the (non-recommended-but-can-happen) case where the build directory
23+
# is a subdirectory of the source dir
24+
list(FILTER listOfMacros EXCLUDE REGEX "/stage/${CMAKE_INSTALL_DATADIR}")
2125
set(${varname} ${listOfMacros} PARENT_SCOPE)
2226
endfunction()

0 commit comments

Comments
 (0)