- Adapted CMake files for the PKCS#11 support

This commit is contained in:
Paul Bakker 2011-01-18 16:18:38 +00:00
parent d61e7d98cb
commit b06819bb5d
6 changed files with 44 additions and 9 deletions

View File

@ -11,6 +11,8 @@ if(CMAKE_BUILD_TYPE STREQUAL "Coverage")
set(CMAKE_SHARED_LINKER_FLAGS "-fprofile-arcs -ftest-coverage") set(CMAKE_SHARED_LINKER_FLAGS "-fprofile-arcs -ftest-coverage")
endif(CMAKE_BUILD_TYPE STREQUAL "Coverage") endif(CMAKE_BUILD_TYPE STREQUAL "Coverage")
option(USE_PKCS11_HELPER_LIBRARY "Build PolarSSL with the pkcs11-helper library." OFF)
include_directories(include/) include_directories(include/)
add_subdirectory(library) add_subdirectory(library)

View File

@ -20,6 +20,7 @@ set(src
md5.c md5.c
net.c net.c
padlock.c padlock.c
pkcs11.c
rsa.c rsa.c
sha1.c sha1.c
sha2.c sha2.c

View File

@ -1,11 +1,19 @@
set(libs
polarssl
)
if(USE_PKCS11_HELPER_LIBRARY)
set(libs ${libs} pkcs11-helper)
endif(USE_PKCS11_HELPER_LIBRARY)
add_executable(ssl_client1 ssl_client1.c) add_executable(ssl_client1 ssl_client1.c)
target_link_libraries(ssl_client1 polarssl) target_link_libraries(ssl_client1 ${libs})
add_executable(ssl_client2 ssl_client2.c) add_executable(ssl_client2 ssl_client2.c)
target_link_libraries(ssl_client2 polarssl) target_link_libraries(ssl_client2 ${libs})
add_executable(ssl_server ssl_server.c) add_executable(ssl_server ssl_server.c)
target_link_libraries(ssl_server polarssl) target_link_libraries(ssl_server ${libs})
INSTALL(TARGETS ssl_client1 ssl_client2 ssl_server INSTALL(TARGETS ssl_client1 ssl_client2 ssl_server
DESTINATION "bin" DESTINATION "bin"

View File

@ -1,14 +1,22 @@
set(libs
polarssl
)
if(USE_PKCS11_HELPER_LIBRARY)
set(libs ${libs} pkcs11-helper)
endif(USE_PKCS11_HELPER_LIBRARY)
add_executable(selftest selftest.c) add_executable(selftest selftest.c)
target_link_libraries(selftest polarssl) target_link_libraries(selftest ${libs})
add_executable(benchmark benchmark.c) add_executable(benchmark benchmark.c)
target_link_libraries(benchmark polarssl) target_link_libraries(benchmark ${libs})
add_executable(ssl_test ssl_test.c) add_executable(ssl_test ssl_test.c)
target_link_libraries(ssl_test polarssl) target_link_libraries(ssl_test ${libs})
add_executable(ssl_cert_test ssl_cert_test.c) add_executable(ssl_cert_test ssl_cert_test.c)
target_link_libraries(ssl_cert_test polarssl) target_link_libraries(ssl_cert_test ${libs})
INSTALL(TARGETS selftest benchmark ssl_test ssl_cert_test INSTALL(TARGETS selftest benchmark ssl_test ssl_cert_test
DESTINATION "bin" DESTINATION "bin"

View File

@ -1,5 +1,13 @@
set(libs
polarssl
)
if(USE_PKCS11_HELPER_LIBRARY)
set(libs ${libs} pkcs11-helper)
endif(USE_PKCS11_HELPER_LIBRARY)
add_executable(cert_app cert_app.c) add_executable(cert_app cert_app.c)
target_link_libraries(cert_app polarssl) target_link_libraries(cert_app ${libs})
INSTALL(TARGETS cert_app INSTALL(TARGETS cert_app
DESTINATION "bin" DESTINATION "bin"

View File

@ -1,3 +1,11 @@
set(libs
polarssl
)
if(USE_PKCS11_HELPER_LIBRARY)
set(libs ${libs} pkcs11-helper)
endif(USE_PKCS11_HELPER_LIBRARY)
function(add_test_suite suite_name) function(add_test_suite suite_name)
add_custom_command( add_custom_command(
OUTPUT test_suite_${suite_name}.c OUTPUT test_suite_${suite_name}.c
@ -7,7 +15,7 @@ function(add_test_suite suite_name)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_CURRENT_SOURCE_DIR})
add_executable(test_suite_${suite_name} test_suite_${suite_name}.c) add_executable(test_suite_${suite_name} test_suite_${suite_name}.c)
target_link_libraries(test_suite_${suite_name} polarssl) target_link_libraries(test_suite_${suite_name} ${libs})
add_test(${suite_name}-suite test_suite_${suite_name}) add_test(${suite_name}-suite test_suite_${suite_name})
endfunction(add_test_suite) endfunction(add_test_suite)