Skip to content

Commit

Permalink
[cmake] Check for tool existence when adding a dep.
Browse files Browse the repository at this point in the history
  • Loading branch information
bilke committed Oct 10, 2024
1 parent d8f2258 commit 62f39d9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 17 deletions.
14 changes: 1 addition & 13 deletions Applications/Python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,7 @@ if(OGS_USE_PIP)
"-DTEST_COMMAND_IS_EXPECTED_TO_SUCCEED=TRUE" -P
${PROJECT_SOURCE_DIR}/scripts/cmake/test/AddTestWrapper.cmake
)
set_tests_properties(
pytest PROPERTIES LABELS "default;python" COST 10
)

add_dependencies(
ctest
GMSH2OGS
Layers2Grid
AddFaultToVoxelGrid
ExtractBoundary
vtkdiff
generateStructuredMesh
)
set_tests_properties(pytest PROPERTIES LABELS "default;python" COST 10)
endif()

endif()
17 changes: 13 additions & 4 deletions Tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
set(CMAKE_FOLDER "Testing")
# ctest dependencies
foreach(tool vtkdiff xdmfdiff)
foreach(
tool
vtkdiff
xdmfdiff
GMSH2OGS
Layers2Grid
AddFaultToVoxelGrid
ExtractBoundary
generateStructuredMesh
)
if(TARGET ${tool})
list(APPEND test_dependencies ${tool})
endif()
Expand Down Expand Up @@ -86,9 +95,9 @@ endif()
ogs_add_executable(testrunner ${TEST_SOURCES})

target_sources(
testrunner PRIVATE ProcessLib/Graph/TestGet.cpp
ProcessLib/Graph/TestApply.cpp
ProcessLib/Graph/TestCheckEvalOrderRT.cpp
testrunner
PRIVATE ProcessLib/Graph/TestGet.cpp ProcessLib/Graph/TestApply.cpp
ProcessLib/Graph/TestCheckEvalOrderRT.cpp
)

target_link_libraries(
Expand Down

0 comments on commit 62f39d9

Please sign in to comment.