IF(CMAKE_VERSION VERSION_LESS 2.8.8)
	MESSAGE("-- Unit tests are only available in CMake >=2.8.8. You have ${CMAKE_VERSION}")
	RETURN()
ENDIF()

INCLUDE_DIRECTORIES("${CMAKE_CURRENT_SOURCE_DIR}")
INCLUDE_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}")
INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/include")
INCLUDE_DIRECTORIES("${CMAKE_BINARY_DIR}")

SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++0x")

SET(CMAKE_AUTOMOC ON)

ADD_EXECUTABLE(tests
	EXCLUDE_FROM_ALL
	main.cpp
	QTestSuite
	$<TARGET_OBJECTS:lmmsobjs>

	src/core/ProjectVersionTest.cpp
	src/core/RelativePathsTest.cpp

	src/tracks/AutomationTrackTest.cpp
)
TARGET_LINK_LIBRARIES(tests ${QT_LIBRARIES} ${QT_QTTEST_LIBRARY})
TARGET_LINK_LIBRARIES(tests ${LMMS_REQUIRED_LIBS})
