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 general.cc polygon_sphere.cc sphere_sphere.cc ) FIND_PACKAGE (UnitTest++) INCLUDE_DIRECTORIES ( ../mathlib/ ) SET_TARGET_PROPERTIES ( ${PROJECT_EXECUTABLES} PROPERTIES LINKER_LANGUAGE CXX ) IF ( UNITTEST++_FOUND ) ADD_EXECUTABLE ( coll2dtests ${TESTS_SRCS} ) INCLUDE_DIRECTORIES ( ${UNITTEST++_INCLUDE_DIR} ) SET_TARGET_PROPERTIES ( coll2dtests PROPERTIES LINKER_LANGUAGE CXX OUTPUT_NAME runtests ) TARGET_LINK_LIBRARIES ( coll2dtests ${UNITTEST++_LIBRARY} mathlib coll2d ) OPTION (RUN_AUTOMATIC_TESTS "Perform automatic tests after compilation?" OFF) IF (RUN_AUTOMATIC_TESTS) ADD_CUSTOM_COMMAND (TARGET coll2dtests POST_BUILD COMMAND coll2dtests COMMENT "Running automated tests..." ) ENDIF (RUN_AUTOMATIC_TESTS) ENDIF ( UNITTEST++_FOUND )