Skip to content

Commit

Permalink
style: cmake: drop extra spaces with commands
Browse files Browse the repository at this point in the history
  • Loading branch information
maage committed May 28, 2023
1 parent 1ce00ea commit 09586f0
Show file tree
Hide file tree
Showing 36 changed files with 140 additions and 140 deletions.
80 changes: 40 additions & 40 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ endif()

project(scap-security-guide NONE)

set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake")
# This is set to silence GNUInstallDirs warning about no language being used with cmake
set(CMAKE_INSTALL_LIBDIR "/nowhere")
include(GNUInstallDirs)
include(FindPythonModule)

if ( "$ENV{PYTHONPATH}" STREQUAL "" )
if("$ENV{PYTHONPATH}" STREQUAL "")
set(ENV{PYTHONPATH} "${PROJECT_SOURCE_DIR}")
else()
set(ENV{PYTHONPATH} "${PROJECT_SOURCE_DIR}:$ENV{PYTHONPATH}")
Expand Down Expand Up @@ -114,7 +114,7 @@ message(STATUS "")

# Strictly speaking in-source will work but will be very messy, let's
# discourage our users from using them
if ("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
message(FATAL_ERROR "In-source builds are not supported! Please use out of source builds:\n"
"$ cd content\n"
"$ rm CMakeCache.txt\n"
Expand Down Expand Up @@ -151,28 +151,28 @@ cmake_dependent_option(ENABLE_PYTHON_COVERAGE "Enable Python tests with coverage

find_package(OpenSCAP REQUIRED)

if (NOT SSG_TARGET_OVAL_VERSION VERSION_EQUAL "5.11")
if(NOT SSG_TARGET_OVAL_VERSION VERSION_EQUAL "5.11")
message(WARNING "You are targetting OVAL version ${SSG_TARGET_OVAL_VERSION}. In SSG we support/test 5.11 only!")
endif()

# OCP4 requires non-standard extensions. Vanilla OpenSCAP 1.2 doesn't support
# it. See also: https://github.com/ComplianceAsCode/content/issues/6798
if ("${OSCAP_VERSION}" VERSION_LESS "1.3.4" AND SSG_PRODUCT_OCP4)
if("${OSCAP_VERSION}" VERSION_LESS "1.3.4" AND SSG_PRODUCT_OCP4)
set(SSG_PRODUCT_OCP4 OFF)
message(WARNING "Won't build OCP4 content as it requires an OpenSCAP version with OCP4 support. See also: https://github.com/ComplianceAsCode/content/issues/6798. n.b.: if 1.3.4 fails to build OCP4 content, please update to 1.3.5")
endif()

# EKS requires non-standard extensions. Vanilla OpenSCAP 1.2 doesn't support
# it. See also: https://github.com/ComplianceAsCode/content/issues/6798
if ("${OSCAP_VERSION}" VERSION_LESS "1.3.4" AND SSG_PRODUCT_EKS)
if("${OSCAP_VERSION}" VERSION_LESS "1.3.4" AND SSG_PRODUCT_EKS)
set(SSG_PRODUCT_EKS OFF)
message(WARNING "Won't build EKS content as it requires an OpenSCAP version with EKS support. See also: https://github.com/ComplianceAsCode/content/issues/6798. n.b.: if 1.3.4 fails to build EKS content, please update to 1.3.5")
endif()


if (SSG_JINJA2_CACHE_ENABLED)
if(SSG_JINJA2_CACHE_ENABLED)
file(MAKE_DIRECTORY "${SSG_JINJA2_CACHE_DIR}")
if (NOT EXISTS "${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")
Expand All @@ -181,17 +181,17 @@ else()
endif()

find_program(XSLTPROC_EXECUTABLE NAMES xsltproc)
if (NOT XSLTPROC_EXECUTABLE)
if(NOT XSLTPROC_EXECUTABLE)
message(SEND_ERROR "xsltproc is required!")
endif()

find_program(XMLLINT_EXECUTABLE NAMES xmllint)
if (NOT XMLLINT_EXECUTABLE)
if(NOT XMLLINT_EXECUTABLE)
message(SEND_ERROR "xmllint is required!")
endif()

find_program(SED_EXECUTABLE NAMES sed)
if (NOT SED_EXECUTABLE)
if(NOT SED_EXECUTABLE)
message(SEND_ERROR "sed is required!")
endif()

Expand Down Expand Up @@ -250,7 +250,7 @@ message(STATUS "Separate SCAP files: ${SSG_SEPARATE_SCAP_FILES_ENABLED}")
message(STATUS "Ansible Playbooks: ${SSG_ANSIBLE_PLAYBOOKS_ENABLED}")
message(STATUS "Ansible Playbooks Per Rule: ${SSG_ANSIBLE_PLAYBOOKS_PER_RULE_ENABLED}")
message(STATUS "Bash scripts: ${SSG_BASH_SCRIPTS_ENABLED}")
if (SSG_JINJA2_CACHE_ENABLED)
if(SSG_JINJA2_CACHE_ENABLED)
message(STATUS "jinja2 cache: enabled")
message(STATUS "jinja2 cache dir: ${SSG_JINJA2_CACHE_DIR}")
else()
Expand Down Expand Up @@ -325,89 +325,89 @@ endif()

ssg_build_man_page()

if (SSG_PRODUCT_ALINUX2)
if(SSG_PRODUCT_ALINUX2)
add_subdirectory("products/alinux2" "alinux2")
endif()
if (SSG_PRODUCT_ALINUX3)
if(SSG_PRODUCT_ALINUX3)
add_subdirectory("products/alinux3" "alinux3")
endif()
if (SSG_PRODUCT_ANOLIS8)
if(SSG_PRODUCT_ANOLIS8)
add_subdirectory("products/anolis8" "anolis8")
endif()
if (SSG_PRODUCT_CHROMIUM)
if(SSG_PRODUCT_CHROMIUM)
add_subdirectory("products/chromium" "chromium")
endif()

if (SSG_PRODUCT_DEBIAN10)
if(SSG_PRODUCT_DEBIAN10)
add_subdirectory("products/debian10" "debian10")
endif()
if (SSG_PRODUCT_DEBIAN11)
if(SSG_PRODUCT_DEBIAN11)
add_subdirectory("products/debian11" "debian11")
endif()
if (SSG_PRODUCT_EXAMPLE)
if(SSG_PRODUCT_EXAMPLE)
add_subdirectory("products/example" "example")
endif()
if (SSG_PRODUCT_EKS)
if(SSG_PRODUCT_EKS)
add_subdirectory("products/eks" "eks")
endif()
if (SSG_PRODUCT_FEDORA)
if(SSG_PRODUCT_FEDORA)
add_subdirectory("products/fedora" "fedora")
endif()
if (SSG_PRODUCT_FIREFOX)
if(SSG_PRODUCT_FIREFOX)
add_subdirectory("products/firefox" "firefox")
endif()
if (SSG_PRODUCT_MACOS1015)
if(SSG_PRODUCT_MACOS1015)
add_subdirectory("products/macos1015" "macos1015")
endif()
if (SSG_PRODUCT_OCP4)
if(SSG_PRODUCT_OCP4)
add_subdirectory("products/ocp4" "ocp4")
endif()
if (SSG_PRODUCT_RHCOS4)
if(SSG_PRODUCT_RHCOS4)
add_subdirectory("products/rhcos4" "rhcos4")
endif()
if (SSG_PRODUCT_OL7)
if(SSG_PRODUCT_OL7)
add_subdirectory("products/ol7" "ol7")
endif()
if (SSG_PRODUCT_OL8)
if(SSG_PRODUCT_OL8)
add_subdirectory("products/ol8" "ol8")
endif()
if (SSG_PRODUCT_OL9)
if(SSG_PRODUCT_OL9)
add_subdirectory("products/ol9" "ol9")
endif()
if (SSG_PRODUCT_OPENSUSE)
if(SSG_PRODUCT_OPENSUSE)
add_subdirectory("products/opensuse" "opensuse")
endif()
if (SSG_PRODUCT_RHEL7)
if(SSG_PRODUCT_RHEL7)
add_subdirectory("products/rhel7" "rhel7")
endif()
if (SSG_PRODUCT_RHEL8)
if(SSG_PRODUCT_RHEL8)
add_subdirectory("products/rhel8" "rhel8")
endif()
if (SSG_PRODUCT_RHEL9)
if(SSG_PRODUCT_RHEL9)
add_subdirectory("products/rhel9" "rhel9")
endif()
if (SSG_PRODUCT_RHV4)
if(SSG_PRODUCT_RHV4)
add_subdirectory("products/rhv4" "rhv4")
endif()
if (SSG_PRODUCT_SLE12)
if(SSG_PRODUCT_SLE12)
add_subdirectory("products/sle12" "sle12")
endif()
if (SSG_PRODUCT_SLE15)
if(SSG_PRODUCT_SLE15)
add_subdirectory("products/sle15" "sle15")
endif()
if (SSG_PRODUCT_UBUNTU1604)
if(SSG_PRODUCT_UBUNTU1604)
add_subdirectory("products/ubuntu1604" "ubuntu1604")
endif()
if (SSG_PRODUCT_UBUNTU1804)
if(SSG_PRODUCT_UBUNTU1804)
add_subdirectory("products/ubuntu1804" "ubuntu1804")
endif()
if (SSG_PRODUCT_UBUNTU2004)
if(SSG_PRODUCT_UBUNTU2004)
add_subdirectory("products/ubuntu2004" "ubuntu2004")
endif()
if (SSG_PRODUCT_UBUNTU2204)
if(SSG_PRODUCT_UBUNTU2204)
add_subdirectory("products/ubuntu2204" "ubuntu2204")
endif()
if (SSG_PRODUCT_UOS20)
if(SSG_PRODUCT_UOS20)
add_subdirectory("products/uos20" "uos20")
endif()

Expand Down
6 changes: 3 additions & 3 deletions cmake/FindOpenSCAP.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ foreach(NAME ${OPENSCAP_POSSIBLE_ROOT_DIRS})
)
endforeach()

if (NOT EXISTS "${OPENSCAP_XCCDF_XSL_1_2}")
if(NOT EXISTS "${OPENSCAP_XCCDF_XSL_1_2}")
list(APPEND OscapErrors "ERROR: The OPENSCAP XSL XCCDF file was not found. Please specify the OPENSCAP ROOT DIR with the OPENSCAP_ROOT_DIR environment variable.")
endif()

if (NOT EXISTS "${OPENSCAP_OSCAP_EXECUTABLE}")
if(NOT EXISTS "${OPENSCAP_OSCAP_EXECUTABLE}")
list(APPEND OscapErrors "ERROR: The OPENSCAP executable was not found. Please specify the OPENSCAP ROOT DIR with the OPENSCAP_ROOT_DIR environment variable.")
endif()

if (OscapErrors)
if(OscapErrors)
message(FATAL_ERROR "${OscapErrors}")
endif()

Expand Down
4 changes: 2 additions & 2 deletions cmake/GNUInstallDirs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ if(NOT DEFINED CMAKE_INSTALL_LIBDIR)
# See http://wiki.debian.org/Multiarch
if(CMAKE_SYSTEM_NAME MATCHES "Linux"
AND NOT CMAKE_CROSSCOMPILING)
if (EXISTS "/etc/debian_version") # is this a debian system ?
if(EXISTS "/etc/debian_version") # is this a debian system ?
if(CMAKE_LIBRARY_ARCHITECTURE)
set(_LIBDIR_DEFAULT "lib/${CMAKE_LIBRARY_ARCHITECTURE}")
endif()
endif()
else() # not debian, rely on CMAKE_SIZEOF_VOID_P:
if(NOT DEFINED CMAKE_SIZEOF_VOID_P)
message(AUTHOR_WARNING
Expand Down
Loading

0 comments on commit 09586f0

Please sign in to comment.