CMake - add 'make check' -target.

Tests are now excluded from normal targets to make compiling
faster. 'make check' -target will compile and run tests.
This commit is contained in:
Kimmo Varis 2009-12-20 11:16:56 +02:00
parent 9e2a42ebf9
commit eb8c6aec55
2 changed files with 10 additions and 1 deletions

View File

@ -16,9 +16,13 @@ PROJECT(CPPCHECK)
ADD_SUBDIRECTORY(lib)
ADD_SUBDIRECTORY(cli)
ADD_SUBDIRECTORY(test)
# Exclude tests from normal targets
# There is 'make check' -target for compiling and running tests
ADD_SUBDIRECTORY(test EXCLUDE_FROM_ALL)
# Don't build GUI for Cygwin (most installations don't have QT)
IF (NOT CYGWIN)
ADD_SUBDIRECTORY(gui)
endif (NOT CYGWIN)

View File

@ -52,3 +52,8 @@ include_directories (${CPPCHECK_SOURCE_DIR}/lib)
ADD_EXECUTABLE(test ${CHECKTEST_SRCS})
TARGET_LINK_LIBRARIES(test ${CHECK_LIBS})
# Add custom 'make check' -target
# It compiles and runs tests
add_custom_target(check COMMAND test)
add_dependencies(check test checklib)