<commit_before>cmake_minimum_required(VERSION 2.6)

project("openscap")
set(OPENSCAP_VERSION_MAJOR "1")
set(OPENSCAP_VERSION_MINOR "3")
set(OPENSCAP_VERSION_PATCH "0")
set(OPENSCAP_VERSION "${OPENSCAP_VERSION_MAJOR}.${OPENSCAP_VERSION_MINOR}.${OPENSCAP_VERSION_PATCH}")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")

if(CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
    set(NDEBUG 1)
endif()

# ---------- DEPENDENCIES

include(GNUInstallDirs)
include(FindPkgConfig)
include(CheckLibraryExists)

# ACL
#pkg_check_modules(ACL REQUIRED acl)
CHECK_LIBRARY_EXISTS(acl acl_init "" HAVE_ACL_INIT)
CHECK_LIBRARY_EXISTS(acl acl_extended_file "" HAVE_ACL_EXTENDED_FILE)

# APTPKG
find_package(AptPkg)

# BLKID
pkg_check_modules(BLKID REQUIRED blkid)
if(BLKID_FOUND)
    CHECK_LIBRARY_EXISTS(blkid blkid_get_cache "" HAVE_BLKID_GET_CACHE)
    CHECK_LIBRARY_EXISTS(blkid blkid_get_tag_value "" HAVE_BLKID_GET_TAG_VALUE)
endif()

# CAP
find_package(Cap)
if(CAP_FOUND)
	CHECK_LIBRARY_EXISTS(cap cap_get_pid "" HAVE_CAP_GET_PID)
endif()

# CURL
find_package(CURL)

# DBUS
find_package(DBus)

# DOXYGEN
find_package(Doxygen)

# EXSLT
pkg_check_modules(EXSLT REQUIRED libexslt>=0.8)

# GCONF2
find_package(GConf REQUIRED)

# LDAP
find_package(Ldap REQUIRED)

# OpenDbx
pkg_check_modules(OPENDBX REQUIRED opendbx)
CHECK_LIBRARY_EXISTS(opendbx odbx_init "" HAVE_ODBX_INIT)

# PCRE
pkg_check_modules(PCRE REQUIRED libpcre)
if(PCRE_FOUND)
    CHECK_LIBRARY_EXISTS(pcre pcre_exec "" HAVE_PCRE_EXEC)
endif()

# PERL
find_package(PerlLibs)

# POPT
pkg_check_modules(POPT REQUIRED popt)

# PROCPS
pkg_check_modules(PROCPS libprocps)
if(PROCPS_FOUND)
    CHECK_LIBRARY_EXISTS(procps dev_to_tty "" HAVE_DEV_TO_TTY)
endif()

# PYTHON
find_package(PythonLibs)
find_package(PythonInterp)

# RPM
pkg_check_modules(RPM rpm>=4.4)
pkg_check_modules(RPM46 rpm>=4.6)
pkg_check_modules(RPM47 rpm>=4.7)<commit_msg>GConf and LDAP should be only optional dependencies<commit_after>cmake_minimum_required(VERSION 2.6)

project("openscap")
set(OPENSCAP_VERSION_MAJOR "1")
set(OPENSCAP_VERSION_MINOR "3")
set(OPENSCAP_VERSION_PATCH "0")
set(OPENSCAP_VERSION "${OPENSCAP_VERSION_MAJOR}.${OPENSCAP_VERSION_MINOR}.${OPENSCAP_VERSION_PATCH}")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")

if(CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
    set(NDEBUG 1)
endif()

# ---------- DEPENDENCIES

include(GNUInstallDirs)
include(FindPkgConfig)
include(CheckLibraryExists)

# ACL
#pkg_check_modules(ACL REQUIRED acl)
CHECK_LIBRARY_EXISTS(acl acl_init "" HAVE_ACL_INIT)
CHECK_LIBRARY_EXISTS(acl acl_extended_file "" HAVE_ACL_EXTENDED_FILE)

# APTPKG
find_package(AptPkg)

# BLKID
pkg_check_modules(BLKID REQUIRED blkid)
if(BLKID_FOUND)
    CHECK_LIBRARY_EXISTS(blkid blkid_get_cache "" HAVE_BLKID_GET_CACHE)
    CHECK_LIBRARY_EXISTS(blkid blkid_get_tag_value "" HAVE_BLKID_GET_TAG_VALUE)
endif()

# CAP
find_package(Cap)
if(CAP_FOUND)
	CHECK_LIBRARY_EXISTS(cap cap_get_pid "" HAVE_CAP_GET_PID)
endif()

# CURL
find_package(CURL)

# DBUS
find_package(DBus)

# DOXYGEN
find_package(Doxygen)

# EXSLT
pkg_check_modules(EXSLT REQUIRED libexslt>=0.8)

# GCONF2
find_package(GConf)

# LDAP
find_package(Ldap)

# OpenDbx
pkg_check_modules(OPENDBX REQUIRED opendbx)
CHECK_LIBRARY_EXISTS(opendbx odbx_init "" HAVE_ODBX_INIT)

# PCRE
pkg_check_modules(PCRE REQUIRED libpcre)
if(PCRE_FOUND)
    CHECK_LIBRARY_EXISTS(pcre pcre_exec "" HAVE_PCRE_EXEC)
endif()

# PERL
find_package(PerlLibs)

# POPT
pkg_check_modules(POPT REQUIRED popt)

# PROCPS
pkg_check_modules(PROCPS libprocps)
if(PROCPS_FOUND)
    CHECK_LIBRARY_EXISTS(procps dev_to_tty "" HAVE_DEV_TO_TTY)
endif()

# PYTHON
find_package(PythonLibs)
find_package(PythonInterp)

# RPM
pkg_check_modules(RPM rpm>=4.4)
pkg_check_modules(RPM46 rpm>=4.6)
pkg_check_modules(RPM47 rpm>=4.7)
{'fraction_non_alphanumeric': 0.09943618657098924, 'fraction_numerical': 0.009738595592004101, 'mean_word_length': 8.519512195121951, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '452470', 'n_tokens_mistral': 1756, 'n_tokens_neox': 1648, 'n_words': 234}