Skip to content

Commit

Permalink
WIP: Testing CI
Browse files Browse the repository at this point in the history
  • Loading branch information
marcusburghardt committed May 28, 2024
1 parent 0056b9d commit 532d3ca
Showing 1 changed file with 20 additions and 16 deletions.
36 changes: 20 additions & 16 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ set(CMAKE_INSTALL_LIBDIR "/nowhere")
include(GNUInstallDirs)
include(CMakeDependentOption)
include(FindPythonModule)
include(SSGCommon)

# Define Version values
set(SSG_MAJOR_VERSION 0)
Expand Down Expand Up @@ -58,20 +57,6 @@ set(SSG_SHARED_REFS "${SSG_SHARED}/references")
set(SSG_SHARED_TRANSFORMS "${SSG_SHARED}/transforms")
set(SSG_UTILS_SCRIPTS "${CMAKE_SOURCE_DIR}/utils")

if(SSG_JINJA2_CACHE_ENABLED)
file(MAKE_DIRECTORY "${SSG_JINJA2_CACHE_DIR}")
if(NOT EXISTS "${SSG_JINJA2_CACHE_DIR}")
message(FATAL_ERROR "jinja2 cache dir was set to '${SSG_JINJA2_CACHE_DIR}'. This directory doesn't seem to exist and attempt to create it has failed.")
endif()
set(SSG_JINJA2_CACHE_ENABLED_BOOL "true")
else()
set(SSG_JINJA2_CACHE_ENABLED_BOOL "false")
endif()

message(STATUS "SCAP Security Guide ${SSG_VERSION}")
message(STATUS "(see ${CMAKE_SOURCE_DIR}/docs/manual/developer_guide.adoc for build instructions)")
message(STATUS "")

# Content Generation Opetions
option(SSG_ANSIBLE_PLAYBOOKS_ENABLED "If enabled, Ansible Playbooks for each profile will be built and installed." TRUE)
option(SSG_ANSIBLE_PLAYBOOKS_PER_RULE_ENABLED "If enabled, Ansible Playbooks for each rule will be built and installed." FALSE)
Expand Down Expand Up @@ -139,9 +124,13 @@ if("$ENV{PYTHONPATH}" STREQUAL "")
else()
set(ENV{PYTHONPATH} "${PROJECT_SOURCE_DIR}:$ENV{PYTHONPATH}")
endif()
message(STATUS "PYTHONPATH: $ENV{PYTHONPATH}")

# Required Packages
find_package(PythonInterp REQUIRED)
#find_program(PYTHON_EXECUTABLE NAMES python3 REQUIRED)
message(STATUS "Python executable: ${PYTHON_EXECUTABLE}")

find_package(OpenSCAP REQUIRED)

find_program(ANSIBLE_LINT_EXECUTABLE NAMES ansible-lint)
Expand All @@ -150,13 +139,17 @@ find_program(BATS_EXECUTABLE NAMES bats)
find_program(GIT_EXECUTABLE NAMES git)
find_program(GREP_EXECUTABLE NAMES grep)
find_program(LINKCHECKER_EXECUTABLE NAMES linkchecker)
find_program(PYTHON3_EXECUTABLE NAMES python3)

find_program(SED_EXECUTABLE NAMES sed REQUIRED)
find_program(SHELLCHECK_EXECUTABLE NAMES shellcheck)
find_program(XMLLINT_EXECUTABLE NAMES xmllint REQUIRED)
find_program(XSLTPROC_EXECUTABLE NAMES xsltproc REQUIRED)
find_program(YAMLLINT_EXECUTABLE NAMES yamllint)

message(STATUS "")
message(STATUS "SCAP Security Guide ${SSG_VERSION}")
message(STATUS "(see ${CMAKE_SOURCE_DIR}/docs/manual/developer_guide.adoc for build instructions)")

message(STATUS "")
message(STATUS "Find Python Modules:")
set(Python_ADDITIONAL_VERSIONS 3 2)
Expand Down Expand Up @@ -219,6 +212,16 @@ if(NOT SSG_THIN_DS)
set(SSG_THIN_DS_RULE_ID "off")
endif()

if(SSG_JINJA2_CACHE_ENABLED)
file(MAKE_DIRECTORY "${SSG_JINJA2_CACHE_DIR}")
if(NOT EXISTS "${SSG_JINJA2_CACHE_DIR}")
message(FATAL_ERROR "jinja2 cache dir was set to '${SSG_JINJA2_CACHE_DIR}'. This directory doesn't seem to exist and attempt to create it has failed.")
endif()
set(SSG_JINJA2_CACHE_ENABLED_BOOL "true")
else()
set(SSG_JINJA2_CACHE_ENABLED_BOOL "false")
endif()

configure_file("${CMAKE_SOURCE_DIR}/build_config.yml.in" "${CMAKE_BINARY_DIR}/build_config.yml" @ONLY)

message(STATUS " ")
Expand Down Expand Up @@ -352,6 +355,7 @@ option(ANSIBLE_CHECKS "Set to ON to enable ansible-lint and yamllint checks" OFF
enable_testing()

add_subdirectory("tests")
include(SSGCommon)

# Targets 'stats', 'profile-stats' and 'zipfile' need to be added before any product because they
# will receive dependencies from products added.
Expand Down

0 comments on commit 532d3ca

Please sign in to comment.