conversion to the cmake building system

Signed-off-by: gregory guy <g-gregory@gmx.fr>
(cherry picked from commit 6d8d495faf)
r14.0.x
gregory guy 5 years ago committed by Slávek Banko
parent 7f2250b87f
commit 90487b6cff
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -0,0 +1,84 @@
############################################
# #
# Improvements and feedbacks are welcome #
# #
# This file is released under GPL >= 3 #
# #
############################################
cmake_minimum_required( VERSION 2.8 )
#### general package setup
project( libtdeldap )
set( VERSION R14.0.6 )
#### include essential cmake modules
include( FindPkgConfig )
include( CheckFunctionExists )
include( CheckIncludeFile )
include( CheckLibraryExists )
include( CheckCSourceCompiles )
include( CheckCXXSourceCompiles )
#### include our cmake modules
set( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" )
include( TDEMacros )
##### setup install paths
include( TDESetupPaths )
tde_setup_paths( )
##### optional stuff
option( WITH_ALL_OPTIONS "Enable all optional support" OFF )
option( WITH_GCC_VISIBILITY "Enable fvisibility and fvisibility-inlines-hidden" ${WITH_ALL_OPTIONS} )
##### user requested modules
option( BUILD_ALL "Build all" ON )
option( BUILD_DOC "Build documentation" ${BUILD_ALL} )
option( BUILD_TRANSLATIONS "Build translations" ${BUILD_ALL} )
##### user defined options
set( KDE_CONFDIR "/etc/trinity" CACHE STRING "TDE Settings Directory" )
set( KRB5_FILE "/etc/krb5.conf" CACHE STRING "Kerberos config file" )
set( CRON_UPDATE_PRIMARY_REALM_CERTIFICATES_OPENLDAP_RELOAD_COMMAND "/etc/init.d/slapd force-reload" CACHE STRING "Cron command to update openLDAP" )
##### configure checks
include( ConfigureChecks.cmake )
###### global compiler settings
add_definitions( -DHAVE_CONFIG_H -UQT_NO_ASCII_CAST )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TQT_CXX_FLAGS}" )
set( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined" )
set( CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined" )
##### directories
add_subdirectory( src )
#tde_conditional_add_subdirectory( BUILD_DOC doc )
#tde_conditional_add_subdirectory( BUILD_TRANSLATIONS po )
##### write configure files
configure_file( config.h.cmake config.h @ONLY )

@ -0,0 +1,37 @@
###########################################
# #
# Improvements and feedback are welcome #
# #
# This file is released under GPL >= 3 #
# #
###########################################
# required stuff
find_package( TQt )
find_package( TDE )
tde_setup_architecture_flags( )
include(TestBigEndian)
test_big_endian(WORDS_BIGENDIAN)
##### check for gcc visibility support
if( WITH_GCC_VISIBILITY )
if( NOT UNIX )
tde_message_fatal( "gcc visibility support was requested, but your system is not *NIX" )
endif( NOT UNIX )
set( __KDE_HAVE_GCC_VISIBILITY 1 )
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden")
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden")
endif( WITH_GCC_VISIBILITY )
##### check for ldap
find_library( HAVE_LIBLDAP ldap )
if( NOT HAVE_LIBLDAP )
tde_message_fatal( "ldap is required, but was not found on your system" )
endif( NOT HAVE_LIBLDAP )

@ -0,0 +1,17 @@
#define VERSION "@VERSION@"
// Defined if you have fvisibility and fvisibility-inlines-hidden support.
#cmakedefine __KDE_HAVE_GCC_VISIBILITY 1
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
#cmakedefine WORDS_BIGENDIAN @WORDS_BIGENDIAN@
/* Define TDE Settings Directory */
#cmakedefine KDE_CONFDIR "@KDE_CONFDIR@"
/* Define Kerberos config file */
#cmakedefine KRB5_FILE "@KRB5_FILE@"
/* Define Cron command to update openLDAP certificats */
#cmakedefine CRON_UPDATE_PRIMARY_REALM_CERTIFICATES_OPENLDAP_RELOAD_COMMAND "@CRON_UPDATE_PRIMARY_REALM_CERTIFICATES_OPENLDAP_RELOAD_COMMAND@"

@ -0,0 +1,43 @@
include_directories(
${CMAKE_BINARY_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
${TDE_INCLUDE_DIR}/tde
${TDE_INCLUDE_DIR}
${TQT_INCLUDE_DIRS}
${KRB5_INCLUDE_DIRS}
)
link_directories(
${TQT_LIBRARY_DIRS}
${TDE_LIB_DIR}
)
##### tdeldap (shared)
tde_add_library( tdeldap SHARED AUTOMOC
SOURCES
libtdeldap.cpp
ldaplogindlgbase.ui
ldaplogindlg.cpp
ldappasswddlg.cpp
LINK
tdeui-shared
tdecore-shared
tdeio-shared
tdesu
lber
ldap
DESTINATION ${LIB_INSTALL_DIR}
)
##### headers
install(
FILES ldappasswddlg.h libtdeldap.h
DESTINATION ${INCLUDE_INSTALL_DIR}
)

@ -43,4 +43,4 @@ LDAPLogin::~LDAPLogin(){
//
}
// #include "ldaplogindlg.moc"
#include "ldaplogindlg.moc"

@ -50,13 +50,13 @@
#define LDAP_INSECURE_PORT 389
#define LDAP_SECURE_PORT 636
// FIXME
// Connect this to CMake/Automake
#ifndef KDE_CONFDIR
#define KDE_CONFDIR "/etc/trinity"
#endif
// FIXME
// This assumes Debian!
#ifndef KRB5_FILE
#define KRB5_FILE "/etc/krb5.conf"
#endif
#define NSSWITCH_FILE "/etc/nsswitch.conf"
@ -74,9 +74,9 @@
#define CRON_UPDATE_NSS_FILE "/etc/cron.daily/upd-local-nss-db"
#define CRON_UPDATE_NSS_COMMAND "/usr/sbin/nss_updatedb ldap"
// FIXME
// This assumes Debian!
#ifndef CRON_UPDATE_PRIMARY_REALM_CERTIFICATES_OPENLDAP_RELOAD_COMMAND
#define CRON_UPDATE_PRIMARY_REALM_CERTIFICATES_OPENLDAP_RELOAD_COMMAND "/etc/init.d/slapd force-reload"
#endif
int requested_ldap_version = LDAP_VERSION3;
char* ldap_user_and_operational_attributes[2] = {"*", "+"};

Loading…
Cancel
Save