Skip to content

Commit

Permalink
Merge branch 'develop' into trunk
Browse files Browse the repository at this point in the history
  • Loading branch information
mhekkel committed Mar 6, 2024
2 parents 81faa87 + 80352a5 commit 97855a2
Show file tree
Hide file tree
Showing 10 changed files with 152 additions and 128 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:

- name: Run Sphinx
run: |
cmake --build build --target Sphinx-libmcfp
cmake --build build --target Sphinx-mcfp
ls -l ${{ steps.strings.outputs.build-output-dir }}
ls -l ${{ steps.strings.outputs.build-output-dir }}/docs/sphinx
Expand Down
19 changes: 4 additions & 15 deletions .github/workflows/cmake-multi-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,28 +31,17 @@ jobs:
shell: bash
run: echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"

- name: Install Boost Ubuntu
- name: Install Catch2 Ubuntu
if: matrix.os == 'ubuntu-latest'
run: >
sudo apt-get update && sudo apt-get install libboost-dev
sudo apt-get update && sudo apt-get install catch2
- name: Install Boost Windows
if: matrix.os == 'windows-latest'
uses: MarkusJx/[email protected]
id: install-boost
with:
boost_version: 1.82.0
platform_version: 2019
toolset: msvc

- name: Install Boost macOS
- name: Install Catch2 macOS
if: matrix.os == 'macos-latest'
run: >
brew install boost
brew install catch2
- name: Configure CMake
env:
BOOST_ROOT: ${{ steps.install-boost.outputs.BOOST_ROOT }}
run: >
cmake -B ${{ steps.strings.outputs.build-output-dir }}
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
build
.vscode
cmake/libmcfpConfig.cmake
docs/api
docs/conf.py
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ build:
jobs:
pre_build:
- "cmake -S . -B build -DBUILD_DOCUMENTATION=ON -DBUILD_TESTING=OFF"
- "cmake --build build --target Doxygen-libmcfp"
- "cmake --build build --target Doxygen-mcfp"

# Build from the docs/ directory with Sphinx
sphinx:
Expand Down
2 changes: 1 addition & 1 deletion cmake/mcfp-config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

INCLUDE("${CMAKE_CURRENT_LIST_DIR}/mcfp-targets.cmake")

check_required_components(libmcfp)
check_required_components(mcfp)
2 changes: 0 additions & 2 deletions docs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ find_package(Doxygen REQUIRED)
find_package(Sphinx REQUIRED)

# Find all the public headers
# get_target_property(MCFP_PUBLIC_HEADER_DIR libmcfp INTERFACE_INCLUDE_DIRECTORIES)
set(MCFP_PUBLIC_HEADER_DIR ${PROJECT_SOURCE_DIR}/include/mcfp)
file(GLOB_RECURSE MCFP_PUBLIC_HEADERS ${MCFP_PUBLIC_HEADER_DIR}/*.hpp)

Expand All @@ -20,7 +19,6 @@ add_custom_command(
COMMAND ${CMAKE_COMMAND} -E make_directory ${DOXYGEN_OUTPUT_DIR})

add_custom_command(OUTPUT ${DOXYGEN_INDEX_FILE}
BYPRODUCTS ${DOXYGEN_OUTPUT_DIR}
DEPENDS ${MCFP_PUBLIC_HEADERS} ${DOXYGEN_OUTPUT_DIR} ${DOXYFILE_OUT}
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYFILE_OUT}
MAIN_DEPENDENCY ${DOXYFILE_OUT} ${DOXYFILE_IN}
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
project = 'libmcfp'
project = 'mcfp'
copyright = '2023, Maarten L. Hekkelman'
author = 'Maarten L. Hekkelman'
release = '@PROJECT_VERSION@'
Expand Down
4 changes: 2 additions & 2 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set(CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD 17 CACHE STRING "The minimum version of C++ required for this library")
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(libmcfp REQUIRED)
find_package(mcfp REQUIRED)

add_executable(example example.cpp)
target_link_libraries(example libmcfp::libmcfp)
target_link_libraries(example mcfp::mcfp)
25 changes: 22 additions & 3 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,32 @@
find_package(Boost REQUIRED)
find_package(Catch2 QUIET)

if(NOT Catch2_FOUND)
include(FetchContent)

FetchContent_Declare(
Catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
GIT_TAG v2.13.9)

FetchContent_MakeAvailable(Catch2)

set(Catch2_VERSION "2.13.9")
endif()

add_executable(mcfp-unit-test ${CMAKE_CURRENT_SOURCE_DIR}/unit-test.cpp)

target_link_libraries(mcfp-unit-test mcfp::mcfp Boost::boost)
target_link_libraries(mcfp-unit-test mcfp::mcfp Catch2::Catch2)

if(${Catch2_VERSION} VERSION_GREATER_EQUAL 3.0.0)
target_compile_definitions(mcfp-unit-test PUBLIC CATCH22=0)
else()
target_compile_definitions(mcfp-unit-test PUBLIC CATCH22=1)
endif()

if(MSVC)
# Specify unwind semantics so that MSVC knowns how to handle exceptions
target_compile_options(mcfp-unit-test PRIVATE /EHsc)
endif()

add_test(NAME mcfp-unit-test
COMMAND $<TARGET_FILE:mcfp-unit-test> -- ${CMAKE_CURRENT_SOURCE_DIR})
COMMAND $<TARGET_FILE:mcfp-unit-test> --data-dir ${CMAKE_CURRENT_SOURCE_DIR})
Loading

0 comments on commit 97855a2

Please sign in to comment.