cmake: Avoid using target_properties for old cmake
CMake versions less than 3.0 do not support the `target_sources`
command. In order to be able to support v2.8.12.2 of cmake, directly
set the SOURCES property instead of using the target_sources command.
A future patch could reverse this, if the project decides to forgo
support for cmake versions less than 3.0.
Fixes #3801
Signed-off-by: David Brown <david.brown@linaro.org>
diff --git a/programs/fuzz/CMakeLists.txt b/programs/fuzz/CMakeLists.txt
index 35512c7..f0e5705 100644
--- a/programs/fuzz/CMakeLists.txt
+++ b/programs/fuzz/CMakeLists.txt
@@ -36,7 +36,7 @@
if (NOT FUZZINGENGINE_LIB)
target_link_libraries(${exe} ${libs})
- target_sources(${exe} PRIVATE onefile.c)
+ set_property(TARGET ${exe} APPEND PROPERTY SOURCES onefile.c)
else()
target_link_libraries(${exe} ${libs} FuzzingEngine)
SET_TARGET_PROPERTIES(${exe} PROPERTIES LINKER_LANGUAGE CXX)
@@ -45,7 +45,7 @@
# This emulates "if ( ... IN_LIST ... )" which becomes available in CMake 3.3
list(FIND executables_with_common_c ${exe} exe_index)
if (${exe_index} GREATER -1)
- target_sources(${exe} PRIVATE common.c)
+ set_property(TARGET ${exe} APPEND PROPERTY SOURCES common.c)
endif()
endforeach()