From a52ec42736a5948686c59b51e1447eb187c19896 Mon Sep 17 00:00:00 2001
From: Slávek Banko <slavek.banko@axis.cz>
Date: Thu, 10 Apr 2025 16:02:55 +0200
Subject: Add CMake rules for parts that are now not used and are not ready for
 building. This is the equivalent for the existing automake rules that will be
 removed.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
---
 CMakeLists.txt                        | 11 +++++++---
 KMFIPTInterface/CMakeLists.txt        | 40 +++++++++++++++++++++++++++++++++++
 KMFIPTInterface/ConfigureChecks.cmake |  4 ++++
 KMFSysTray/CMakeLists.txt             | 40 +++++++++++++++++++++++++++++++++++
 4 files changed, 92 insertions(+), 3 deletions(-)
 create mode 100644 KMFIPTInterface/CMakeLists.txt
 create mode 100644 KMFIPTInterface/ConfigureChecks.cmake
 create mode 100644 KMFSysTray/CMakeLists.txt

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5ab5f70..33635ed 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -49,9 +49,12 @@ option( WITH_GCC_VISIBILITY "Enable fvisibility and fvisibility-inlines-hidden"
 
 ##### user requested modules
 
-option( BUILD_ALL          "Build all"           ON           )
-option( BUILD_DOC          "Build documentation" ${BUILD_ALL} )
-option( BUILD_TRANSLATIONS "Build translations"  ${BUILD_ALL} )
+option( BUILD_ALL          "Build all"             ON           )
+option( BUILD_DOC          "Build documentation"   ${BUILD_ALL} )
+option( BUILD_TRANSLATIONS "Build translations"    ${BUILD_ALL} )
+
+option( BUILD_IPTINTERFACE "Build kmfiptinterface" OFF          )
+option( BUILD_SYSTRAY      "Build kmfsystray"      OFF          )
 
 
 ##### configure checks
@@ -71,6 +74,8 @@ set( CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined"
 add_subdirectory( kmyfirewall )
 add_subdirectory( pics )
 add_subdirectory( templates )
+tde_conditional_add_subdirectory( BUILD_IPTINTERFACE KMFIPTInterface )
+tde_conditional_add_subdirectory( BUILD_SYSTRAY      KMFSysTray )
 
 
 ##### other data ################################
diff --git a/KMFIPTInterface/CMakeLists.txt b/KMFIPTInterface/CMakeLists.txt
new file mode 100644
index 0000000..43514ea
--- /dev/null
+++ b/KMFIPTInterface/CMakeLists.txt
@@ -0,0 +1,40 @@
+include_directories(
+  ${CMAKE_CURRENT_BINARY_DIR}
+  ${CMAKE_SOURCE_DIR}/kmyfirewall
+  ${CMAKE_BINARY_DIR}
+  ${TQT_INCLUDE_DIRS}
+  ${TDE_INCLUDE_DIR}
+  ${IPTC_INCLUDE_DIRS}
+)
+
+link_directories(
+  ${TQT_LIBRARY_DIRS}
+  ${TDE_LIB_DIR}
+)
+
+
+##### configure checks
+
+tde_message_fatal(
+  "KMFIPTInterface is not ready for building and probably would not be functional"
+  "after the change iptables => xtables in Linux kernel."
+)
+
+include( ConfigureChecks.cmake )
+
+
+##### kmfiptinterface (executable)
+
+tde_add_executable( kmfiptinterface AUTOMOC
+  SOURCES main.cpp kmfiptinterface.cpp iptchecker.cpp kmfiptinterface.skel
+  LINK tdeio-shared DCOP-shared ${IPTC_LIBRARIES}
+  DESTINATION ${BIN_INSTALL_DIR}
+)
+
+
+##### other data
+
+tde_create_translated_desktop(
+  SOURCE kmfiptinterface.desktop
+  DESTINATION ${SERVICES_INSTALL_DIR}
+)
diff --git a/KMFIPTInterface/ConfigureChecks.cmake b/KMFIPTInterface/ConfigureChecks.cmake
new file mode 100644
index 0000000..f253ad1
--- /dev/null
+++ b/KMFIPTInterface/ConfigureChecks.cmake
@@ -0,0 +1,4 @@
+
+##### search for iptc
+
+pkg_search_module( IPTC libip4tc )
diff --git a/KMFSysTray/CMakeLists.txt b/KMFSysTray/CMakeLists.txt
new file mode 100644
index 0000000..aee1a4d
--- /dev/null
+++ b/KMFSysTray/CMakeLists.txt
@@ -0,0 +1,40 @@
+include_directories(
+  ${CMAKE_CURRENT_BINARY_DIR}
+  ${CMAKE_SOURCE_DIR}/kmyfirewall/core
+  ${CMAKE_SOURCE_DIR}/kmyfirewall/kmfwidgets
+  ${CMAKE_BINARY_DIR}
+  ${TQT_INCLUDE_DIRS}
+  ${TDE_INCLUDE_DIR}
+)
+
+link_directories(
+  ${TQT_LIBRARY_DIRS}
+  ${TDE_LIB_DIR}
+)
+
+
+##### kmfsystray (executable)
+
+tde_message_fatal(
+  "KMFSysTray is not ready for building and probably would not be functional."
+  "It needs KMFIPTInterface which is not ready."
+)
+
+tde_add_executable( kmfsystray AUTOMOC
+  SOURCES
+    kmfsystray.cpp app.cpp mainwidget.cpp mainwidget_designer.ui
+    details.cpp details_designer.ui kmfiptwatcher.cpp main.cpp
+  LINK
+    DCOP-shared tdecore-shared tdeui-shared tdeio-shared
+    tdeparts-shared tdefx-shared tdetexteditor-shared
+    kmfcore-shared kmfwidgets-shared
+  DESTINATION ${BIN_INSTALL_DIR}
+)
+
+
+##### other data
+
+tde_create_translated_desktop(
+  SOURCE kmfsystray.desktop
+  DESTINATION ${DATA_INSTALL_DIR}/kicker/applets
+)
-- 
cgit v1.2.3

