File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change
1
+ cmake_minimum_required (VERSION 2.8.1 )
2
+ project (UnitTest++ )
3
+
4
+ # get the main sources
5
+ file (GLOB SRCS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} src/*.cpp src/*.h )
6
+ source_group ("" FILES ${SRCS} )
7
+
8
+ # get platform specific sources
9
+ if (WIN32 )
10
+ set (PLAT_DIR Win32 )
11
+ else ()
12
+ set (PLAT_DIR Posix )
13
+ endif (WIN32 )
14
+ file (GLOB PLAT_SRCS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} src/${PLAT_DIR}/*.cpp src/${PLAT_DIR}/*.h )
15
+ source_group (${PLAT_DIR} FILES ${PLAT_SRCS} )
16
+
17
+ # create the lib
18
+ add_library (UnitTestPP STATIC ${SRCS} ${PLAT_SRCS} )
19
+ set_target_properties (UnitTestPP PROPERTIES OUTPUT_NAME UnitTest++ )
20
+ include_directories (src )
21
+
22
+ # build the test runner
23
+ file (GLOB TEST_SRCS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} src/tests/*.cpp src/tests/*.h )
24
+ source_group ( "" FILES ${TEST_SRCS} )
25
+ add_executable (TestUnitTestPP ${TEST_SRCS} )
26
+ set_target_properties (TestUnitTestPP PROPERTIES OUTPUT_NAME TestUnitTest++ )
27
+ target_link_libraries (TestUnitTestPP UnitTestPP )
28
+
29
+ # turn on testing
30
+ enable_testing ()
31
+ add_custom_target (check COMMAND ${CMAKE_CTEST_COMMAND} -V )
32
+
33
+ # add the test runner as a test
34
+ add_test (NAME TestUnitTestPP COMMAND TestUnitTest++ ${CONFIG_PATH} ${CONFIG_TASKS_PATH} ${SOUND_LOG_PATH} )
35
+ add_dependencies (check TestUnitTestPP )
You can’t perform that action at this time.
0 commit comments