From 05e6a689278d045ab44461da9a87e831098b9199 Mon Sep 17 00:00:00 2001 From: Brad Hards Date: Sun, 31 Jul 2011 11:22:09 +1000 Subject: [PATCH] buildsystem: check if we have zlib, openssl and pthread before using --- CMakeLists.txt | 4 ++++ libfreerdp-core/CMakeLists.txt | 7 ++++--- libfreerdp-utils/CMakeLists.txt | 5 ++++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 17873e5eb..0b33edc0e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,6 +51,10 @@ check_include_files(netdb.h HAVE_NETDB_H) check_include_files(fcntl.h HAVE_FCNTL_H) check_include_files(unistd.h HAVE_UNISTD_H) +# Libraries that we have a hard dependency on +find_package(OpenSSL REQUIRED) +find_package(ZLIB REQUIRED) + # Endian test_big_endian(BIG_ENDIAN) diff --git a/libfreerdp-core/CMakeLists.txt b/libfreerdp-core/CMakeLists.txt index 3608d4e8c..a49584ded 100644 --- a/libfreerdp-core/CMakeLists.txt +++ b/libfreerdp-core/CMakeLists.txt @@ -18,6 +18,8 @@ # limitations under the License. add_definitions(-DEXT_PATH="/usr/lib/freerdp/extensions") +include_directories(${OPENSSL_INCLUDE_DIR}) +include_directories(${ZLIB_INCLUDE_DIRS}) set(LIBFREERDP_CORE_SRCS activation.c @@ -80,9 +82,8 @@ set(LIBFREERDP_CORE_SRCS add_library(freerdp-core SHARED ${LIBFREERDP_CORE_SRCS}) -target_link_libraries(freerdp-core z) -target_link_libraries(freerdp-core ssl) -target_link_libraries(freerdp-core crypto) +target_link_libraries(freerdp-core ${ZLIB_LIBRARIES}) +target_link_libraries(freerdp-core ${OPENSSL_LIBRARIES}) target_link_libraries(freerdp-core freerdp-utils) install(TARGETS freerdp-core DESTINATION lib) diff --git a/libfreerdp-utils/CMakeLists.txt b/libfreerdp-utils/CMakeLists.txt index d1c08a159..23e5e6352 100644 --- a/libfreerdp-utils/CMakeLists.txt +++ b/libfreerdp-utils/CMakeLists.txt @@ -17,6 +17,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +set(CMAKE_THREAD_PREFER_PTHREAD) +find_package(Threads REQUIRED) + set(FREERDP_UTILS_SRCS args.c blob.c @@ -37,6 +40,6 @@ add_library(freerdp-utils SHARED ${FREERDP_UTILS_SRCS}) set_target_properties(freerdp-utils PROPERTIES VERSION ${FREERDP_VERSION_FULL} SOVERSION ${FREERDP_VERSION}) -target_link_libraries(freerdp-utils pthread) +target_link_libraries(freerdp-utils ${CMAKE_THREAD_LIBS_INIT}) install(TARGETS freerdp-utils DESTINATION lib)