Rename project in CMake

TODO: to create symlinks to the old names!
This commit is contained in:
Manuel Pégourié-Gonnard 2015-01-27 15:44:46 +00:00
parent 5285970871
commit 9014b6f227
12 changed files with 65 additions and 65 deletions

View File

@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 2.6) cmake_minimum_required(VERSION 2.6)
project(POLARSSL C) project(MBEDTLS C)
string(REGEX MATCH "Clang" CMAKE_COMPILER_IS_CLANG "${CMAKE_C_COMPILER_ID}") string(REGEX MATCH "Clang" CMAKE_COMPILER_IS_CLANG "${CMAKE_C_COMPILER_ID}")
@ -98,8 +98,8 @@ if(ENABLE_TESTING)
ADD_CUSTOM_TARGET(lcov ADD_CUSTOM_TARGET(lcov
COMMAND rm -rf Coverage COMMAND rm -rf Coverage
COMMAND lcov --capture --initial --directory library/CMakeFiles/polarssl.dir -o files.info COMMAND lcov --capture --initial --directory library/CMakeFiles/mbedtls.dir -o files.info
COMMAND lcov --capture --directory library/CMakeFiles/polarssl.dir -o tests.info COMMAND lcov --capture --directory library/CMakeFiles/mbedtls.dir -o tests.info
COMMAND lcov --add-tracefile files.info --add-tracefile tests.info -o all.info COMMAND lcov --add-tracefile files.info --add-tracefile tests.info -o all.info
COMMAND lcov --remove all.info -o final.info '*.h' COMMAND lcov --remove all.info -o final.info '*.h'
COMMAND gendesc tests/Descriptions.txt -o descriptions COMMAND gendesc tests/Descriptions.txt -o descriptions

View File

@ -1,6 +1,6 @@
option(INSTALL_POLARSSL_HEADERS "Install mbed TLS headers." ON) option(INSTALL_MBEDTLS_HEADERS "Install mbed TLS headers." ON)
if(INSTALL_POLARSSL_HEADERS) if(INSTALL_MBEDTLS_HEADERS)
file(GLOB headers "polarssl/*.h") file(GLOB headers "polarssl/*.h")
@ -8,4 +8,4 @@ install(FILES ${headers}
DESTINATION include/polarssl DESTINATION include/polarssl
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ) PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
endif(INSTALL_POLARSSL_HEADERS) endif(INSTALL_MBEDTLS_HEADERS)

View File

@ -1,5 +1,5 @@
option(USE_STATIC_POLARSSL_LIBRARY "Build mbed TLS static library." ON) option(USE_STATIC_MBEDTLS_LIBRARY "Build mbed TLS static library." ON)
option(USE_SHARED_POLARSSL_LIBRARY "Build mbed TLS shared library." OFF) option(USE_SHARED_MBEDTLS_LIBRARY "Build mbed TLS shared library." OFF)
option(LINK_WITH_PTHREAD "Explicitly link mbed TLS library to pthread." OFF) option(LINK_WITH_PTHREAD "Explicitly link mbed TLS library to pthread." OFF)
set(src set(src
@ -85,51 +85,51 @@ if(CMAKE_COMPILER_IS_CLANG)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wmissing-declarations -Wmissing-prototypes -Wdocumentation -Wunreachable-code") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wmissing-declarations -Wmissing-prototypes -Wdocumentation -Wunreachable-code")
endif(CMAKE_COMPILER_IS_CLANG) endif(CMAKE_COMPILER_IS_CLANG)
if (NOT USE_STATIC_POLARSSL_LIBRARY AND NOT USE_SHARED_POLARSSL_LIBRARY) if (NOT USE_STATIC_MBEDTLS_LIBRARY AND NOT USE_SHARED_MBEDTLS_LIBRARY)
message(FATAL_ERROR "Need to choose static or shared polarssl build!") message(FATAL_ERROR "Need to choose static or shared mbedtls build!")
endif(NOT USE_STATIC_POLARSSL_LIBRARY AND NOT USE_SHARED_POLARSSL_LIBRARY) endif(NOT USE_STATIC_MBEDTLS_LIBRARY AND NOT USE_SHARED_MBEDTLS_LIBRARY)
if(USE_STATIC_POLARSSL_LIBRARY AND USE_SHARED_POLARSSL_LIBRARY) if(USE_STATIC_MBEDTLS_LIBRARY AND USE_SHARED_MBEDTLS_LIBRARY)
# if we build both static an shared, then let # if we build both static an shared, then let
# tests and programs link to the shared lib target # tests and programs link to the shared lib target
set(polarssl_static_target "polarssl_static") set(mbedtls_static_target "mbedtls_static")
elseif(USE_STATIC_POLARSSL_LIBRARY) elseif(USE_STATIC_MBEDTLS_LIBRARY)
set(polarssl_static_target "polarssl") set(mbedtls_static_target "mbedtls")
endif() endif()
if(USE_STATIC_POLARSSL_LIBRARY) if(USE_STATIC_MBEDTLS_LIBRARY)
add_library(${polarssl_static_target} STATIC ${src}) add_library(${mbedtls_static_target} STATIC ${src})
set_target_properties(${polarssl_static_target} PROPERTIES OUTPUT_NAME polarssl) set_target_properties(${mbedtls_static_target} PROPERTIES OUTPUT_NAME mbedtls)
target_link_libraries(${polarssl_static_target} ${libs}) target_link_libraries(${mbedtls_static_target} ${libs})
if(ZLIB_FOUND) if(ZLIB_FOUND)
target_link_libraries(${polarssl_static_target} ${ZLIB_LIBRARIES}) target_link_libraries(${mbedtls_static_target} ${ZLIB_LIBRARIES})
endif(ZLIB_FOUND) endif(ZLIB_FOUND)
if(LINK_WITH_PTHREAD) if(LINK_WITH_PTHREAD)
target_link_libraries(${polarssl_static_target} pthread) target_link_libraries(${mbedtls_static_target} pthread)
endif() endif()
install(TARGETS ${polarssl_static_target} install(TARGETS ${mbedtls_static_target}
DESTINATION ${LIB_INSTALL_DIR} DESTINATION ${LIB_INSTALL_DIR}
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)
endif() endif()
if(USE_SHARED_POLARSSL_LIBRARY) if(USE_SHARED_MBEDTLS_LIBRARY)
add_library(polarssl SHARED ${src}) add_library(mbedtls SHARED ${src})
set_target_properties(polarssl PROPERTIES VERSION 1.3.9 SOVERSION 7) set_target_properties(mbedtls PROPERTIES VERSION 1.3.9 SOVERSION 7)
target_link_libraries(polarssl ${libs}) target_link_libraries(mbedtls ${libs})
if(ZLIB_FOUND) if(ZLIB_FOUND)
target_link_libraries(polarssl ${ZLIB_LIBRARIES}) target_link_libraries(mbedtls ${ZLIB_LIBRARIES})
endif(ZLIB_FOUND) endif(ZLIB_FOUND)
if(LINK_WITH_PTHREAD) if(LINK_WITH_PTHREAD)
target_link_libraries(polarssl pthread) target_link_libraries(mbedtls pthread)
endif() endif()
install(TARGETS polarssl install(TARGETS mbedtls
DESTINATION ${LIB_INSTALL_DIR} DESTINATION ${LIB_INSTALL_DIR}
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)
endif(USE_SHARED_POLARSSL_LIBRARY) endif(USE_SHARED_MBEDTLS_LIBRARY)

View File

@ -1,8 +1,8 @@
add_executable(aescrypt2 aescrypt2.c) add_executable(aescrypt2 aescrypt2.c)
target_link_libraries(aescrypt2 polarssl) target_link_libraries(aescrypt2 mbedtls)
add_executable(crypt_and_hash crypt_and_hash.c) add_executable(crypt_and_hash crypt_and_hash.c)
target_link_libraries(crypt_and_hash polarssl) target_link_libraries(crypt_and_hash mbedtls)
install(TARGETS aescrypt2 crypt_and_hash install(TARGETS aescrypt2 crypt_and_hash
DESTINATION "bin" DESTINATION "bin"

View File

@ -1,17 +1,17 @@
add_executable(hello hello.c) add_executable(hello hello.c)
target_link_libraries(hello polarssl) target_link_libraries(hello mbedtls)
add_executable(generic_sum generic_sum.c) add_executable(generic_sum generic_sum.c)
target_link_libraries(generic_sum polarssl) target_link_libraries(generic_sum mbedtls)
add_executable(md5sum md5sum.c) add_executable(md5sum md5sum.c)
target_link_libraries(md5sum polarssl) target_link_libraries(md5sum mbedtls)
add_executable(sha1sum sha1sum.c) add_executable(sha1sum sha1sum.c)
target_link_libraries(sha1sum polarssl) target_link_libraries(sha1sum mbedtls)
add_executable(sha2sum sha2sum.c) add_executable(sha2sum sha2sum.c)
target_link_libraries(sha2sum polarssl) target_link_libraries(sha2sum mbedtls)
install(TARGETS hello md5sum sha1sum sha2sum generic_sum install(TARGETS hello md5sum sha1sum sha2sum generic_sum
DESTINATION "bin" DESTINATION "bin"

View File

@ -1,59 +1,59 @@
add_executable(dh_client dh_client.c) add_executable(dh_client dh_client.c)
target_link_libraries(dh_client polarssl) target_link_libraries(dh_client mbedtls)
add_executable(dh_genprime dh_genprime.c) add_executable(dh_genprime dh_genprime.c)
target_link_libraries(dh_genprime polarssl) target_link_libraries(dh_genprime mbedtls)
add_executable(dh_server dh_server.c) add_executable(dh_server dh_server.c)
target_link_libraries(dh_server polarssl) target_link_libraries(dh_server mbedtls)
add_executable(ecdsa ecdsa.c) add_executable(ecdsa ecdsa.c)
target_link_libraries(ecdsa polarssl) target_link_libraries(ecdsa mbedtls)
add_executable(gen_key gen_key.c) add_executable(gen_key gen_key.c)
target_link_libraries(gen_key polarssl) target_link_libraries(gen_key mbedtls)
add_executable(key_app key_app.c) add_executable(key_app key_app.c)
target_link_libraries(key_app polarssl) target_link_libraries(key_app mbedtls)
add_executable(key_app_writer key_app_writer.c) add_executable(key_app_writer key_app_writer.c)
target_link_libraries(key_app_writer polarssl) target_link_libraries(key_app_writer mbedtls)
add_executable(mpi_demo mpi_demo.c) add_executable(mpi_demo mpi_demo.c)
target_link_libraries(mpi_demo polarssl) target_link_libraries(mpi_demo mbedtls)
add_executable(rsa_genkey rsa_genkey.c) add_executable(rsa_genkey rsa_genkey.c)
target_link_libraries(rsa_genkey polarssl) target_link_libraries(rsa_genkey mbedtls)
add_executable(rsa_sign rsa_sign.c) add_executable(rsa_sign rsa_sign.c)
target_link_libraries(rsa_sign polarssl) target_link_libraries(rsa_sign mbedtls)
add_executable(rsa_verify rsa_verify.c) add_executable(rsa_verify rsa_verify.c)
target_link_libraries(rsa_verify polarssl) target_link_libraries(rsa_verify mbedtls)
add_executable(rsa_sign_pss rsa_sign_pss.c) add_executable(rsa_sign_pss rsa_sign_pss.c)
target_link_libraries(rsa_sign_pss polarssl) target_link_libraries(rsa_sign_pss mbedtls)
add_executable(rsa_verify_pss rsa_verify_pss.c) add_executable(rsa_verify_pss rsa_verify_pss.c)
target_link_libraries(rsa_verify_pss polarssl) target_link_libraries(rsa_verify_pss mbedtls)
add_executable(rsa_encrypt rsa_encrypt.c) add_executable(rsa_encrypt rsa_encrypt.c)
target_link_libraries(rsa_encrypt polarssl) target_link_libraries(rsa_encrypt mbedtls)
add_executable(rsa_decrypt rsa_decrypt.c) add_executable(rsa_decrypt rsa_decrypt.c)
target_link_libraries(rsa_decrypt polarssl) target_link_libraries(rsa_decrypt mbedtls)
add_executable(pk_sign pk_sign.c) add_executable(pk_sign pk_sign.c)
target_link_libraries(pk_sign polarssl) target_link_libraries(pk_sign mbedtls)
add_executable(pk_verify pk_verify.c) add_executable(pk_verify pk_verify.c)
target_link_libraries(pk_verify polarssl) target_link_libraries(pk_verify mbedtls)
add_executable(pk_encrypt pk_encrypt.c) add_executable(pk_encrypt pk_encrypt.c)
target_link_libraries(pk_encrypt polarssl) target_link_libraries(pk_encrypt mbedtls)
add_executable(pk_decrypt pk_decrypt.c) add_executable(pk_decrypt pk_decrypt.c)
target_link_libraries(pk_decrypt polarssl) target_link_libraries(pk_decrypt mbedtls)
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 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"

View File

@ -1,11 +1,11 @@
add_executable(gen_random_havege gen_random_havege.c) add_executable(gen_random_havege gen_random_havege.c)
target_link_libraries(gen_random_havege polarssl) target_link_libraries(gen_random_havege mbedtls)
add_executable(gen_random_ctr_drbg gen_random_ctr_drbg.c) add_executable(gen_random_ctr_drbg gen_random_ctr_drbg.c)
target_link_libraries(gen_random_ctr_drbg polarssl) target_link_libraries(gen_random_ctr_drbg mbedtls)
add_executable(gen_entropy gen_entropy.c) add_executable(gen_entropy gen_entropy.c)
target_link_libraries(gen_entropy polarssl) target_link_libraries(gen_entropy mbedtls)
install(TARGETS gen_random_havege gen_random_ctr_drbg gen_entropy install(TARGETS gen_random_havege gen_random_ctr_drbg gen_entropy
DESTINATION "bin" DESTINATION "bin"

View File

@ -2,7 +2,7 @@ set(THREADS_USE_PTHREADS_WIN32 true)
find_package(Threads) find_package(Threads)
set(libs set(libs
polarssl mbedtls
) )
set(targets set(targets

View File

@ -1,7 +1,7 @@
FIND_PACKAGE(OpenSSL) FIND_PACKAGE(OpenSSL)
set(libs set(libs
polarssl mbedtls
) )
if(USE_PKCS11_HELPER_LIBRARY) if(USE_PKCS11_HELPER_LIBRARY)

View File

@ -1,5 +1,5 @@
set(libs set(libs
polarssl mbedtls
) )
add_executable(strerror strerror.c) add_executable(strerror strerror.c)

View File

@ -1,5 +1,5 @@
set(libs set(libs
polarssl mbedtls
) )
if(USE_PKCS11_HELPER_LIBRARY) if(USE_PKCS11_HELPER_LIBRARY)

View File

@ -1,5 +1,5 @@
set(libs set(libs
polarssl mbedtls
) )
if(USE_PKCS11_HELPER_LIBRARY) if(USE_PKCS11_HELPER_LIBRARY)
@ -20,7 +20,7 @@ function(add_test_suite suite_name)
add_custom_command( add_custom_command(
OUTPUT test_suite_${data_name}.c OUTPUT test_suite_${data_name}.c
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/scripts/generate_code.pl ${CMAKE_CURRENT_SOURCE_DIR}/suites test_suite_${suite_name} test_suite_${data_name} COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/scripts/generate_code.pl ${CMAKE_CURRENT_SOURCE_DIR}/suites test_suite_${suite_name} test_suite_${data_name}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/scripts/generate_code.pl polarssl suites/helpers.function suites/main_test.function suites/test_suite_${suite_name}.function suites/test_suite_${data_name}.data DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/scripts/generate_code.pl mbedtls suites/helpers.function suites/main_test.function suites/test_suite_${suite_name}.function suites/test_suite_${data_name}.data
) )
include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_CURRENT_SOURCE_DIR})