diff options
| author | Jeff Davey <jdavey@apple.com> | 2015-08-18 13:20:19 -0600 |
|---|---|---|
| committer | Jeff Davey <jdavey@apple.com> | 2015-08-18 13:20:19 -0600 |
| commit | 5461dea7f141d78d1d0bb4c4f17be9b15680fa96 (patch) | |
| tree | 400e930cf75c4d390590a8ce0f5fe2f779124584 | |
| parent | 9aa4e1d96095c5bde62aa541a6b3aa48110cc5b0 (diff) | |
| download | portable-5461dea7f141d78d1d0bb4c4f17be9b15680fa96.tar.gz portable-5461dea7f141d78d1d0bb4c4f17be9b15680fa96.tar.bz2 portable-5461dea7f141d78d1d0bb4c4f17be9b15680fa96.zip | |
Add install targets and shared libraries to CMake
| -rw-r--r-- | CMakeLists.txt | 17 | ||||
| -rw-r--r-- | apps/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | crypto/CMakeLists.txt | 10 | ||||
| -rw-r--r-- | include/CMakeLists.txt | 5 | ||||
| -rw-r--r-- | man/CMakeLists.txt | 9 | ||||
| -rw-r--r-- | ssl/CMakeLists.txt | 14 | ||||
| -rw-r--r-- | tls/CMakeLists.txt | 9 |
7 files changed, 61 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 2734bad..5560f21 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
| @@ -6,6 +6,21 @@ project (LibreSSL) | |||
| 6 | 6 | ||
| 7 | enable_testing() | 7 | enable_testing() |
| 8 | 8 | ||
| 9 | set(SSL_MAJOR_VERSION "35") | ||
| 10 | set(SSL_MINOR_VERSION "0") | ||
| 11 | set(SSL_REVISION "0") | ||
| 12 | set(SSL_VERSION "${SSL_MAJOR_VERSION}.${SSL_MINOR_VERSION}.${SSL_REVISION}") | ||
| 13 | |||
| 14 | set(CRYPTO_MAJOR_VERSION "35") | ||
| 15 | set(CRYPTO_MINOR_VERSION "0") | ||
| 16 | set(CRYPTO_REVISION "0") | ||
| 17 | set(CRYPTO_VERSION "${CRYPTO_MAJOR_VERSION}.${CRYPTO_MINOR_VERSION}.${CRYPTO_REVISION}") | ||
| 18 | |||
| 19 | set(TLS_MAJOR_VERSION "6") | ||
| 20 | set(TLS_MINOR_VERSION "0") | ||
| 21 | set(TLS_REVISION "0") | ||
| 22 | set(TLS_VERSION "${TLS_MAJOR_VERSION}.${TLS_MINOR_VERSION}.${TLS_REVISION}") | ||
| 23 | |||
| 9 | if(CMAKE_SYSTEM_NAME MATCHES "OpenBSD") | 24 | if(CMAKE_SYSTEM_NAME MATCHES "OpenBSD") |
| 10 | add_definitions(-DHAVE_ATTRIBUTE__BOUNDED__) | 25 | add_definitions(-DHAVE_ATTRIBUTE__BOUNDED__) |
| 11 | endif() | 26 | endif() |
| @@ -147,6 +162,8 @@ add_subdirectory(crypto) | |||
| 147 | add_subdirectory(ssl) | 162 | add_subdirectory(ssl) |
| 148 | add_subdirectory(apps) | 163 | add_subdirectory(apps) |
| 149 | add_subdirectory(tls) | 164 | add_subdirectory(tls) |
| 165 | add_subdirectory(include) | ||
| 150 | if(NOT MSVC) | 166 | if(NOT MSVC) |
| 167 | add_subdirectory(man) | ||
| 151 | add_subdirectory(tests) | 168 | add_subdirectory(tests) |
| 152 | endif() | 169 | endif() |
diff --git a/apps/CMakeLists.txt b/apps/CMakeLists.txt index 370cd9c..452aabd 100644 --- a/apps/CMakeLists.txt +++ b/apps/CMakeLists.txt | |||
| @@ -77,3 +77,5 @@ endif() | |||
| 77 | 77 | ||
| 78 | add_executable(openssl ${OPENSSL_SRC}) | 78 | add_executable(openssl ${OPENSSL_SRC}) |
| 79 | target_link_libraries(openssl ${OPENSSL_LIBS}) | 79 | target_link_libraries(openssl ${OPENSSL_LIBS}) |
| 80 | |||
| 81 | install(TARGETS openssl DESTINATION bin) | ||
diff --git a/crypto/CMakeLists.txt b/crypto/CMakeLists.txt index feeeb84..fabf479 100644 --- a/crypto/CMakeLists.txt +++ b/crypto/CMakeLists.txt | |||
| @@ -638,4 +638,12 @@ if(NOT HAVE_TIMINGSAFE_MEMCMP) | |||
| 638 | set(CRYPTO_SRC ${CRYPTO_SRC} compat/timingsafe_memcmp.c) | 638 | set(CRYPTO_SRC ${CRYPTO_SRC} compat/timingsafe_memcmp.c) |
| 639 | endif() | 639 | endif() |
| 640 | 640 | ||
| 641 | add_library(crypto ${CRYPTO_SRC}) | 641 | add_library(crypto-objects OBJECT ${CRYPTO_SRC}) |
| 642 | set_property(TARGET crypto-objects PROPERTY POSITION_INDEPENDENT_CODE 1) | ||
| 643 | add_library(crypto STATIC $<TARGET_OBJECTS:crypto-objects>) | ||
| 644 | add_library(crypto-shared SHARED $<TARGET_OBJECTS:crypto-objects>) | ||
| 645 | set_target_properties(crypto-shared PROPERTIES OUTPUT_NAME crypto) | ||
| 646 | set_target_properties(crypto-shared PROPERTIES VERSION ${CRYPTO_VERSION} SOVERSION ${CRYPTO_MAJOR_VERSION}) | ||
| 647 | install(TARGETS crypto crypto-shared DESTINATION lib) | ||
| 648 | |||
| 649 | |||
diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt new file mode 100644 index 0000000..be442a0 --- /dev/null +++ b/include/CMakeLists.txt | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | install(DIRECTORY . | ||
| 2 | DESTINATION include | ||
| 3 | PATTERN "CMakeLists.txt" EXCLUDE | ||
| 4 | PATTERN "compat" EXCLUDE | ||
| 5 | PATTERN "Makefile.*" EXCLUDE) | ||
diff --git a/man/CMakeLists.txt b/man/CMakeLists.txt new file mode 100644 index 0000000..5923f58 --- /dev/null +++ b/man/CMakeLists.txt | |||
| @@ -0,0 +1,9 @@ | |||
| 1 | install(DIRECTORY . | ||
| 2 | DESTINATION share/man/man3 | ||
| 3 | FILES_MATCHING PATTERN "*.3" | ||
| 4 | ) | ||
| 5 | |||
| 6 | install(DIRECTORY . | ||
| 7 | DESTINATION share/man/man1 | ||
| 8 | FILES_MATCHING PATTERN "*.1" | ||
| 9 | ) | ||
diff --git a/ssl/CMakeLists.txt b/ssl/CMakeLists.txt index c26f2b4..9aef592 100644 --- a/ssl/CMakeLists.txt +++ b/ssl/CMakeLists.txt | |||
| @@ -4,9 +4,8 @@ include_directories( | |||
| 4 | ../include/compat | 4 | ../include/compat |
| 5 | ) | 5 | ) |
| 6 | 6 | ||
| 7 | add_library( | 7 | set( |
| 8 | ssl | 8 | SSL_SRC |
| 9 | |||
| 10 | bio_ssl.c | 9 | bio_ssl.c |
| 11 | bs_ber.c | 10 | bs_ber.c |
| 12 | bs_cbb.c | 11 | bs_cbb.c |
| @@ -51,3 +50,12 @@ add_library( | |||
| 51 | t1_reneg.c | 50 | t1_reneg.c |
| 52 | t1_srvr.c | 51 | t1_srvr.c |
| 53 | ) | 52 | ) |
| 53 | |||
| 54 | add_library(ssl-objects OBJECT ${SSL_SRC}) | ||
| 55 | set_property(TARGET ssl-objects PROPERTY POSITION_INDEPENDENT_CODE 1) | ||
| 56 | add_library(ssl STATIC $<TARGET_OBJECTS:ssl-objects>) | ||
| 57 | add_library(ssl-shared SHARED $<TARGET_OBJECTS:ssl-objects>) | ||
| 58 | set_target_properties(ssl-shared PROPERTIES OUTPUT_NAME ssl) | ||
| 59 | set_target_properties(ssl-shared PROPERTIES VERSION ${SSL_VERSION} SOVERSION ${SSL_MAJOR_VERSION}) | ||
| 60 | |||
| 61 | install(TARGETS ssl ssl-shared DESTINATION lib) | ||
diff --git a/tls/CMakeLists.txt b/tls/CMakeLists.txt index 3e61844..7c8cf21 100644 --- a/tls/CMakeLists.txt +++ b/tls/CMakeLists.txt | |||
| @@ -19,4 +19,11 @@ if(NOT HAVE_STRCASECMP) | |||
| 19 | set(TLS_SRC ${TLS_SRC} strsep.c) | 19 | set(TLS_SRC ${TLS_SRC} strsep.c) |
| 20 | endif() | 20 | endif() |
| 21 | 21 | ||
| 22 | add_library(tls ${TLS_SRC}) | 22 | add_library(tls-objects OBJECT ${TLS_SRC}) |
| 23 | set_property(TARGET tls-objects PROPERTY POSITION_INDEPENDENT_CODE 1) | ||
| 24 | add_library(tls STATIC $<TARGET_OBJECTS:tls-objects>) | ||
| 25 | add_library(tls-shared SHARED $<TARGET_OBJECTS:tls-objects>) | ||
| 26 | set_target_properties(tls-shared PROPERTIES OUTPUT_NAME tls) | ||
| 27 | set_target_properties(tls-shared PROPERTIES VERSION ${TLS_VERSION} SOVERSION ${TLS_MAJOR_VERSION}) | ||
| 28 | |||
| 29 | install(TARGETS tls tls-shared DESTINATION lib) | ||
