<commit_before>project (hpccsystems-nagios-monitoring)
cmake_minimum_required (VERSION 2.8.11)

set (HPCC_NM_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
MESSAGE ("************ Setting CMAKE_MODULE_PATH to ${HPCC_NM_SOURCE_DIR}/cmake_modules/")
set (CMAKE_MODULE_PATH "${HPCC_NM_SOURCE_DIR}/cmake_modules/")

MESSAGE ("CMAKE_MODULE_PATH is set to ${CMAKE_MODULE_PATH}")

###
## Build Level
###
if( NOT BUILD_LEVEL )
    set ( BUILD_LEVEL "COMMUNITY" )
endif()
###

option(EXEC_PREFIX "Set the execution prefix")

if (NOT LICENSE_FILE)
    set (LICENSE_FILE "LICENSE.txt")
endif()

MESSAGE ( "CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}" )


set (HPCC_SOURCE_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/..)

IF ("${HPCC_SOURCE_DIR}" STREQUAL "")
  SET (HPCC_SOURCE_DIR ${HPCC_SOURCE_ROOT_DIR}/HPCC-Platform)
ENDIF()

#MESSAGE ( "32 - CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}" )


include (${HPCC_NM_SOURCE_DIR}/version.cmake)
include (${HPCC_SOURCE_DIR}/version.cmake)
include (${HPCC_NM_SOURCE_DIR}/cmake_modules/optionDefaults.cmake)
include (${HPCC_NM_SOURCE_DIR}/cmake_modules/nmCommonSetup.cmake)
include (${HPCC_SOURCE_DIR}/version.cmake)

#MESSAGE ( "40 - CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}" )

MESSAGE ( "CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}" )

SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -frtti -fPIC -fmessage-length=0 -Wformat -Wformat-security -Wformat-nonliteral -pthread -Wuninitialized")

MESSAGE("*** START BUILDING HPCC PLATFORM ***")
MESSAGE (HPCC_SOURCE_DIR: ${HPCC_SOURCE_DIR})
ADD_SUBDIRECTORY(${HPCC_SOURCE_DIR} oss EXCLUDE_FROM_ALL)
INCLUDE(${HPCC_NM_SOURCE_DIR}/platform-version-prereq.cmake)

###
## Run file configuration to set build tag along with install lines for generated
## config files.
###
set( BUILD_TAG "${projname}_${version}-${stagever}")
if (USE_GIT_DESCRIBE OR CHECK_GIT_TAG)
    FETCH_GIT_TAG (${CMAKE_SOURCE_DIR} ${projname}_${version} GIT_BUILD_TAG)
    message ("-- Git tag is '${GIT_BUILD_TAG}'")
    if (NOT "${GIT_BUILD_TAG}" STREQUAL "${BUILD_TAG}")
        if (CHECK_GIT_TAG)
            message(FATAL_ERROR "Git tag '${GIT_BUILD_TAG}' does not match source version '${BUILD_TAG}'" )
        else()
            if(NOT "${GIT_BUILD_TAG}" STREQUAL "") # probably means being built from a tarball...
                set( BUILD_TAG "${BUILD_TAG}[${GIT_BUILD_TAG}]")
            endif()
        endif()
    endif()
endif()
message ("-- Build tag is '${BUILD_TAG}'")
if (NOT "${BASE_BUILD_TAG}" STREQUAL "")
    set(BASE_BUILD_TAG "${BUILD_TAG}")
endif()
message ("-- Base build tag is '${BASE_BUILD_TAG}'")
CONFIGURE_FILE(${HPCC_SOURCE_DIR}/build-config.h.cmake "build-config.h" )
MESSAGE("*** END BUILDING HPCC PLATFORM ***")

MESSAGE ( "CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}" )

HPCC_ADD_SUBDIRECTORY( hpcc-nagios-tools )
HPCC_ADD_SUBDIRECTORY( utils )
HPCC_ADD_SUBDIRECTORY( config )
HPCC_ADD_SUBDIRECTORY( commands )

MESSAGE (HPCC_SOURCE_DIR: ${HPCC_SOURCE_DIR})
#ADD_SUBDIRECTORY(${HPCC_SOURCE_DIR} oss EXCLUDE_FROM_ALL)

SET (VER-SEPARTOR "-")
IF ("${stagever}" MATCHES "^rc[0-9]-$")
   SET (VER_SEPARATOR "~")
ENDIF ()

SET(CPACK_PACKAGE_VERSION_MAJOR ${majorver})
SET(CPACK_PACKAGE_VERSION_MINOR ${minorver})
SET(CPACK_PACKAGE_VERSION_PATCH ${point}${VER_SEPERATOR}${stagever})


set (CPACK_PACKAGE_CONTACT "HPCCSystems <<EMAIL>>")
set (CPACK_SOURCE_GENERATOR TGZ )
set (CPACK_SYSTEM_NAME "${CMAKE_SYSTEM_NAME}-${CPACK_RPM_PACKAGE_ARCHITECTURE}")
set (CPACK_RPM_PACKAGE_VERSION "${version}" )
set (CPACK_RPM_PACKAGE_RELEASE "${stagever}")<commit_msg>HPCC-14065  Fix nagios version separator<commit_after>project (hpccsystems-nagios-monitoring)
cmake_minimum_required (VERSION 2.8.11)

set (HPCC_NM_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
MESSAGE ("************ Setting CMAKE_MODULE_PATH to ${HPCC_NM_SOURCE_DIR}/cmake_modules/")
set (CMAKE_MODULE_PATH "${HPCC_NM_SOURCE_DIR}/cmake_modules/")

MESSAGE ("CMAKE_MODULE_PATH is set to ${CMAKE_MODULE_PATH}")

###
## Build Level
###
if( NOT BUILD_LEVEL )
    set ( BUILD_LEVEL "COMMUNITY" )
endif()
###

option(EXEC_PREFIX "Set the execution prefix")

if (NOT LICENSE_FILE)
    set (LICENSE_FILE "LICENSE.txt")
endif()

MESSAGE ( "CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}" )


set (HPCC_SOURCE_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/..)

IF ("${HPCC_SOURCE_DIR}" STREQUAL "")
  SET (HPCC_SOURCE_DIR ${HPCC_SOURCE_ROOT_DIR}/HPCC-Platform)
ENDIF()

#MESSAGE ( "32 - CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}" )


include (${HPCC_NM_SOURCE_DIR}/version.cmake)
include (${HPCC_SOURCE_DIR}/version.cmake)
include (${HPCC_NM_SOURCE_DIR}/cmake_modules/optionDefaults.cmake)
include (${HPCC_NM_SOURCE_DIR}/cmake_modules/nmCommonSetup.cmake)
include (${HPCC_SOURCE_DIR}/version.cmake)

#MESSAGE ( "40 - CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}" )

MESSAGE ( "CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}" )

SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -frtti -fPIC -fmessage-length=0 -Wformat -Wformat-security -Wformat-nonliteral -pthread -Wuninitialized")

MESSAGE("*** START BUILDING HPCC PLATFORM ***")
MESSAGE (HPCC_SOURCE_DIR: ${HPCC_SOURCE_DIR})
ADD_SUBDIRECTORY(${HPCC_SOURCE_DIR} oss EXCLUDE_FROM_ALL)
INCLUDE(${HPCC_NM_SOURCE_DIR}/platform-version-prereq.cmake)

###
## Run file configuration to set build tag along with install lines for generated
## config files.
###
set( BUILD_TAG "${projname}_${version}-${stagever}")
if (USE_GIT_DESCRIBE OR CHECK_GIT_TAG)
    FETCH_GIT_TAG (${CMAKE_SOURCE_DIR} ${projname}_${version} GIT_BUILD_TAG)
    message ("-- Git tag is '${GIT_BUILD_TAG}'")
    if (NOT "${GIT_BUILD_TAG}" STREQUAL "${BUILD_TAG}")
        if (CHECK_GIT_TAG)
            message(FATAL_ERROR "Git tag '${GIT_BUILD_TAG}' does not match source version '${BUILD_TAG}'" )
        else()
            if(NOT "${GIT_BUILD_TAG}" STREQUAL "") # probably means being built from a tarball...
                set( BUILD_TAG "${BUILD_TAG}[${GIT_BUILD_TAG}]")
            endif()
        endif()
    endif()
endif()
message ("-- Build tag is '${BUILD_TAG}'")
if (NOT "${BASE_BUILD_TAG}" STREQUAL "")
    set(BASE_BUILD_TAG "${BUILD_TAG}")
endif()
message ("-- Base build tag is '${BASE_BUILD_TAG}'")
CONFIGURE_FILE(${HPCC_SOURCE_DIR}/build-config.h.cmake "build-config.h" )
MESSAGE("*** END BUILDING HPCC PLATFORM ***")

MESSAGE ( "CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}" )

HPCC_ADD_SUBDIRECTORY( hpcc-nagios-tools )
HPCC_ADD_SUBDIRECTORY( utils )
HPCC_ADD_SUBDIRECTORY( config )
HPCC_ADD_SUBDIRECTORY( commands )

MESSAGE (HPCC_SOURCE_DIR: ${HPCC_SOURCE_DIR})
#ADD_SUBDIRECTORY(${HPCC_SOURCE_DIR} oss EXCLUDE_FROM_ALL)

SET (VER_SEPARATOR "-")
IF ("${stagever}" MATCHES "^rc[0-9]-$")
   SET (VER_SEPARATOR "~")
ENDIF ()

SET(CPACK_PACKAGE_VERSION_MAJOR ${majorver})
SET(CPACK_PACKAGE_VERSION_MINOR ${minorver})
SET(CPACK_PACKAGE_VERSION_PATCH ${point}${VER_SEPARATOR}${stagever})


set (CPACK_PACKAGE_CONTACT "HPCCSystems <<EMAIL>>")
set (CPACK_SOURCE_GENERATOR TGZ )
set (CPACK_SYSTEM_NAME "${CMAKE_SYSTEM_NAME}-${CPACK_RPM_PACKAGE_ARCHITECTURE}")
set (CPACK_RPM_PACKAGE_VERSION "${version}" )
set (CPACK_RPM_PACKAGE_RELEASE "${stagever}")
{'fraction_non_alphanumeric': 0.1475877819012275, 'fraction_numerical': 0.0038538395660862117, 'mean_word_length': 6.223711340206186, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5278750', 'n_tokens_mistral': 2697, 'n_tokens_neox': 2613, 'n_words': 481}