1
# Build Google Test and make its headers known
6
# Check for google test and build it locally
8
"/usr/src/gtest" # Default value, adjustable by user with e.g., ccmake
11
"Path to Google test srcs"
14
find_path (GTEST_INCLUDE_DIR gtest/gtest.h)
16
if (GTEST_INCLUDE_DIR)
17
#FIXME - hardcoded is bad!
18
add_subdirectory (${GTEST_ROOT_DIR}
20
endif(GTEST_INCLUDE_DIR)
22
set (GTEST_BOTH_LIBRARIES gtest gtest_main)
23
set (GTEST_FOUND TRUE)
25
endif (NOT GTEST_FOUND)
27
find_library (GMOCK_LIBRARY gmock)
28
find_library (GMOCK_MAIN_LIBRARY gmock_main)
30
if (NOT GMOCK_LIBRARY OR NOT GMOCK_MAIN_LIBRARY OR NOT GTEST_FOUND)
31
message ("Google Mock and Google Test not found - cannot build tests!")
32
set (COMPIZ_BUILD_TESTING OFF)
33
endif (NOT GMOCK_LIBRARY OR NOT GMOCK_MAIN_LIBRARY OR NOT GTEST_FOUND)
35
include_directories (${GTEST_INCLUDE_DIRS})
37
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
39
add_executable (compiz_test_wall_offset_movement
40
${CMAKE_CURRENT_SOURCE_DIR}/test-wall-offset-movement.cpp)
42
target_link_libraries (compiz_test_wall_offset_movement
43
compiz_wall_offset_movement
44
${GTEST_BOTH_LIBRARIES}
47
${CMAKE_THREAD_LIBS_INIT} # Link in pthread.
50
gtest_add_tests (compiz_test_wall_offset_movement "" ${CMAKE_CURRENT_SOURCE_DIR}/test-wall-offset-movement.cpp)