Merge pull request #3845 from d3zd3z/fix3801

cmake: Avoid using target_properties for old cmake
This commit is contained in:
Janos Follath 2020-11-05 11:56:45 +00:00 committed by GitHub
commit 46f35849b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 5 deletions

View file

@ -36,7 +36,7 @@ foreach(exe IN LISTS executables_no_common_c executables_with_common_c)
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 @@ foreach(exe IN LISTS executables_no_common_c executables_with_common_c)
# 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()

View file

@ -32,8 +32,8 @@ foreach(exe IN LISTS executables)
target_include_directories(${exe} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../../tests/include)
endforeach()
target_sources(ssl_client2 PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../test/query_config.c)
target_sources(ssl_server2 PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../test/query_config.c)
set_property(TARGET ssl_client2 APPEND PROPERTY SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/../test/query_config.c)
set_property(TARGET ssl_server2 APPEND PROPERTY SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/../test/query_config.c)
if(THREADS_FOUND)
add_executable(ssl_pthread_server ssl_pthread_server.c $<TARGET_OBJECTS:mbedtls_test>)

View file

@ -37,7 +37,8 @@ foreach(exe IN LISTS executables_libs executables_mbedcrypto)
endif()
endforeach()
target_sources(query_compile_time_config PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/query_config.c)
set_property(TARGET query_compile_time_config APPEND PROPERTY SOURCES
${CMAKE_CURRENT_SOURCE_DIR}/query_config.c)
install(TARGETS ${executables_libs} ${executables_mbedcrypto}
DESTINATION "bin"