cmake: Remove build system support for Qt4/KDE4
[quassel.git] / src / core / CMakeLists.txt
index 42dac8f..db3337e 100644 (file)
@@ -1,9 +1,8 @@
 # Builds the core module
 
-setup_qt_variables(Network Sql Script)
-
 set(SOURCES
     abstractsqlstorage.cpp
+    authenticator.cpp
     core.cpp
     corealiasmanager.cpp
     coreapplication.cpp
@@ -13,7 +12,8 @@ set(SOURCES
     corebuffersyncer.cpp
     corebufferviewconfig.cpp
     corebufferviewmanager.cpp
-    corecoreinfo.cpp
+    coredccconfig.cpp
+    corehighlightrulemanager.cpp
     coreidentity.cpp
     coreignorelistmanager.cpp
     coreircchannel.cpp
@@ -24,79 +24,57 @@ set(SOURCES
     coresession.cpp
     coresessioneventprocessor.cpp
     coresettings.cpp
+    coretransfer.cpp
+    coretransfermanager.cpp
     coreuserinputhandler.cpp
     coreusersettings.cpp
     ctcpparser.cpp
     eventstringifier.cpp
+    identserver.cpp
     ircparser.cpp
     netsplit.cpp
     oidentdconfiggenerator.cpp
     postgresqlstorage.cpp
     sessionthread.cpp
+    sqlauthenticator.cpp
     sqlitestorage.cpp
-    storage.cpp)
+    storage.cpp
 
-set(MOC_HDRS
-    abstractsqlstorage.h
-    core.h
-    corealiasmanager.h
-    coreapplication.h
-    coreauthhandler.h
-    corebacklogmanager.h
-    corebasichandler.h
-    corebuffersyncer.h
-    corebufferviewconfig.h
-    corebufferviewmanager.h
-    corecoreinfo.h
+    # needed for automoc
     coreeventmanager.h
-    coreidentity.h
-    coreignorelistmanager.h
-    coreircchannel.h
-    coreirclisthelper.h
-    coreircuser.h
-    corenetwork.h
-    corenetworkconfig.h
-    coresession.h
-    coresessioneventprocessor.h
-    coreuserinputhandler.h
-    ctcpparser.h
-    eventstringifier.h
-    ircparser.h
-    netsplit.h
-    oidentdconfiggenerator.h
-    postgresqlstorage.h
-    sqlitestorage.h
-    storage.h
-    sessionthread.h)
+)
 
-set(HEADERS
-    coresettings.h
-    coreusersettings.h)
+set(LIBS )
 
 if(HAVE_SSL)
   set(SOURCES ${SOURCES} sslserver.cpp)
-  set(MOC_HDRS ${MOC_HDRS} sslserver.h)
   include_directories(${OPENSSL_INCLUDE_DIR})
-endif(HAVE_SSL)
+endif()
+
+if (QCA2-QT5_FOUND)
+    add_definitions(-DHAVE_QCA2)
+    include_directories(${QCA2-QT5_INCLUDE_DIR})
+    list(APPEND SOURCES cipher.cpp)
+    list(APPEND LIBS ${QCA2-QT5_LIBRARIES})
+endif()
 
-if(HAVE_QCA2)
-  set(SOURCES ${SOURCES} cipher.cpp)
-  set(HEADERS ${HEADERS} cipher.h)
-  include_directories(${QCA2_INCLUDE_DIR})
-endif(HAVE_QCA2)
+# Build with LDAP if told to do so.
+if(HAVE_LDAP)
+    include_directories(${LDAP_INCLUDE_DIR})
+    set(SOURCES ${SOURCES} ldapauthenticator.cpp)
+    set(MOC_HDRS ${MOC_HDRS} ldapauthenticator.h)
+endif(HAVE_LDAP)
 
-include_directories(${CMAKE_SOURCE_DIR}/src/common ${QUASSEL_QT_INCLUDES})
+include_directories(${CMAKE_SOURCE_DIR}/src/common)
 
-if(NOT WITH_QT5)
-  qt4_wrap_cpp(MOC ${MOC_HDRS})
-endif(NOT WITH_QT5)
+set(CORE_RCS ${CORE_RCS} ${CMAKE_CURRENT_SOURCE_DIR}/sql.qrc)
+qt5_add_resources(SOURCES ${CORE_RCS})
 
-set(CORE_RCS ${CORE_RCS} core/sql.qrc PARENT_SCOPE)
+add_library(mod_core STATIC ${SOURCES})
+qt5_use_modules(mod_core Core Network Script Sql)
 
-add_library(mod_core STATIC ${SOURCES} ${MOC} ${HEADERS})
-add_dependencies(mod_core mod_common)
-set_target_properties(mod_core PROPERTIES COMPILE_FLAGS "${QUASSEL_QT_COMPILEFLAGS}")
+target_link_libraries(mod_core mod_common ${LIBS})
 
-if(HAVE_QCA2)
-  target_link_libraries(mod_core ${QCA2_LIBRARIES})
-endif(HAVE_QCA2)
+if(HAVE_LDAP)
+    target_link_libraries(mod_core ${LDAP_LIBRARIES})
+endif(HAVE_LDAP)