Skip to content

Commit

Permalink
Add custom targets for running cmkr/tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mrexodia committed May 31, 2024
1 parent 0aca28c commit 626c2bd
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions cmake.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ link-libraries = [
"mpark_variant",
"ordered_map",
]
cmake-after = """
generate_resources(${CMKR_TARGET})
"""
include-after = ["cmake/custom_targets.cmake"]

[[install]]
targets = ["cmkr"]
Expand Down
18 changes: 18 additions & 0 deletions cmake/custom_targets.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
generate_resources(cmkr)

add_custom_target(regenerate-cmake
COMMAND "$<TARGET_FILE:cmkr>" gen
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}"
)

if(CMAKE_CONFIGURATION_TYPES)
add_custom_target(run-tests
COMMAND "${CMAKE_CTEST_COMMAND}" -C $<CONFIG>
WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/tests"
)
else()
add_custom_target(run-tests
COMMAND "${CMAKE_CTEST_COMMAND}"
WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/tests"
)
endif()

0 comments on commit 626c2bd

Please sign in to comment.