fysxasteroids/engine/tests/CMakeLists.txt

53 lines
1002 B
CMake
Raw Permalink Normal View History

2010-04-05 23:38:59 +02:00
PROJECT (ENGINETESTS)
CMAKE_MINIMUM_REQUIRED (VERSION 2.6)
# Needed for UnitTest++
LIST( APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMake )
SET ( TESTS_SRCS
main.cc
CommandsTests.cc
EntityTests.cc
EventBaseTests.cc
2010-04-05 23:38:59 +02:00
PhysicsTests.cc
ControllerBaseTests.cc
UtilsTests.cc
2010-04-05 23:38:59 +02:00
)
FIND_PACKAGE (UnitTest++)
INCLUDE_DIRECTORIES ( ../ )
SET_TARGET_PROPERTIES ( ${PROJECT_EXECUTABLES} PROPERTIES
LINKER_LANGUAGE CXX
)
IF ( UNITTEST++_FOUND )
ADD_EXECUTABLE ( enginetests ${TESTS_SRCS} )
INCLUDE_DIRECTORIES ( ${UNITTEST++_INCLUDE_DIR} )
SET_TARGET_PROPERTIES ( enginetests PROPERTIES
LINKER_LANGUAGE CXX
OUTPUT_NAME runtests
)
TARGET_LINK_LIBRARIES ( enginetests
${UNITTEST++_LIBRARY}
Engine
)
OPTION (RUN_AUTOMATIC_TESTS "Perform automatic tests after compilation?" OFF)
IF (RUN_AUTOMATIC_TESTS)
ADD_CUSTOM_COMMAND (TARGET runtests
POST_BUILD
COMMAND ./runtests
COMMENT "Running automated tests..."
)
ENDIF (RUN_AUTOMATIC_TESTS)
ENDIF ( UNITTEST++_FOUND )