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:
parent
9e2a42ebf9
commit
eb8c6aec55
|
@ -16,9 +16,13 @@ PROJECT(CPPCHECK)
|
||||||
|
|
||||||
ADD_SUBDIRECTORY(lib)
|
ADD_SUBDIRECTORY(lib)
|
||||||
ADD_SUBDIRECTORY(cli)
|
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)
|
# Don't build GUI for Cygwin (most installations don't have QT)
|
||||||
IF (NOT CYGWIN)
|
IF (NOT CYGWIN)
|
||||||
ADD_SUBDIRECTORY(gui)
|
ADD_SUBDIRECTORY(gui)
|
||||||
endif (NOT CYGWIN)
|
endif (NOT CYGWIN)
|
||||||
|
|
||||||
|
|
|
@ -52,3 +52,8 @@ include_directories (${CPPCHECK_SOURCE_DIR}/lib)
|
||||||
ADD_EXECUTABLE(test ${CHECKTEST_SRCS})
|
ADD_EXECUTABLE(test ${CHECKTEST_SRCS})
|
||||||
TARGET_LINK_LIBRARIES(test ${CHECK_LIBS})
|
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)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue