From ff28df98f51bb73dd26d431fd6faabf3118d1fc0 Mon Sep 17 00:00:00 2001 From: David Brown Date: Wed, 4 Nov 2020 10:43:58 -0700 Subject: [PATCH] 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, add the extra targets directly to the target command. This is a backport from the development branch, except that the uses in this branch are simpler, and modifying the SOURCES property directly is not needed. Fixes #3801 Signed-off-by: David Brown --- programs/ssl/CMakeLists.txt | 8 ++++---- programs/test/CMakeLists.txt | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/programs/ssl/CMakeLists.txt b/programs/ssl/CMakeLists.txt index b3ef4f8e9..094543bdc 100644 --- a/programs/ssl/CMakeLists.txt +++ b/programs/ssl/CMakeLists.txt @@ -37,8 +37,8 @@ target_link_libraries(mini_client ${libs}) add_executable(ssl_client1 ssl_client1.c) target_link_libraries(ssl_client1 ${libs}) -add_executable(ssl_client2 ssl_client2.c) -target_sources(ssl_client2 PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/query_config.c) +add_executable(ssl_client2 ssl_client2.c + ${CMAKE_CURRENT_SOURCE_DIR}/query_config.c) target_link_libraries(ssl_client2 ${libs}) add_executable(ssl_fork_server ssl_fork_server.c) @@ -50,8 +50,8 @@ target_link_libraries(ssl_mail_client ${libs}) add_executable(ssl_server ssl_server.c) target_link_libraries(ssl_server ${libs}) -add_executable(ssl_server2 ssl_server2.c) -target_sources(ssl_server2 PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/query_config.c) +add_executable(ssl_server2 ssl_server2.c + ${CMAKE_CURRENT_SOURCE_DIR}/query_config.c) target_link_libraries(ssl_server2 ${libs}) if(THREADS_FOUND) diff --git a/programs/test/CMakeLists.txt b/programs/test/CMakeLists.txt index 5feb31773..a74db1e08 100644 --- a/programs/test/CMakeLists.txt +++ b/programs/test/CMakeLists.txt @@ -27,8 +27,8 @@ target_link_libraries(udp_proxy ${libs}) add_executable(zeroize zeroize.c) target_link_libraries(zeroize ${libs}) -add_executable(query_compile_time_config query_compile_time_config.c) -target_sources(query_compile_time_config PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../ssl/query_config.c) +add_executable(query_compile_time_config query_compile_time_config.c + ${CMAKE_CURRENT_SOURCE_DIR}/../ssl/query_config.c) target_link_libraries(query_compile_time_config ${libs}) install(TARGETS selftest benchmark udp_proxy query_compile_time_config