|
From: <svn...@op...> - 2009-11-05 22:11:14
|
Author: scriptor Date: Thu Nov 5 23:11:01 2009 New Revision: 5944 URL: http://www.opensync.org/changeset/5944 Log: I have added further diagnostic messages to make it clear to the user what cmake is actually doing. Corrected TARGET_LINK_LIBRARIES for those cases, when libsasl2 can not be found. Added liblber (belongs to libldap). This is necessary according to the docs. Removed references to libgcrypt that were still left. I had removed this dependency. cmake_policy commands must be the very first ones in a CMakeLists.txt, as it seems. I have defined CPACK_SOURCE_IGNORE_FILES, as it would be reasonable. Unfortunately, cpack does not realize, that I have set CMP0010. And I don't know, either, what could be wrong in the CPACK_SOURCE_IGNORE_FILES line. As of today the LDAP plugin builds on windows 2000 using the MinGW compiler. Though, I have not run any tests, yet. Modified: plugins/ldap-sync/CMakeLists.txt plugins/ldap-sync/src/CMakeLists.txt Modified: plugins/ldap-sync/CMakeLists.txt ============================================================================== --- plugins/ldap-sync/CMakeLists.txt Thu Nov 5 23:10:48 2009 (r5943) +++ plugins/ldap-sync/CMakeLists.txt Thu Nov 5 23:11:01 2009 (r5944) @@ -20,28 +20,29 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # - -PROJECT( libopensync-plugin-ldap ) - -SET( VERSION "0.40" ) -SET( CPACK_PACKAGE_VERSION "${VERSION}" ) -SET( OPENSYNC_MIN_VERSION "${VERSION}" ) - -cmake_minimum_required(VERSION 2.4) +################################################################### +# Policy commands must appear as the very first ones, as it seems. IF (COMMAND cmake_policy) cmake_policy(SET CMP0003 NEW) - cmake_policy(SET CMP0010 NEW) - MESSAGE( STATUS "Policies CMP0003 and CMP0010 have just been set to NEW." ) + cmake_policy(SET CMP0010 OLD) + cmake_policy(GET CMP0010 policy_ten) - MESSAGE( STATUS "policy_ten = \"${policy_ten}\"" ) + MESSAGE( STATUS "CMP0010 has been set to \"${policy_ten}\"" ) ELSE (COMMAND cmake_policy) MESSAGE( STATUS " Could NOT find the command \"cmake_policy\". Ignoring.") ENDIF (COMMAND cmake_policy) -# SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) -################# Making a package: ##################### -SET(CPACK_SOURCE_IGNORE_FILES "/Testing/;tags;/obsolete/;build;build_debug;svn_;/CVS/;/\\.svn/;\\.swp$;.*~;") +################### Name and version: ############################# +PROJECT( libopensync-plugin-ldap ) + +SET( VERSION "0.40" ) +SET( CPACK_PACKAGE_VERSION "${VERSION}" ) +# SET( OPENSYNC_MIN_VERSION "${VERSION}" ) + +CMAKE_MINIMUM_REQUIRED(VERSION 2.6) +# SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) + ######################################################### @@ -131,9 +132,22 @@ # Set some defaults -INCLUDE( Testing ) -INCLUDE( ShowStatus ) -INCLUDE( OpenSyncInternal ) +INCLUDE( Testing RESULT_VARIABLE TESTING_MODULE ) +IF (NOT TESTING_MODULE) + MESSAGE(STATUS " cmake/modules/Testing.cmake could NOT be found. Ignoring.") +ENDIF (NOT TESTING_MODULE) + +INCLUDE( ShowStatus RESULT_VARIABLE SHOWSTATUS_MODULE ) +IF (NOT SHOWSTATUS_MODULE) + MESSAGE(STATUS " cmake/modules/ShowStatus.cmake could NOT be found. Ignoring.") +ENDIF (NOT SHOWSTATUS_MODULE) + +INCLUDE( OpenSyncInternal RESULT_VARIABLE OPENSYNC_INTERNAL ) +IF (NOT OPENSYNC_INTERNAL) + MESSAGE(FATAL_ERROR " cmake/modules/OpenSyncInternal.cmake could NOT be found. Exiting.") +ENDIF (NOT OPENSYNC_INTERNAL) + + # Now, that CMAKE_BUILD_TYPE has been corrupted by OpenSyncInternal.cmake @@ -185,27 +199,44 @@ MESSAGE(STATUS "CWD = $ENV{PWD}" ) MESSAGE(STATUS "LDAP_PLUGIN_OPENSYNC_CONFIGDIR = ${LDAP_PLUGIN_OPENSYNC_CONFIGDIR}") MESSAGE(STATUS "LDAP_PLUGIN_OPENSYNC_SCHEMASDIR = ${LDAP_PLUGIN_OPENSYNC_SCHEMASDIR}") + IF ( USE_OPENLDAP ) - MESSAGE(STATUS "libldap from openldap is to be used.") + MESSAGE (STATUS "libldap from openldap is to be used.") ELSE ( USE_OPENLDAP ) IF ( USE_MOZLDAP ) - MESSAGE(STATUS "libldap60 from Mozilla is to be used.") + MESSAGE (STATUS "libldap60 from Mozilla is to be used.") ENDIF ( USE_MOZLDAP ) ENDIF ( USE_OPENLDAP ) +IF ( LIBSASL2_FOUND ) + MESSAGE (STATUS "Strong, SASL based binds are enabled.") +ELSE ( LIBSASL2_FOUND ) + MESSAGE (STATUS "Only the \"simple\" bind method is possible. libsasl2 has NOT been found.") +ENDIF ( LIBSASL2_FOUND ) + + ##################### debugging cmake... ################################# # "cmake ... -DCMAKE_BUILD_TYPE=Whatever" sometimes does not work. # Actually, it NEVER works here...What's going on? MESSAGE(STATUS "CMAKE_BUILD_TYPE = ${CMAKE_BUILD_TYPE}" ) -SHOW_STATUS( ENABLE_UNITTESTS "Build the test suite:\t\t" ) -SHOW_STATUS( RUN_LONG_TESTS "Run rather time consuming tests, as well:" ) -SHOW_STATUS( RUN_AUTH_TESTS "Run the authentication specific tests, too:" ) + +IF(CMAKE_CROSSCOMPILING) + MESSAGE(STATUS "We are cross-compiling.") +ENDIF(CMAKE_CROSSCOMPILING) + +IF (SHOWSTATUS_MODULE) + SHOW_STATUS( ENABLE_UNITTESTS "Build the test suite:\t\t" ) + SHOW_STATUS( RUN_LONG_TESTS "Run rather time consuming tests, as well:" ) + SHOW_STATUS( RUN_AUTH_TESTS "Run the authentication specific tests, too:" ) +ENDIF (SHOWSTATUS_MODULE) + ########################################################################## ## Packaging +SET(CPACK_SOURCE_IGNORE_FILES "/Testing/;tags;/obsolete/;build;build_debug;svn_;/CVS/;/\\.svn/;\\.swp$;.*~;") OPENSYNC_PACKAGE( ${PROJECT_NAME} ${VERSION} ) # vim:tw=0:nowrap Modified: plugins/ldap-sync/src/CMakeLists.txt ============================================================================== --- plugins/ldap-sync/src/CMakeLists.txt Thu Nov 5 23:10:48 2009 (r5943) +++ plugins/ldap-sync/src/CMakeLists.txt Thu Nov 5 23:11:01 2009 (r5944) @@ -25,8 +25,12 @@ # Determine _LDAP_INCLUDE_DIRS IF ( LIBLDAP_FOUND ) - # libldap from openldap - SET ( _LDAP_INCLUDE_DIRS ${LDAP_INCLUDE_DIR} ) + # libldap and liblber from openldap + IF ( LIBLBER_FOUND ) + SET ( _LDAP_INCLUDE_DIRS ${LDAP_INCLUDE_DIR} ${LBER_INCLUDE_DIR} ) + ELSE ( LIBLBER_FOUND ) + SET ( _LDAP_INCLUDE_DIRS ${LDAP_INCLUDE_DIR} ) + ENDIF ( LIBLBER_FOUND ) ELSE ( LIBLDAP_FOUND ) IF ( LIBMOZLDAP_FOUND ) @@ -50,7 +54,11 @@ # Determine _LDAP_LIBRARY_DIRS IF ( LIBLDAP_FOUND ) - SET ( _LDAP_LIBRARY_DIRS ${LDAP_LIBRARY_DIRS} ) + IF ( LIBLBER_FOUND ) + SET ( _LDAP_LIBRARY_DIRS ${LDAP_LIBRARY_DIRS} ${LBER_LIBRARY_DIRS} ) + ELSE ( LIBLBER_FOUND ) + SET ( _LDAP_LIBRARY_DIRS ${LDAP_LIBRARY_DIRS} ) + ENDIF ( LIBLBER_FOUND ) ELSE ( LIBLDAP_FOUND ) IF ( LIBMOZLDAP_FOUND ) IF ( LIBMOZLDAP_LIBDIR ) @@ -66,7 +74,11 @@ # Determine _LDAP_LIBRARIES IF ( LIBLDAP_FOUND ) - SET ( _LDAP_LIBRARIES ${LDAP_LIBRARY} ) + IF ( LIBLBER_FOUND) + SET ( _LDAP_LIBRARIES ${LDAP_LIBRARY} ${LBER_LIBRARY} ) + ELSE ( LIBLBER_FOUND) + SET ( _LDAP_LIBRARIES ${LDAP_LIBRARY} ) + ENDIF ( LIBLBER_FOUND) ELSE ( LIBLDAP_FOUND ) IF ( LIBMOZLDAP_FOUND ) @@ -123,9 +135,13 @@ +IF (LIBSASL2_FOUND) + TARGET_LINK_LIBRARIES( ldap-sync ${OPENSYNC_LIBRARIES} ${GLIB2_LIBRARIES} ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${_LDAP_LIBRARIES} ${SASL2_LIBRARY}) +ELSE (LIBSASL2_FOUND) + TARGET_LINK_LIBRARIES( ldap-sync ${OPENSYNC_LIBRARIES} ${GLIB2_LIBRARIES} ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${_LDAP_LIBRARIES}) +ENDIF (LIBSASL2_FOUND) -TARGET_LINK_LIBRARIES( ldap-sync ${OPENSYNC_LIBRARIES} ${GLIB2_LIBRARIES} ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${_LDAP_LIBRARIES} ${GCRYPT_LIBRARY} ${SASL2_LIBRARY}) -TARGET_LINK_LIBRARIES( ldap-format ${OPENSYNC_LIBRARIES} ${GLIB2_LIBRARIES} ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${_LDAP_LIBRARIES} ${GCRYPT_LIBRARY}) +TARGET_LINK_LIBRARIES( ldap-format ${OPENSYNC_LIBRARIES} ${GLIB2_LIBRARIES} ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${_LDAP_LIBRARIES}) |