~smspillaz/compiz-plugins-main/compiz-plugins-main.fix_939228

« back to all changes in this revision

Viewing changes to wall/src/offset_movement/tests/CMakeLists.txt

  • Committer: smspillaz
  • Date: 2012-04-24 13:01:14 UTC
  • Revision ID: sam.spilsbury@canonical.com-20120424130114-sng6c43ulxxhrxz4
checkinĀ missingĀ files

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Build Google Test and make its headers known
 
2
find_package (GTest)
 
3
 
 
4
if (NOT GTEST_FOUND)
 
5
 
 
6
    # Check for google test and build it locally
 
7
    set (GTEST_ROOT_DIR
 
8
        "/usr/src/gtest" # Default value, adjustable by user with e.g., ccmake
 
9
        CACHE
 
10
        PATH
 
11
        "Path to Google test srcs"
 
12
    )
 
13
 
 
14
    find_path (GTEST_INCLUDE_DIR gtest/gtest.h)
 
15
 
 
16
    if (GTEST_INCLUDE_DIR)
 
17
        #FIXME - hardcoded is bad!
 
18
        add_subdirectory (${GTEST_ROOT_DIR}
 
19
                      gtest)
 
20
    endif(GTEST_INCLUDE_DIR)
 
21
 
 
22
    set (GTEST_BOTH_LIBRARIES gtest gtest_main)
 
23
    set (GTEST_FOUND TRUE)
 
24
 
 
25
endif (NOT GTEST_FOUND)
 
26
 
 
27
find_library (GMOCK_LIBRARY gmock)
 
28
find_library (GMOCK_MAIN_LIBRARY gmock_main)
 
29
 
 
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)
 
34
 
 
35
include_directories (${GTEST_INCLUDE_DIRS})
 
36
 
 
37
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
 
38
 
 
39
add_executable (compiz_test_wall_offset_movement
 
40
                ${CMAKE_CURRENT_SOURCE_DIR}/test-wall-offset-movement.cpp)
 
41
 
 
42
target_link_libraries (compiz_test_wall_offset_movement
 
43
                       compiz_wall_offset_movement
 
44
                       ${GTEST_BOTH_LIBRARIES}
 
45
                       ${GMOCK_LIBRARY}
 
46
                       ${GMOCK_MAIN_LIBRARY}
 
47
                       ${CMAKE_THREAD_LIBS_INIT} # Link in pthread. 
 
48
                       )
 
49
 
 
50
gtest_add_tests (compiz_test_wall_offset_movement "" ${CMAKE_CURRENT_SOURCE_DIR}/test-wall-offset-movement.cpp)