]> granicus.if.org Git - icinga2/commitdiff
Fix SysconfigFile detection for binary builds
authorMichael Friedrich <michael.friedrich@icinga.com>
Thu, 19 Apr 2018 06:49:47 +0000 (08:49 +0200)
committerMichael Friedrich <michael.friedrich@icinga.com>
Thu, 19 Apr 2018 06:55:05 +0000 (08:55 +0200)
It may happen that the variable is not properly initialized
and we'll have an empty string. Observed on macOS and inside
Docker.

refs #6215

CMakeLists.txt
etc/initsystem/CMakeLists.txt

index 56b095af8fb7487b96b3ceac8fb5be67e73ab305..c778bbfcdd65a1fb84114cc6118b6dbc0bee279f 100644 (file)
@@ -57,6 +57,11 @@ set(ICINGA2_GIT_VERSION_INFO ON CACHE BOOL "Whether to use git describe")
 set(ICINGA2_UNITY_BUILD ON CACHE BOOL "Whether to perform a unity build")
 set(ICINGA2_LTO_BUILD OFF CACHE BOOL "Whether to use LTO")
 
+if(NOT WIN32)
+  set(ICINGA2_SYSCONFIGFILE "${CMAKE_INSTALL_FULL_SYSCONFDIR}/sysconfig/icinga2" CACHE PATH "where to store configuation for the init system, defaults to /etc/sysconfig/icinga2")
+
+endif()
+
 site_name(ICINGA2_BUILD_HOST_NAME)
 set(ICINGA2_BUILD_COMPILER_NAME "${CMAKE_CXX_COMPILER_ID}")
 
index e51bb3ef54092cd3ebea56f1a0d5b7a31724c2c5..e1bebb0097650ccac9f23ab168f6d04207330c0c 100644 (file)
@@ -16,8 +16,6 @@
 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
 
 if(NOT WIN32)
-  set(ICINGA2_SYSCONFIGFILE "${CMAKE_INSTALL_FULL_SYSCONFDIR}/sysconfig/icinga2" CACHE PATH "where to store configuation for the init system, defaults to /etc/sysconfig/icinga2")
-
   configure_file(icinga2.sysconfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/initsystem/icinga2.sysconfig @ONLY)
   get_filename_component(ICINGA2_SYSCONFIGFILE_NAME ${ICINGA2_SYSCONFIGFILE} NAME)
   get_filename_component(ICINGA2_SYSCONFIGFILE_DIR ${ICINGA2_SYSCONFIGFILE} PATH)