-
Notifications
You must be signed in to change notification settings - Fork 1.5k
added remaining make targets to CMake #4026
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -59,6 +59,13 @@ if (BUILD_TESTS) | |
| DEPENDS cppcheck validateCFG) | ||
| endif() | ||
|
|
||
| # TODO: the target name "test" is reservered by CTest | ||
| #add_custom_target(test $<TARGET_FILE:testrunner> | ||
| # DEPENDS cppcheck testrunner) | ||
|
|
||
| add_custom_target(check $<TARGET_FILE:testrunner> -q | ||
| DEPENDS cppcheck testrunner) | ||
|
|
||
| if (REGISTER_TESTS) | ||
| # CMP0064 requires 3.4 | ||
| # CMAKE_MATCH_<n> usage for if (MATCHES) requires 3.9 | ||
|
|
@@ -71,7 +78,7 @@ if (BUILD_TESTS) | |
| ProcessorCount(N) | ||
| set(CTEST_PARALLEL_LEVEL ${N} CACHE STRING "CTest parallel level") | ||
| set(CTEST_TIMEOUT 90 CACHE STRING "CTest timeout") | ||
| add_custom_target(check ${CMAKE_CTEST_COMMAND} --output-on-failure -j ${CTEST_PARALLEL_LEVEL} -C ${CMAKE_CFG_INTDIR} --timeout ${CTEST_TIMEOUT} | ||
| add_custom_target(check-ctest ${CMAKE_CTEST_COMMAND} --output-on-failure -j ${CTEST_PARALLEL_LEVEL} -C ${CMAKE_CFG_INTDIR} --timeout ${CTEST_TIMEOUT} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would prefer to have
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is to align it with the
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Most developers(including me) use Also, its shorter to do |
||
| DEPENDS testrunner cppcheck) | ||
|
|
||
| set(SKIP_TESTS "" CACHE STRING "A list of tests to skip") | ||
|
|
@@ -80,7 +87,7 @@ if (BUILD_TESTS) | |
| if (${NAME} IN_LIST SKIP_TESTS) | ||
| elseif(TEST ${NAME}) | ||
| else() | ||
| add_test(NAME ${NAME} COMMAND testrunner ${NAME} WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) | ||
| add_test(NAME ${NAME} COMMAND $<TARGET_FILE:testrunner> ${NAME} WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) | ||
| endif() | ||
| endfunction() | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont understand the purpose of this, as ctest will already run the tests in the testrunner and it will run faster. Can we name this
run-testrunnerinstead?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First I want to align
Makefilewith CMake so there's an easy transition when moving to CMake. TheMakefileshould be completely deprecated or stripped down a bit.There's lots of more things in CMake which can be simplified and consolidated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think only @danmar uses the Makefile(and he seems more focused on cppcheck premium recently too). As far as I know, most other developers and contributors use cmake.
We can definitely provide targets to do the same functionality as in the makefile, but I dont see the need to name them exactly the same, especially when the name already overlaps with targets developers are already using in cmake.