ldap: Remove warnings
[quassel.git] / CMakeLists.txt
index e031527..d527ee6 100644 (file)
@@ -40,13 +40,13 @@ include(QuasselMacros)
 # Options and variables that can be set on the command line
 #####################################################################
 
-# First, choose a Qt version. We support USE_QT4 and USE_QT5; if neither is set, prefer Qt4 for now
-option(USE_QT5 "Enable support for Qt5 (disables KDE integration)" OFF)
-if (USE_QT4) # takes precedence
-    set(USE_QT5 OFF)
+# First, choose a Qt version. We support USE_QT5 and USE_QT4; if neither is set, Qt5 will be used
+option(USE_QT5 "Enable support for Qt5" OFF)
+if (USE_QT5) # takes precedence
+    set(USE_QT4 OFF)
 else()
-    if (NOT USE_QT5)
-        set(USE_QT4 ON)
+    if (NOT USE_QT4)
+        set(USE_QT5 ON)
     endif()
 endif()
 
@@ -101,6 +101,9 @@ if (APPLE)
         option(WITH_NOTIFICATION_CENTER "OS X Notification Center support" ON)
         add_feature_info(WITH_NOTIFICATION_CENTER WITH_NOTIFICATION_CENTER "Use the OS X Notification Center")
     endif()
+    find_library(CARBON_LIBRARY Carbon)
+    mark_as_advanced(CARBON_LIBRARY)
+    link_libraries(${CARBON_LIBRARY})
 endif()
 
 # Always embed on Windows, OSX or for a static build; never embed when enabling KDE integration
@@ -130,6 +133,11 @@ if (LINK_EXTRA)
 endif()
 
 
+# List of authenticators and the cmake flags to build them
+# (currently that's just LDAP, but more can be added here).
+####################################################################
+option(WITH_LDAP     "Enable LDAP authentication support if present on system"  ON)
+
 # Setup CMake
 #####################################################################
 
@@ -511,6 +519,22 @@ if (CMAKE_COMPILER_IS_GNUCXX)
     string(REPLACE "-ansi" "" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
 endif()
 
+# Setup LDAP Authentication support.
+#####################################################################
+if(WITH_LDAP)
+    find_package(Ldap)
+    if(LDAP_FOUND)
+        message(STATUS "Enabling LDAP authentication support")
+        set(HAVE_LDAP true)
+        if(HAVE_LDAP)
+            add_definitions(-DHAVE_LDAP)
+        endif(HAVE_LDAP)
+    else(LDAP_FOUND)
+        message(STATUS "Disabling LDAP authentication support")
+    endif(LDAP_FOUND)
+else(WITH_LDAP)
+    message(STATUS "Not enabling LDAP authentication support")
+endif(WITH_LDAP)
 
 # Setup KDE / KDE Frameworks
 #####################################################################