$NetBSD: patch-CMakeLists.txt,v 1.2 2021/01/17 13:22:26 wiz Exp $

Define BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT
Upstream Issue #8185, Pull Request #8192, commit 34942a35112438a91ef25ffa5f0c6c18f1999303
 
Rename VERSION to ICINGA2_VERSION to avoid name clashes on case-insensitive file systems.
Upstream Pull Request #8596

--- CMakeLists.txt.orig	2020-12-15 12:30:19.000000000 +0100
+++ CMakeLists.txt	2021-01-15 16:06:03.000000000 +0100
@@ -89,7 +89,7 @@
 set(ICINGA2_LICENSE "${ICINGA2_LICENSE_GPL}\n\n---\n\n${ICINGA2_LICENSE_ADDITIONS}")
 file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/LICENSE.txt" ${ICINGA2_LICENSE})
 
-file(STRINGS VERSION SPEC_VERSION REGEX "^Version:")
+file(STRINGS ICINGA2_VERSION SPEC_VERSION REGEX "^Version:")
 string(LENGTH "${SPEC_VERSION}" SPEC_VERSION_LENGTH)
 math(EXPR SPEC_VERSION_LENGTH "${SPEC_VERSION_LENGTH} - 9")
 string(SUBSTRING ${SPEC_VERSION} 9 ${SPEC_VERSION_LENGTH} SPEC_VERSION)
@@ -102,7 +102,7 @@
   configure_file(icinga-version.h.force ${CMAKE_CURRENT_BINARY_DIR}/icinga-version.h COPYONLY)
 else()
   if(NOT ICINGA2_GIT_VERSION_INFO OR GIT_VERSION MATCHES "-NOTFOUND$")
-    file(STRINGS VERSION SPEC_REVISION REGEX "^Revision: ")
+    file(STRINGS ICINGA2_VERSION SPEC_REVISION REGEX "^Revision: ")
     string(LENGTH "${SPEC_REVISION}" SPEC_REVISION_LENGTH)
     math(EXPR SPEC_REVISION_LENGTH "${SPEC_REVISION_LENGTH} - 10")
     string(SUBSTRING ${SPEC_REVISION} 10 ${SPEC_REVISION_LENGTH} SPEC_REVISION)
@@ -172,6 +172,9 @@
 
 add_definitions(-DBOOST_FILESYSTEM_NO_DEPRECATED)
 
+# Required for Boost v1.74+
+add_definitions(-DBOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT)
+
 link_directories(${Boost_LIBRARY_DIRS})
 include_directories(${Boost_INCLUDE_DIRS})
 
@@ -520,4 +523,4 @@
   )
 endif()
 
-include(CPack)
\ No newline at end of file
+include(CPack)
