Skip to content

Commit

Permalink
cmake: Fix benchmark check
Browse files Browse the repository at this point in the history
  • Loading branch information
Mizux committed Oct 22, 2024
1 parent 2693809 commit 30d7649
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
9 changes: 7 additions & 2 deletions cmake/check_deps.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,13 @@ if(USE_CPLEX AND NOT TARGET CPLEX::CPLEX)
endif()

# CXX Test
if(BUILD_TESTING AND NOT TARGET GTest::gtest_main)
message(FATAL_ERROR "Target GTest::gtest_main not available.")
if(BUILD_TESTING)
if(NOT TARGET GTest::gtest_main)
message(FATAL_ERROR "Target GTest::gtest_main not available.")
endif()
if(NOT TARGET benchmark::benchmark)
message(FATAL_ERROR "Target benchmark::benchmark not available.")
endif()
endif()

# Check language Dependencies
Expand Down
2 changes: 1 addition & 1 deletion cmake/docker/system_deps/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ RUN pacman -Syu --noconfirm \
coin-or-cbc coin-or-clp \
glpk \
scip \
gtest
gtest benchmark

ENTRYPOINT ["/bin/bash", "-c"]
CMD [ "/bin/bash" ]
Expand Down
4 changes: 4 additions & 0 deletions cmake/system_deps.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ if(BUILD_TESTING AND NOT BUILD_googletest)
find_package(GTest REQUIRED)
endif()

if(BUILD_TESTING AND NOT BUILD_benchmark)
find_package(benchmark REQUIRED)
endif()

# Check language Dependencies
if(BUILD_PYTHON)
if(NOT BUILD_pybind11)
Expand Down

0 comments on commit 30d7649

Please sign in to comment.