mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-03-29 08:27:02 +00:00
programs: cmake: Use list of executables
Use list of executables to: - factorize the code to define executables - highlight the similarities and differences of the executable definitions - avoid list duplication Use alphabetic order for executables in lists. Signed-off-by: Ronald Cron <ronald.cron@arm.com>
This commit is contained in:
parent
0b90c9d747
commit
bfd45f1f11
|
@ -1,9 +1,13 @@
|
||||||
add_executable(aescrypt2 aescrypt2.c)
|
set(executables
|
||||||
target_link_libraries(aescrypt2 mbedcrypto)
|
aescrypt2
|
||||||
|
crypt_and_hash
|
||||||
|
)
|
||||||
|
|
||||||
add_executable(crypt_and_hash crypt_and_hash.c)
|
foreach(exe IN LISTS executables)
|
||||||
target_link_libraries(crypt_and_hash mbedcrypto)
|
add_executable(${exe} ${exe}.c)
|
||||||
|
target_link_libraries(${exe} mbedcrypto)
|
||||||
|
endforeach()
|
||||||
|
|
||||||
install(TARGETS aescrypt2 crypt_and_hash
|
install(TARGETS ${executables}
|
||||||
DESTINATION "bin"
|
DESTINATION "bin"
|
||||||
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
||||||
|
|
|
@ -11,70 +11,41 @@ if(ENABLE_ZLIB_SUPPORT)
|
||||||
endif(ENABLE_ZLIB_SUPPORT)
|
endif(ENABLE_ZLIB_SUPPORT)
|
||||||
|
|
||||||
find_library(FUZZINGENGINE_LIB FuzzingEngine)
|
find_library(FUZZINGENGINE_LIB FuzzingEngine)
|
||||||
|
if(FUZZINGENGINE_LIB)
|
||||||
if(NOT FUZZINGENGINE_LIB)
|
|
||||||
add_executable(fuzz_x509csr fuzz_x509csr.c onefile.c)
|
|
||||||
target_link_libraries(fuzz_x509csr ${libs})
|
|
||||||
|
|
||||||
add_executable(fuzz_x509crl fuzz_x509crl.c onefile.c)
|
|
||||||
target_link_libraries(fuzz_x509crl ${libs})
|
|
||||||
|
|
||||||
add_executable(fuzz_x509crt fuzz_x509crt.c onefile.c)
|
|
||||||
target_link_libraries(fuzz_x509crt ${libs})
|
|
||||||
|
|
||||||
add_executable(fuzz_privkey fuzz_privkey.c onefile.c)
|
|
||||||
target_link_libraries(fuzz_privkey ${libs})
|
|
||||||
|
|
||||||
add_executable(fuzz_pubkey fuzz_pubkey.c onefile.c)
|
|
||||||
target_link_libraries(fuzz_pubkey ${libs})
|
|
||||||
|
|
||||||
add_executable(fuzz_client fuzz_client.c common.c onefile.c)
|
|
||||||
target_link_libraries(fuzz_client ${libs})
|
|
||||||
|
|
||||||
add_executable(fuzz_server fuzz_server.c common.c onefile.c)
|
|
||||||
target_link_libraries(fuzz_server ${libs})
|
|
||||||
|
|
||||||
add_executable(fuzz_dtlsclient fuzz_dtlsclient.c common.c onefile.c)
|
|
||||||
target_link_libraries(fuzz_dtlsclient ${libs})
|
|
||||||
|
|
||||||
add_executable(fuzz_dtlsserver fuzz_dtlsserver.c common.c onefile.c)
|
|
||||||
target_link_libraries(fuzz_dtlsserver ${libs})
|
|
||||||
else()
|
|
||||||
project(fuzz CXX)
|
project(fuzz CXX)
|
||||||
|
|
||||||
add_executable(fuzz_x509csr fuzz_x509csr.c)
|
|
||||||
target_link_libraries(fuzz_x509csr ${libs} FuzzingEngine)
|
|
||||||
SET_TARGET_PROPERTIES(fuzz_x509csr PROPERTIES LINKER_LANGUAGE CXX)
|
|
||||||
|
|
||||||
add_executable(fuzz_x509crl fuzz_x509crl.c)
|
|
||||||
target_link_libraries(fuzz_x509crl ${libs} FuzzingEngine)
|
|
||||||
SET_TARGET_PROPERTIES(fuzz_x509crl PROPERTIES LINKER_LANGUAGE CXX)
|
|
||||||
|
|
||||||
add_executable(fuzz_x509crt fuzz_x509crt.c)
|
|
||||||
target_link_libraries(fuzz_x509crt ${libs} FuzzingEngine)
|
|
||||||
SET_TARGET_PROPERTIES(fuzz_x509crt PROPERTIES LINKER_LANGUAGE CXX)
|
|
||||||
|
|
||||||
add_executable(fuzz_privkey fuzz_privkey.c)
|
|
||||||
target_link_libraries(fuzz_privkey ${libs} FuzzingEngine)
|
|
||||||
SET_TARGET_PROPERTIES(fuzz_privkey PROPERTIES LINKER_LANGUAGE CXX)
|
|
||||||
|
|
||||||
add_executable(fuzz_pubkey fuzz_pubkey.c)
|
|
||||||
target_link_libraries(fuzz_pubkey ${libs} FuzzingEngine)
|
|
||||||
SET_TARGET_PROPERTIES(fuzz_pubkey PROPERTIES LINKER_LANGUAGE CXX)
|
|
||||||
|
|
||||||
add_executable(fuzz_client fuzz_client.c common.c)
|
|
||||||
target_link_libraries(fuzz_client ${libs} FuzzingEngine)
|
|
||||||
SET_TARGET_PROPERTIES(fuzz_client PROPERTIES LINKER_LANGUAGE CXX)
|
|
||||||
|
|
||||||
add_executable(fuzz_server fuzz_server.c common.c)
|
|
||||||
target_link_libraries(fuzz_server ${libs} FuzzingEngine)
|
|
||||||
SET_TARGET_PROPERTIES(fuzz_server PROPERTIES LINKER_LANGUAGE CXX)
|
|
||||||
|
|
||||||
add_executable(fuzz_dtlsclient fuzz_dtlsclient.c common.c)
|
|
||||||
target_link_libraries(fuzz_dtlsclient ${libs} FuzzingEngine)
|
|
||||||
SET_TARGET_PROPERTIES(fuzz_dtlsclient PROPERTIES LINKER_LANGUAGE CXX)
|
|
||||||
|
|
||||||
add_executable(fuzz_dtlsserver fuzz_dtlsserver.c common.c)
|
|
||||||
target_link_libraries(fuzz_dtlsserver ${libs} FuzzingEngine)
|
|
||||||
SET_TARGET_PROPERTIES(fuzz_dtlsserver PROPERTIES LINKER_LANGUAGE CXX)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
set(executables_no_common_c
|
||||||
|
fuzz_privkey
|
||||||
|
fuzz_pubkey
|
||||||
|
fuzz_x509crl
|
||||||
|
fuzz_x509crt
|
||||||
|
fuzz_x509csr
|
||||||
|
)
|
||||||
|
|
||||||
|
set(executables_with_common_c
|
||||||
|
fuzz_client
|
||||||
|
fuzz_dtlsclient
|
||||||
|
fuzz_dtlsserver
|
||||||
|
fuzz_server
|
||||||
|
)
|
||||||
|
|
||||||
|
foreach(exe IN LISTS executables_no_common_c executables_with_common_c)
|
||||||
|
|
||||||
|
add_executable(${exe} ${exe}.c)
|
||||||
|
|
||||||
|
if (NOT FUZZINGENGINE_LIB)
|
||||||
|
target_link_libraries(${exe} ${libs})
|
||||||
|
target_sources(${exe} PRIVATE onefile.c)
|
||||||
|
else()
|
||||||
|
target_link_libraries(${exe} ${libs} FuzzingEngine)
|
||||||
|
SET_TARGET_PROPERTIES(${exe} PROPERTIES LINKER_LANGUAGE CXX)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# 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)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
endforeach()
|
||||||
|
|
|
@ -1,9 +1,13 @@
|
||||||
add_executable(hello hello.c)
|
set(executables
|
||||||
target_link_libraries(hello mbedcrypto)
|
generic_sum
|
||||||
|
hello
|
||||||
|
)
|
||||||
|
|
||||||
add_executable(generic_sum generic_sum.c)
|
foreach(exe IN LISTS executables)
|
||||||
target_link_libraries(generic_sum mbedcrypto)
|
add_executable(${exe} ${exe}.c)
|
||||||
|
target_link_libraries(${exe} mbedcrypto)
|
||||||
|
endforeach()
|
||||||
|
|
||||||
install(TARGETS hello generic_sum
|
install(TARGETS ${executables}
|
||||||
DESTINATION "bin"
|
DESTINATION "bin"
|
||||||
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
||||||
|
|
|
@ -1,63 +1,39 @@
|
||||||
add_executable(dh_client dh_client.c)
|
set(executables_mbedtls
|
||||||
target_link_libraries(dh_client mbedtls)
|
dh_client
|
||||||
|
dh_server
|
||||||
|
)
|
||||||
|
|
||||||
add_executable(dh_genprime dh_genprime.c)
|
foreach(exe IN LISTS executables_mbedtls)
|
||||||
target_link_libraries(dh_genprime mbedcrypto)
|
add_executable(${exe} ${exe}.c)
|
||||||
|
target_link_libraries(${exe} mbedtls)
|
||||||
|
endforeach()
|
||||||
|
|
||||||
add_executable(dh_server dh_server.c)
|
set(executables_mbedcrypto
|
||||||
target_link_libraries(dh_server mbedtls)
|
dh_genprime
|
||||||
|
ecdh_curve25519
|
||||||
|
ecdsa
|
||||||
|
gen_key
|
||||||
|
key_app
|
||||||
|
key_app_writer
|
||||||
|
mpi_demo
|
||||||
|
pk_encrypt
|
||||||
|
pk_decrypt
|
||||||
|
pk_sign
|
||||||
|
pk_verify
|
||||||
|
rsa_decrypt
|
||||||
|
rsa_encrypt
|
||||||
|
rsa_genkey
|
||||||
|
rsa_sign
|
||||||
|
rsa_sign_pss
|
||||||
|
rsa_verify
|
||||||
|
rsa_verify_pss
|
||||||
|
)
|
||||||
|
|
||||||
add_executable(ecdh_curve25519 ecdh_curve25519.c)
|
foreach(exe IN LISTS executables_mbedcrypto)
|
||||||
target_link_libraries(ecdh_curve25519 mbedcrypto)
|
add_executable(${exe} ${exe}.c)
|
||||||
|
target_link_libraries(${exe} mbedcrypto)
|
||||||
|
endforeach()
|
||||||
|
|
||||||
add_executable(ecdsa ecdsa.c)
|
install(TARGETS ${executables_mbedtls} ${executables_mbedcrypto}
|
||||||
target_link_libraries(ecdsa mbedcrypto)
|
|
||||||
|
|
||||||
add_executable(gen_key gen_key.c)
|
|
||||||
target_link_libraries(gen_key mbedcrypto)
|
|
||||||
|
|
||||||
add_executable(key_app key_app.c)
|
|
||||||
target_link_libraries(key_app mbedcrypto)
|
|
||||||
|
|
||||||
add_executable(key_app_writer key_app_writer.c)
|
|
||||||
target_link_libraries(key_app_writer mbedcrypto)
|
|
||||||
|
|
||||||
add_executable(mpi_demo mpi_demo.c)
|
|
||||||
target_link_libraries(mpi_demo mbedcrypto)
|
|
||||||
|
|
||||||
add_executable(rsa_genkey rsa_genkey.c)
|
|
||||||
target_link_libraries(rsa_genkey mbedcrypto)
|
|
||||||
|
|
||||||
add_executable(rsa_sign rsa_sign.c)
|
|
||||||
target_link_libraries(rsa_sign mbedcrypto)
|
|
||||||
|
|
||||||
add_executable(rsa_verify rsa_verify.c)
|
|
||||||
target_link_libraries(rsa_verify mbedcrypto)
|
|
||||||
|
|
||||||
add_executable(rsa_sign_pss rsa_sign_pss.c)
|
|
||||||
target_link_libraries(rsa_sign_pss mbedcrypto)
|
|
||||||
|
|
||||||
add_executable(rsa_verify_pss rsa_verify_pss.c)
|
|
||||||
target_link_libraries(rsa_verify_pss mbedcrypto)
|
|
||||||
|
|
||||||
add_executable(rsa_encrypt rsa_encrypt.c)
|
|
||||||
target_link_libraries(rsa_encrypt mbedcrypto)
|
|
||||||
|
|
||||||
add_executable(rsa_decrypt rsa_decrypt.c)
|
|
||||||
target_link_libraries(rsa_decrypt mbedcrypto)
|
|
||||||
|
|
||||||
add_executable(pk_sign pk_sign.c)
|
|
||||||
target_link_libraries(pk_sign mbedcrypto)
|
|
||||||
|
|
||||||
add_executable(pk_verify pk_verify.c)
|
|
||||||
target_link_libraries(pk_verify mbedcrypto)
|
|
||||||
|
|
||||||
add_executable(pk_encrypt pk_encrypt.c)
|
|
||||||
target_link_libraries(pk_encrypt mbedcrypto)
|
|
||||||
|
|
||||||
add_executable(pk_decrypt pk_decrypt.c)
|
|
||||||
target_link_libraries(pk_decrypt mbedcrypto)
|
|
||||||
|
|
||||||
install(TARGETS dh_client dh_genprime dh_server key_app mpi_demo rsa_genkey rsa_sign rsa_verify rsa_encrypt rsa_decrypt pk_encrypt pk_decrypt pk_sign pk_verify gen_key
|
|
||||||
DESTINATION "bin"
|
DESTINATION "bin"
|
||||||
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
||||||
|
|
|
@ -1,12 +1,15 @@
|
||||||
add_executable(crypto_examples crypto_examples.c)
|
set(executables
|
||||||
target_link_libraries(crypto_examples mbedtls)
|
crypto_examples
|
||||||
|
key_ladder_demo
|
||||||
|
psa_constant_names
|
||||||
|
)
|
||||||
|
|
||||||
add_executable(key_ladder_demo key_ladder_demo.c)
|
foreach(exe IN LISTS executables)
|
||||||
target_link_libraries(key_ladder_demo mbedtls)
|
add_executable(${exe} ${exe}.c)
|
||||||
|
target_link_libraries(${exe} mbedtls)
|
||||||
|
endforeach()
|
||||||
|
|
||||||
add_executable(psa_constant_names psa_constant_names.c)
|
|
||||||
target_include_directories(psa_constant_names PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
|
target_include_directories(psa_constant_names PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
|
||||||
target_link_libraries(psa_constant_names mbedtls)
|
|
||||||
|
|
||||||
add_custom_target(
|
add_custom_target(
|
||||||
psa_constant_names_generated
|
psa_constant_names_generated
|
||||||
|
@ -15,10 +18,7 @@ add_custom_target(
|
||||||
)
|
)
|
||||||
add_dependencies(psa_constant_names psa_constant_names_generated)
|
add_dependencies(psa_constant_names psa_constant_names_generated)
|
||||||
|
|
||||||
install(TARGETS
|
install(TARGETS ${executables}
|
||||||
crypto_examples
|
|
||||||
key_ladder_demo
|
|
||||||
psa_constant_names
|
|
||||||
DESTINATION "bin"
|
DESTINATION "bin"
|
||||||
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,14 @@
|
||||||
add_executable(gen_random_havege gen_random_havege.c)
|
set(executables
|
||||||
target_link_libraries(gen_random_havege mbedcrypto)
|
gen_entropy
|
||||||
|
gen_random_ctr_drbg
|
||||||
|
gen_random_havege
|
||||||
|
)
|
||||||
|
|
||||||
add_executable(gen_random_ctr_drbg gen_random_ctr_drbg.c)
|
foreach(exe IN LISTS executables)
|
||||||
target_link_libraries(gen_random_ctr_drbg mbedcrypto)
|
add_executable(${exe} ${exe}.c)
|
||||||
|
target_link_libraries(${exe} mbedcrypto)
|
||||||
|
endforeach()
|
||||||
|
|
||||||
add_executable(gen_entropy gen_entropy.c)
|
install(TARGETS ${executables}
|
||||||
target_link_libraries(gen_entropy mbedcrypto)
|
|
||||||
|
|
||||||
install(TARGETS gen_random_havege gen_random_ctr_drbg gen_entropy
|
|
||||||
DESTINATION "bin"
|
DESTINATION "bin"
|
||||||
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
||||||
|
|
|
@ -5,7 +5,15 @@ set(libs
|
||||||
mbedtls
|
mbedtls
|
||||||
)
|
)
|
||||||
|
|
||||||
set(targets
|
if(USE_PKCS11_HELPER_LIBRARY)
|
||||||
|
set(libs ${libs} pkcs11-helper)
|
||||||
|
endif(USE_PKCS11_HELPER_LIBRARY)
|
||||||
|
|
||||||
|
if(ENABLE_ZLIB_SUPPORT)
|
||||||
|
set(libs ${libs} ${ZLIB_LIBRARIES})
|
||||||
|
endif(ENABLE_ZLIB_SUPPORT)
|
||||||
|
|
||||||
|
set(executables
|
||||||
dtls_client
|
dtls_client
|
||||||
dtls_server
|
dtls_server
|
||||||
mini_client
|
mini_client
|
||||||
|
@ -18,52 +26,20 @@ set(targets
|
||||||
ssl_server2
|
ssl_server2
|
||||||
)
|
)
|
||||||
|
|
||||||
if(USE_PKCS11_HELPER_LIBRARY)
|
foreach(exe IN LISTS executables)
|
||||||
set(libs ${libs} pkcs11-helper)
|
add_executable(${exe} ${exe}.c)
|
||||||
endif(USE_PKCS11_HELPER_LIBRARY)
|
target_link_libraries(${exe} ${libs})
|
||||||
|
endforeach()
|
||||||
|
|
||||||
if(ENABLE_ZLIB_SUPPORT)
|
|
||||||
set(libs ${libs} ${ZLIB_LIBRARIES})
|
|
||||||
endif(ENABLE_ZLIB_SUPPORT)
|
|
||||||
|
|
||||||
add_executable(dtls_client dtls_client.c)
|
|
||||||
target_link_libraries(dtls_client ${libs})
|
|
||||||
|
|
||||||
add_executable(dtls_server dtls_server.c)
|
|
||||||
target_link_libraries(dtls_server ${libs})
|
|
||||||
|
|
||||||
add_executable(mini_client mini_client.c)
|
|
||||||
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}/../test/query_config.c)
|
target_sources(ssl_client2 PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../test/query_config.c)
|
||||||
target_link_libraries(ssl_client2 ${libs})
|
|
||||||
|
|
||||||
add_executable(ssl_context_info ssl_context_info.c)
|
|
||||||
target_link_libraries(ssl_context_info ${libs})
|
|
||||||
|
|
||||||
add_executable(ssl_fork_server ssl_fork_server.c)
|
|
||||||
target_link_libraries(ssl_fork_server ${libs})
|
|
||||||
|
|
||||||
add_executable(ssl_mail_client ssl_mail_client.c)
|
|
||||||
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}/../test/query_config.c)
|
target_sources(ssl_server2 PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../test/query_config.c)
|
||||||
target_link_libraries(ssl_server2 ${libs})
|
|
||||||
|
|
||||||
if(THREADS_FOUND)
|
if(THREADS_FOUND)
|
||||||
add_executable(ssl_pthread_server ssl_pthread_server.c)
|
add_executable(ssl_pthread_server ssl_pthread_server.c)
|
||||||
target_link_libraries(ssl_pthread_server ${libs} ${CMAKE_THREAD_LIBS_INIT})
|
target_link_libraries(ssl_pthread_server ${libs} ${CMAKE_THREAD_LIBS_INIT})
|
||||||
set(targets ${targets} ssl_pthread_server)
|
list(APPEND executables ssl_pthread_server)
|
||||||
endif(THREADS_FOUND)
|
endif(THREADS_FOUND)
|
||||||
|
|
||||||
install(TARGETS ${targets}
|
install(TARGETS ${executables}
|
||||||
DESTINATION "bin"
|
DESTINATION "bin"
|
||||||
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
||||||
|
|
|
@ -10,27 +10,35 @@ if(ENABLE_ZLIB_SUPPORT)
|
||||||
set(libs ${libs} ${ZLIB_LIBRARIES})
|
set(libs ${libs} ${ZLIB_LIBRARIES})
|
||||||
endif(ENABLE_ZLIB_SUPPORT)
|
endif(ENABLE_ZLIB_SUPPORT)
|
||||||
|
|
||||||
add_executable(selftest selftest.c)
|
set(executables_libs
|
||||||
target_link_libraries(selftest ${libs})
|
selftest
|
||||||
|
udp_proxy
|
||||||
|
)
|
||||||
|
|
||||||
add_executable(benchmark benchmark.c)
|
set(executables_mbedcrypto
|
||||||
target_link_libraries(benchmark mbedcrypto)
|
benchmark
|
||||||
|
query_compile_time_config
|
||||||
|
zeroize
|
||||||
|
)
|
||||||
|
|
||||||
if(TEST_CPP)
|
if(TEST_CPP)
|
||||||
add_executable(cpp_dummy_build cpp_dummy_build.cpp)
|
list(APPEND executables_mbedcrypto cpp_dummy_build)
|
||||||
target_link_libraries(cpp_dummy_build mbedcrypto)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_executable(udp_proxy udp_proxy.c)
|
foreach(exe IN LISTS executables_libs executables_mbedcrypto)
|
||||||
target_link_libraries(udp_proxy ${libs})
|
add_executable(${exe} ${exe}.c)
|
||||||
|
|
||||||
add_executable(zeroize zeroize.c)
|
# This emulates "if ( ... IN_LIST ... )" which becomes available in CMake 3.3
|
||||||
target_link_libraries(zeroize mbedcrypto)
|
list(FIND executables_libs ${exe} exe_index)
|
||||||
|
if (${exe_index} GREATER -1)
|
||||||
|
target_link_libraries(${exe} ${libs})
|
||||||
|
else()
|
||||||
|
target_link_libraries(${exe} mbedcrypto)
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
|
||||||
add_executable(query_compile_time_config query_compile_time_config.c)
|
|
||||||
target_sources(query_compile_time_config PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/query_config.c)
|
target_sources(query_compile_time_config PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/query_config.c)
|
||||||
target_link_libraries(query_compile_time_config mbedcrypto)
|
|
||||||
|
|
||||||
install(TARGETS selftest benchmark udp_proxy query_compile_time_config
|
install(TARGETS ${executables_libs} ${executables_mbedcrypto}
|
||||||
DESTINATION "bin"
|
DESTINATION "bin"
|
||||||
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
||||||
|
|
|
@ -2,12 +2,16 @@ set(libs
|
||||||
mbedcrypto
|
mbedcrypto
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(strerror strerror.c)
|
set(executables
|
||||||
target_link_libraries(strerror ${libs})
|
pem2der
|
||||||
|
strerror
|
||||||
|
)
|
||||||
|
|
||||||
add_executable(pem2der pem2der.c)
|
foreach(exe IN LISTS executables)
|
||||||
target_link_libraries(pem2der ${libs})
|
add_executable(${exe} ${exe}.c)
|
||||||
|
target_link_libraries(${exe} ${libs})
|
||||||
|
endforeach()
|
||||||
|
|
||||||
install(TARGETS strerror pem2der
|
install(TARGETS ${executables}
|
||||||
DESTINATION "bin"
|
DESTINATION "bin"
|
||||||
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
||||||
|
|
|
@ -10,21 +10,21 @@ if(ENABLE_ZLIB_SUPPORT)
|
||||||
set(libs ${libs} ${ZLIB_LIBRARIES})
|
set(libs ${libs} ${ZLIB_LIBRARIES})
|
||||||
endif(ENABLE_ZLIB_SUPPORT)
|
endif(ENABLE_ZLIB_SUPPORT)
|
||||||
|
|
||||||
add_executable(cert_app cert_app.c)
|
set(executables
|
||||||
target_link_libraries(cert_app ${libs} mbedtls)
|
cert_app
|
||||||
|
cert_req
|
||||||
|
cert_write
|
||||||
|
crl_app
|
||||||
|
req_app
|
||||||
|
)
|
||||||
|
|
||||||
add_executable(crl_app crl_app.c)
|
foreach(exe IN LISTS executables)
|
||||||
target_link_libraries(crl_app ${libs})
|
add_executable(${exe} ${exe}.c)
|
||||||
|
target_link_libraries(${exe} ${libs})
|
||||||
|
endforeach()
|
||||||
|
|
||||||
add_executable(req_app req_app.c)
|
target_link_libraries(cert_app mbedtls)
|
||||||
target_link_libraries(req_app ${libs})
|
|
||||||
|
|
||||||
add_executable(cert_req cert_req.c)
|
install(TARGETS ${executables}
|
||||||
target_link_libraries(cert_req ${libs})
|
|
||||||
|
|
||||||
add_executable(cert_write cert_write.c)
|
|
||||||
target_link_libraries(cert_write ${libs})
|
|
||||||
|
|
||||||
install(TARGETS cert_app crl_app req_app cert_req cert_write
|
|
||||||
DESTINATION "bin"
|
DESTINATION "bin"
|
||||||
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
||||||
|
|
Loading…
Reference in a new issue