Browse Source

cmake: Refines uninstall script and updates CMake options

- Modifies uninstall logic removing duplicate file entries when both .cfg and .cfg sample are installed

- Remove unused SCTP and duplicate fast memory statistics options in CMake
Xenofon Karamanos 9 months ago
parent
commit
394cc191e1
2 changed files with 6 additions and 8 deletions
  1. 6 4
      cmake/cmake_uninstall.cmake.in
  2. 0 4
      cmake/defs.cmake

+ 6 - 4
cmake/cmake_uninstall.cmake.in

@@ -6,10 +6,12 @@ if(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt")
 endif()
 
 file(READ "@CMAKE_BINARY_DIR@/install_manifest.txt" files)
-list(APPEND files "@CMAKE_INSTALL_PREFIX@/etc/kamailio/kamailio.cfg")
-list(APPEND files "@CMAKE_INSTALL_PREFIX@/etc/kamailio/kamctlrc")
-
 string(REGEX REPLACE "\n" ";" files "${files}")
+
+list(APPEND files "@CMAKE_INSTALL_PREFIX@/etc/@MAIN_NAME@/@[email protected]")
+list(APPEND files "@CMAKE_INSTALL_PREFIX@/etc/@MAIN_NAME@/kamctlrc")
+list(REMOVE_DUPLICATES files)
+
 foreach(file ${files})
   message(STATUS "Uninstalling $ENV{DESTDIR}${file}")
   if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
@@ -26,7 +28,7 @@ foreach(file ${files})
     if(NOT "${rm_retval}" STREQUAL 0)
       message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}")
     endif()
-  else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}")
+  else()
     message(STATUS "File $ENV{DESTDIR}${file} does not exist.")
   endif()
 endforeach()

+ 0 - 4
cmake/defs.cmake

@@ -45,7 +45,6 @@ endif()
 option(KMSTATS "Kamailio statistics" ON)
 option(FMSTATS "Fast memory statistics" ON)
 option(WITHAS "With Application server support" ON)
-option(SCTP "SCTP support" ON)
 option(RAW_SOCKS "Raw sockets support" ON)
 option(MEMPKG "Package memory or sys " ON)
 
@@ -80,7 +79,6 @@ option(USE_DST_BLOCKLIST "Use destination blacklist" ON)
 option(HAVE_RESOLV_RES "Have resolv_res" ON)
 
 option(KSR_PTHREAD_MUTEX_SHARED "Use shared mutex for TLS" ON)
-option(FMSTATS "Fast memory statistics" ON)
 option(STATISTICS "Statistics" ON)
 # if(${MEMPKG}) target_compile_definitions(common INTERFACE PKG_MALLOC) else()
 # if(${MEMDBGSYS}) target_compile_definitions(common INTERFACE DDBG_SYS_MEMORY)
@@ -271,8 +269,6 @@ if(NO_DEV_POLL)
   target_compile_definitions(common INTERFACE NO_DEV_POLL)
 endif()
 
-# if(USE_SCTP) target_compile_definitions(common INTERFACE USE_SCTP) endif()
-
 if(RAW_SOCKS)
   target_compile_definitions(common INTERFACE RAW_SOCKS)
 endif()