cmake: Crypto cleanup

- explicitly list files
- add OpenSSL include directory to include path
- remove unused code

Reviewed-by: Roger Meier <r.meier@siemens.com>
This commit is contained in:
Pascal Bach 2014-07-09 15:45:07 +02:00
parent ac68b49897
commit 216ecd3ec2

View File

@ -1,26 +1,35 @@
set(LIBNAME "PocoCrypto")
aux_source_directory(src SRCS)
set(SRCS
src/Cipher.cpp
src/CipherFactory.cpp
src/CipherImpl.cpp
src/CipherKey.cpp
src/CipherKeyImpl.cpp
src/CryptoStream.cpp
src/CryptoTransform.cpp
src/DigestEngine.cpp
src/OpenSSLInitializer.cpp
src/RSACipherImpl.cpp
src/RSADigestEngine.cpp
src/RSAKey.cpp
src/RSAKeyImpl.cpp
src/X509Certificate.cpp
)
add_definitions(-D_USRDLL -DCrypto_EXPORTS)
include_directories( include)
include_directories( include ${OPENSSL_INCLUDE_DIR} )
add_library( ${LIBNAME} ${LIB_MODE} ${SRCS} )
set_target_properties( ${LIBNAME} PROPERTIES VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION} )
#if(CMAKE_SYSTEM MATCHES "Windows")
# target_link_libraries( ${LIBNAME} PocoFoundation ${LIB_EAY_RELEASE} ${OPENSSL_LIBRARIES} )
#ELSE()
# target_link_libraries( ${LIBNAME} PocoFoundation ${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY} )
#ENDIF()
target_link_libraries( ${LIBNAME} PocoFoundation ${OPENSSL_LIBRARIES} )
target_link_libraries( ${LIBNAME} PocoFoundation ${OPENSSL_LIBRARIES} )
install(
DIRECTORY include/Poco
DESTINATION include
PATTERN ".svn" EXCLUDE
)
install(
TARGETS ${LIBNAME}
LIBRARY DESTINATION lib${LIB_SUFFIX}