Navigation



Ignore:
Timestamp:
Jan 17, 2011, 2:08:08 PM (13 years ago)
Author:
Sebastien Decugis <sdecugis@nict.go.jp>
Branch:
default
Phase:
public
Message:

Some more cleanups in linking

File:
1 edited

Legend:

Unmodified
Added
Removed
  • include/freeDiameter/CMakeLists.txt

    r666 r668  
    1616OPTION(ERRORS_ON_TODO "(development) Generate compilation errors on TODO items ?" OFF)
    1717
     18# Create the absolute path for searching extensions
     19SET(DEFAULT_EXTENSIONS_PATH ${CMAKE_INSTALL_PREFIX}/${INSTALL_EXTENSIONS_SUFFIX})
     20
     21
    1822MARK_AS_ADVANCED(DISABLE_SCTP DEBUG_SCTP SCTP_USE_MAPPED_ADDRESSES ERRORS_ON_TODO)
    1923
    2024########################
    21 # System checks
     25### System checks part
    2226
    2327INCLUDE (CheckLibraryExists)
     
    2832INCLUDE (TestBigEndian)
    2933
    30 # Check byte ordering
    31 TEST_BIG_ENDIAN(HOST_BIG_ENDIAN)
     34
     35### System checks -- mandatory support
    3236
    3337# We need the getopt_long function
     
    3741ENDIF (NOT HAVE_LONG_OPTIONS)
    3842
     43# getifaddrs ?
     44CHECK_FUNCTION_EXISTS (getifaddrs HAVE_GETIFADDRS)
     45IF (NOT HAVE_GETIFADDRS)
     46   MESSAGE(SEND_ERROR "The getifaddrs function is currently required by freeDiameter.")
     47ENDIF (NOT HAVE_GETIFADDRS)
     48
     49
     50### System checks -- for freeDiameter-host.h
     51
     52# Check byte ordering
     53TEST_BIG_ENDIAN(HOST_BIG_ENDIAN)
     54
    3955# Check if ntohll is provided on the system
    4056CHECK_SYMBOL_EXISTS(ntohll "" HAVE_NTOHLL)
     
    4359CHECK_INCLUDE_FILES (malloc.h HAVE_MALLOC_H)
    4460
    45 # getifaddrs ?
    46 CHECK_FUNCTION_EXISTS (getifaddrs HAVE_GETIFADDRS)
    47 IF (NOT HAVE_GETIFADDRS)
    48    MESSAGE(SEND_ERROR "The getifaddrs function is currently required by freeDiameter.")
    49 ENDIF (NOT HAVE_GETIFADDRS)
     61
     62### System checks -- for includes / link
    5063
    5164# pthreads
    5265INCLUDE(FindThreads)
     66SET(CMAKE_THREAD_LIBS_INIT ${CMAKE_THREAD_LIBS_INIT} PARENT_SCOPE)
    5367
    5468# clock_gettime
     
    6781   ENDIF (HAVE_LIBRT)
    6882ENDIF (HAVE_CLOCK_GETTIME)
    69 
    70 # LFDPROTO_LIBS = libraries required by the libfdproto.
    71 SET(LFDPROTO_LIBS ${CLOCK_GETTIME_LIBS} ${CMAKE_THREAD_LIBS_INIT} PARENT_SCOPE)
    72 
     83SET(CLOCK_GETTIME_LIBS ${CLOCK_GETTIME_LIBS} PARENT_SCOPE)
    7384
    7485# dlopen and dlclose: CMAKE_DL_LIBS
     
    95106        MESSAGE(STATUS "Disabled SCTP support.")
    96107ENDIF(NOT DISABLE_SCTP)
     108SET(SCTP_INCLUDE_DIR ${SCTP_INCLUDE_DIR} PARENT_SCOPE)
     109SET(SCTP_LIBRARIES ${SCTP_LIBRARIES} PARENT_SCOPE)
    97110
    98111
    99112# Require GNU TLS for building the library
    100113FIND_PACKAGE(GnuTLS REQUIRED)
     114SET(GNUTLS_INCLUDE_DIR ${GNUTLS_INCLUDE_DIR} PARENT_SCOPE)
     115SET(GNUTLS_LIBRARIES ${GNUTLS_LIBRARIES} PARENT_SCOPE)
    101116
    102117find_path(GCRYPT_INCLUDE_DIR NAMES gcrypt.h)
     
    105120Endif ( NOT GCRYPT_INCLUDE_DIR )
    106121MARK_AS_ADVANCED(GCRYPT_INCLUDE_DIR)
     122SET(GCRYPT_INCLUDE_DIR ${GCRYPT_INCLUDE_DIR} PARENT_SCOPE)
    107123
    108124# Also we need libgcrypt to... display its version :(
     
    113129        MESSAGE(SEND_ERROR "Unable to find libgcrypt, please install libgcrypt or equivalent")
    114130Endif ( NOT GCRYPT_LIBRARY )
     131SET(GCRYPT_LIBRARY ${GCRYPT_LIBRARY} PARENT_SCOPE)
    115132
    116133
    117 # LFDCORE_LIBS = libraries required by the libfdcore
    118 SET(LFDCORE_LIBS ${CMAKE_DL_LIBS} ${SCTP_LIBRARIES} ${GCRYPT_LIBRARY} ${GNUTLS_LIBRARIES} PARENT_SCOPE)
     134##########################
     135
     136# LFDPROTO_LIBS = libraries required by the libfdproto.
     137SET(LFDPROTO_LIBS ${CLOCK_GETTIME_LIBS} ${CMAKE_THREAD_LIBS_INIT} PARENT_SCOPE)
     138# Dependencies: the libraries required by any code linking to libfdproto.
     139SET(LFDPROTO_LINK_INTERFACES ${CMAKE_THREAD_LIBS_INIT} PARENT_SCOPE)
     140
     141# LFDCORE_LIBS = libraries required by the libfdcore (in addition to libfdproto and its dependencies)
     142SET(LFDCORE_LIBS ${CLOCK_GETTIME_LIBS} ${CMAKE_DL_LIBS} ${SCTP_LIBRARIES} ${GCRYPT_LIBRARY} ${GNUTLS_LIBRARIES} PARENT_SCOPE)
     143# And includes paths
    119144SET(LFDCORE_INCLUDES ${SCTP_INCLUDE_DIR} ${GNUTLS_INCLUDE_DIR} ${GCRYPT_INCLUDE_DIR} PARENT_SCOPE)
    120 
    121 ##########################
    122 # Create the absolute path for searching extensions
    123 SET(DEFAULT_EXTENSIONS_PATH ${CMAKE_INSTALL_PREFIX}/${INSTALL_EXTENSIONS_SUFFIX})
     145# And dependencies
     146SET(LFDCORE_LINK_INTERFACES "" PARENT_SCOPE) # We don't force any other library, the programs will link with what they needs
     147                                             # (such as libgnutls if they use GNUTLS_DEBUG() macro)
    124148
    125149##########################
Note: See TracChangeset for help on using the changeset viewer.