From 8e589f3a3ad74dd4409632222c589aea7c0939a5 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 30 Apr 2014 03:40:15 +0200 Subject: Fix CMake errors on some config combinations --- src/crypto/cipher/CMakeLists.txt | 21 ++++++++++++++++++--- src/crypto/mac/CMakeLists.txt | 28 ++++++++++++++++++++++++---- 2 files changed, 42 insertions(+), 7 deletions(-) diff --git a/src/crypto/cipher/CMakeLists.txt b/src/crypto/cipher/CMakeLists.txt index a9d9abe..ff67b82 100644 --- a/src/crypto/cipher/CMakeLists.txt +++ b/src/crypto/cipher/CMakeLists.txt @@ -23,15 +23,30 @@ macro(fastd_cipher_impl cipher name) endmacro(fastd_cipher_impl) macro(fastd_cipher_impl_include_directories cipher name) - fastd_module_include_directories(cipher "${cipher} ${name}" ${ARGN}) + string(REPLACE - _ cipher_ "${cipher}") + string(TOUPPER "${cipher_}" CIPHER) + + if(WITH_CIPHER_${CIPHER}) + fastd_module_include_directories(cipher "${cipher} ${name}" ${ARGN}) + endif(WITH_CIPHER_${CIPHER}) endmacro(fastd_cipher_impl_include_directories) macro(fastd_cipher_impl_link_libraries cipher name) - fastd_module_link_libraries(cipher "${cipher} ${name}" ${ARGN}) + string(REPLACE - _ cipher_ "${cipher}") + string(TOUPPER "${cipher_}" CIPHER) + + if(WITH_CIPHER_${CIPHER}) + fastd_module_link_libraries(cipher "${cipher} ${name}" ${ARGN}) + endif(WITH_CIPHER_${CIPHER}) endmacro(fastd_cipher_impl_link_libraries) macro(fastd_cipher_impl_require cipher name) - fastd_module_require(cipher "${cipher} ${name}" ${ARGN}) + string(REPLACE - _ cipher_ "${cipher}") + string(TOUPPER "${cipher_}" CIPHER) + + if(WITH_CIPHER_${CIPHER}) + fastd_module_require(cipher "${cipher} ${name}" ${ARGN}) + endif(WITH_CIPHER_${CIPHER}) endmacro(fastd_cipher_impl_require) diff --git a/src/crypto/mac/CMakeLists.txt b/src/crypto/mac/CMakeLists.txt index 355416f..971c04b 100644 --- a/src/crypto/mac/CMakeLists.txt +++ b/src/crypto/mac/CMakeLists.txt @@ -23,19 +23,39 @@ macro(fastd_mac_impl mac name) endmacro(fastd_mac_impl) macro(fastd_mac_impl_include_directories mac name) - fastd_module_include_directories(mac "${mac} ${name}" ${ARGN}) + string(REPLACE - _ mac_ "${mac}") + string(TOUPPER "${mac_}" MAC) + + if(WITH_MAC_${MAC}) + fastd_module_include_directories(mac "${mac} ${name}" ${ARGN}) + endif(WITH_MAC_${MAC}) endmacro(fastd_mac_impl_include_directories) macro(fastd_mac_impl_link_libraries mac name) - fastd_module_link_libraries(mac "${mac} ${name}" ${ARGN}) + string(REPLACE - _ mac_ "${mac}") + string(TOUPPER "${mac_}" MAC) + + if(WITH_MAC_${MAC}) + fastd_module_link_libraries(mac "${mac} ${name}" ${ARGN}) + endif(WITH_MAC_${MAC}) endmacro(fastd_mac_impl_link_libraries) macro(fastd_mac_impl_require mac name) - fastd_module_require(mac "${mac} ${name}" ${ARGN}) + string(REPLACE - _ mac_ "${mac}") + string(TOUPPER "${mac_}" MAC) + + if(WITH_MAC_${MAC}) + fastd_module_require(mac "${mac} ${name}" ${ARGN}) + endif(WITH_MAC_${MAC}) endmacro(fastd_mac_impl_require) macro(fastd_mac_impl_compile_flags mac name source) - fastd_module_compile_flags(mac "${mac} ${name}" ${source} ${ARGN}) + string(REPLACE - _ mac_ "${mac}") + string(TOUPPER "${mac_}" MAC) + + if(WITH_MAC_${MAC}) + fastd_module_compile_flags(mac "${mac} ${name}" ${source} ${ARGN}) + endif(WITH_MAC_${MAC}) endmacro(fastd_mac_impl_compile_flags) -- cgit v1.2.3