Skip to content

Commit 7ebf7a0

Browse files
authored
using COPY_FILE only with cmake 3.21+ where it is introduced (#1318)
Merge as the iOS build issue is unrelated.
1 parent f02d236 commit 7ebf7a0

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tests/functests/CMakeLists.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,14 @@ if (EXISTS ${CMAKE_SOURCE_DIR}/lib/modules/exp/tests)
3535
${CMAKE_SOURCE_DIR}/lib/modules/exp/tests/functests/ECSConfigCacheFuncTests.cpp
3636
)
3737
if (EXISTS ${CMAKE_SOURCE_DIR}/lib/modules/exp/tests/functests/test.json)
38-
file(COPY_FILE ${CMAKE_SOURCE_DIR}/lib/modules/exp/tests/functests/test.json ${CMAKE_BINARY_DIR}/test.json)
38+
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.21")
39+
# Use file(COPY_FILE ...) for CMake 3.21 and later
40+
file(COPY_FILE ${CMAKE_SOURCE_DIR}/lib/modules/exp/tests/functests/test.json ${CMAKE_BINARY_DIR}/test.json)
41+
else()
42+
# Use file(COPY ...) as an alternative for older versions
43+
file(COPY ${CMAKE_SOURCE_DIR}/lib/modules/exp/tests/functests/test.json
44+
DESTINATION ${CMAKE_BINARY_DIR})
45+
endif()
3946
endif()
4047
endif()
4148

0 commit comments

Comments
 (0)