cmake: Use official CMake config for QCA
[quassel.git] / src / core / CMakeLists.txt
index 6e98037..634af92 100644 (file)
@@ -12,8 +12,8 @@ set(SOURCES
     corebuffersyncer.cpp
     corebufferviewconfig.cpp
     corebufferviewmanager.cpp
-    corecoreinfo.cpp
     coredccconfig.cpp
+    corehighlightrulemanager.cpp
     coreidentity.cpp
     coreignorelistmanager.cpp
     coreircchannel.cpp
@@ -30,6 +30,7 @@ set(SOURCES
     coreusersettings.cpp
     ctcpparser.cpp
     eventstringifier.cpp
+    identserver.cpp
     ircparser.cpp
     netsplit.cpp
     oidentdconfiggenerator.cpp
@@ -50,20 +51,6 @@ if(HAVE_SSL)
   include_directories(${OPENSSL_INCLUDE_DIR})
 endif()
 
-if (QCA2_FOUND)
-    add_definitions(-DHAVE_QCA2)
-    include_directories(${QCA2_INCLUDE_DIR})
-    list(APPEND SOURCES cipher.cpp)
-    list(APPEND LIBS ${QCA2_LIBRARIES})
-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()
-
 # Build with LDAP if told to do so.
 if(HAVE_LDAP)
     include_directories(${LDAP_INCLUDE_DIR})
@@ -74,13 +61,19 @@ endif(HAVE_LDAP)
 include_directories(${CMAKE_SOURCE_DIR}/src/common)
 
 set(CORE_RCS ${CORE_RCS} ${CMAKE_CURRENT_SOURCE_DIR}/sql.qrc)
-qt_add_resources(SOURCES ${CORE_RCS})
+qt5_add_resources(SOURCES ${CORE_RCS})
 
 add_library(mod_core STATIC ${SOURCES})
-qt_use_modules(mod_core Core Network Script Sql)
+qt5_use_modules(mod_core Core Network Script Sql)
 
 target_link_libraries(mod_core mod_common ${LIBS})
 
+if (Qca-qt5_FOUND)
+    target_sources(mod_core PRIVATE cipher.cpp keyevent.cpp)
+    target_link_libraries(mod_core qca-qt5)
+    target_compile_definitions(mod_core PUBLIC -DHAVE_QCA2)
+endif()
+
 if(HAVE_LDAP)
     target_link_libraries(mod_core ${LDAP_LIBRARIES})
 endif(HAVE_LDAP)