Skip to content

Commit

Permalink
Call enable_testing if needed
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkvdb committed Oct 3, 2023
1 parent db7f5bd commit 53ea40e
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/vcpkg-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
run: sudo apt-get install nasm openssl ninja-build autoconf-archive
- name: Install osx dependencies
if: ${{ matrix.cfg.os == 'macos-latest' }}
run: brew install nasm ninja automake autoconf libtool autoconf-archive
run: brew install nasm ninja automake autoconf autoconf-archive
- name: Cache vcpkg binary
id: cache-vcpkg-bin
uses: actions/cache@v3
Expand Down
60 changes: 32 additions & 28 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,32 @@ include(CMakePackageConfigHelpers)
include(CheckIncludeFileCXX)
include(CheckCXXSourceCompiles)

option(INFRA_LOGGING "Enable logging functionality" OFF)
option(INFRA_GDAL "Enable gdal wrapper for reading gis data" OFF)
cmake_dependent_option(INFRA_EMBED_GDAL_DATA "Embed the required gdal data files in the binary" OFF "INFRA_GDAL" OFF)
option(INFRA_LICENSE_MANAGER "Enable the license management functionality" OFF)
option(INFRA_XML "Enable xml config reader" OFF)
option(INFRA_TBB "Enable the tbb functionality" OFF)
option(INFRA_NUMERIC "Enable the numeric utility classes" OFF)
option(INFRA_CHARSET "Enable the character set utility classes" OFF)
option(INFRA_PROCESS "Enable the process utility classes" OFF)
option(INFRA_DATABASE "Build the database utility classes" OFF)
option(INFRA_DATABASE_SQLITE "Build the database sqlite utility classes" OFF)
option(INFRA_DATABASE_POSTGRES "Build the database postgresql utility classes" OFF)
option(INFRA_HASHING "Build with hashing support" OFF)
option(INFRA_COMPRESSION "Build with compression support" OFF)
option(INFRA_COMPRESSION_ZSTD "Enable zstd compression support" OFF)
option(INFRA_ENABLE_TESTS "Build the unit tests" OFF)
option(INFRA_ENABLE_TEST_UTILS "Build the unit test utilities" ${INFRA_ENABLE_TESTS})
option(INFRA_ENABLE_BENCHMARKS "Build the micro benchmarks" OFF)
option(INFRA_ENABLE_DOCUMENTATION "Build the documentation" OFF)
option(INFRA_CLI_PROGRESS "Build the cli progress utility classes" OFF)
option(INFRA_UI_COMPONENTS "Enable the generic qt ui components" OFF)
option(INFRA_INSTALL_DEVELOPMENT_FILES "Install the infra development files (headers/libs)" ${INFRA_IS_TOPLEVEL})
cmake_dependent_option(INFRA_UI_COMPONENTS_XLSX_EXPORT "Enable exporing qt item models to excel" OFF "INFRA_UI_COMPONENTS" OFF)
cmake_dependent_option(INFRA_UI_COMPONENTS_QML "Qml ui components" OFF "INFRA_UI_COMPONENTS;INFRA_GDAL" OFF)
cmake_dependent_option(INFRA_UI_COMPONENTS_LOCATION "Location related qt ui components" OFF "INFRA_UI_COMPONENTS;INFRA_GDAL;INFRA_UI_COMPONENTS_QML" OFF)

string(COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}" INFRA_IS_TOPLEVEL)

if(INFRA_IS_TOPLEVEL)
Expand All @@ -12,6 +38,10 @@ if(INFRA_IS_TOPLEVEL)
set(CMAKE_CXX_STANDARD 17)
endif()

if(INFRA_ENABLE_TESTS)
enable_testing()
endif()

set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_EXPORT_COMPILE_COMMANDS 1)

Expand All @@ -21,8 +51,8 @@ if(INFRA_IS_TOPLEVEL)
)

include(GNUInstallDirs)
set (LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR})
set (EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR})
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR})
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR})

message(STATUS "Toplevel infra build C++${CMAKE_CXX_STANDARD}")
set(CMAKE_REQUIRED_FLAGS ${CMAKE_CXX17_STANDARD_COMPILE_OPTION})
Expand All @@ -40,32 +70,6 @@ if(INFRA_IS_TOPLEVEL)
endif()
endif()

option(INFRA_LOGGING "Enable logging functionality" OFF)
option(INFRA_GDAL "Enable gdal wrapper for reading gis data" OFF)
cmake_dependent_option(INFRA_EMBED_GDAL_DATA "Embed the required gdal data files in the binary" OFF "INFRA_GDAL" OFF)
option(INFRA_LICENSE_MANAGER "Enable the license management functionality" OFF)
option(INFRA_XML "Enable xml config reader" OFF)
option(INFRA_TBB "Enable the tbb functionality" OFF)
option(INFRA_NUMERIC "Enable the numeric utility classes" OFF)
option(INFRA_CHARSET "Enable the character set utility classes" OFF)
option(INFRA_PROCESS "Enable the process utility classes" OFF)
option(INFRA_DATABASE "Build the database utility classes" OFF)
option(INFRA_DATABASE_SQLITE "Build the database sqlite utility classes" OFF)
option(INFRA_DATABASE_POSTGRES "Build the database postgresql utility classes" OFF)
option(INFRA_HASHING "Build with hashing support" OFF)
option(INFRA_COMPRESSION "Build with compression support" OFF)
option(INFRA_COMPRESSION_ZSTD "Enable zstd compression support" OFF)
option(INFRA_ENABLE_TESTS "Build the unit tests" OFF)
option(INFRA_ENABLE_TEST_UTILS "Build the unit test utilities" ${INFRA_ENABLE_TESTS})
option(INFRA_ENABLE_BENCHMARKS "Build the micro benchmarks" OFF)
option(INFRA_ENABLE_DOCUMENTATION "Build the documentation" OFF)
option(INFRA_CLI_PROGRESS "Build the cli progress utility classes" OFF)
option(INFRA_UI_COMPONENTS "Enable the generic qt ui components" OFF)
option(INFRA_INSTALL_DEVELOPMENT_FILES "Install the infra development files (headers/libs)" ${INFRA_IS_TOPLEVEL})
cmake_dependent_option(INFRA_UI_COMPONENTS_XLSX_EXPORT "Enable exporing qt item models to excel" OFF "INFRA_UI_COMPONENTS" OFF)
cmake_dependent_option(INFRA_UI_COMPONENTS_QML "Qml ui components" OFF "INFRA_UI_COMPONENTS;INFRA_GDAL" OFF)
cmake_dependent_option(INFRA_UI_COMPONENTS_LOCATION "Location related qt ui components" OFF "INFRA_UI_COMPONENTS;INFRA_GDAL;INFRA_UI_COMPONENTS_QML" OFF)

check_include_file_cxx(charconv HAVE_CHARCONV_HEADER)

check_cxx_source_compiles("
Expand Down

0 comments on commit 53ea40e

Please sign in to comment.