From 2fb08c6455bf6f08209b5993c755c1135611813b Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Thu, 7 Nov 2013 18:09:32 +0100 Subject: CMake: add LINK_LIBRARIES workaround for old CMake versions --- cmake/fastd_module.cmake | 2 +- src/crypto/cipher/CMakeLists.txt | 4 +++- src/crypto/mac/CMakeLists.txt | 4 +++- src/methods/CMakeLists.txt | 3 +++ 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/cmake/fastd_module.cmake b/cmake/fastd_module.cmake index 83e68d0..26285ae 100644 --- a/cmake/fastd_module.cmake +++ b/cmake/fastd_module.cmake @@ -15,7 +15,7 @@ function(fastd_module type enabled_var info name) add_library(${type}_${name_} STATIC ${ARGN}) set_property(TARGET ${type}_${name_} PROPERTY COMPILE_FLAGS "${FASTD_CFLAGS}") - set_property(TARGET ${type}s APPEND PROPERTY LINK_LIBRARIES ${type}_${name_}) + set_property(TARGET ${type}s APPEND PROPERTY FASTD_LINK_LIBRARIES ${type}_${name_}) list(APPEND ${TYPE}S ${name_}) diff --git a/src/crypto/cipher/CMakeLists.txt b/src/crypto/cipher/CMakeLists.txt index 3c9b342..bda5cba 100644 --- a/src/crypto/cipher/CMakeLists.txt +++ b/src/crypto/cipher/CMakeLists.txt @@ -59,7 +59,9 @@ foreach(cipher ${CIPHERS}) endforeach(impl) set(CIPHER_IMPLS "${CIPHER_IMPLS}NULL};") - endforeach(cipher) +get_property(LIBS TARGET ciphers PROPERTY FASTD_LINK_LIBRARIES) +target_link_libraries(ciphers ${LIBS}) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ciphers.c.in ${CMAKE_CURRENT_BINARY_DIR}/ciphers.c) diff --git a/src/crypto/mac/CMakeLists.txt b/src/crypto/mac/CMakeLists.txt index fe13ace..ca3b71d 100644 --- a/src/crypto/mac/CMakeLists.txt +++ b/src/crypto/mac/CMakeLists.txt @@ -58,7 +58,9 @@ foreach(mac ${MACS}) endforeach(impl) set(MAC_IMPLS "${MAC_IMPLS}NULL};") - endforeach(mac) +get_property(LIBS TARGET macs PROPERTY FASTD_LINK_LIBRARIES) +target_link_libraries(macs ${LIBS}) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/macs.c.in ${CMAKE_CURRENT_BINARY_DIR}/macs.c) diff --git a/src/methods/CMakeLists.txt b/src/methods/CMakeLists.txt index 3d1e2e2..e515b32 100644 --- a/src/methods/CMakeLists.txt +++ b/src/methods/CMakeLists.txt @@ -38,4 +38,7 @@ foreach(method ${METHODS}) set(METHOD_LIST "${METHOD_LIST}\n&fastd_method_${method_},") endforeach(method) +get_property(LIBS TARGET methods PROPERTY FASTD_LINK_LIBRARIES) +target_link_libraries(methods ${LIBS}) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/methods.c.in ${CMAKE_CURRENT_BINARY_DIR}/methods.c) -- cgit v1.2.3