~compiz-team/compiz/compiz.fix_1130160

« back to all changes in this revision

Viewing changes to tests/xorg-gtest/src/CMakeLists.txt

  • Committer: Tarmac
  • Author(s): Sam Spilsbury
  • Date: 2013-02-19 14:44:27 UTC
  • mfrom: (3554.6.19 compiz.fix_1120009)
  • Revision ID: tarmac-20130219144427-2xzi2f9b4ap9b2r0
Enable xorg-gtest tests by default and build in CI.

This change also refactors a number of parts of the code to find and build the tests. It puts the logic to find Google Test and Xorg GTest in their own cmake files, and also splits the find logic with the build logic. Finally, it makes the xorg-gtest variables available to all subdirectories and not just the ones under tests/.

This change also refreshes some distro patches. A new option was added to not auto-load the ccp plugin, and also modifies one of the tests depending on a modified setting value.

(LP: #1120009). Fixes: https://bugs.launchpad.net/bugs/1120009.

Approved by Sam Spilsbury, Andrea Azzarone.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
set (COMPIZ_LD_LIBRARY_PATH ${CMAKE_BINARY_DIR}/src CACHE STRING "" FORCE)
2
 
set (COMPIZ_BINARY ${CMAKE_BINARY_DIR}/src/compiz CACHE STRING "" FORCE)
3
 
 
4
 
configure_file (${CMAKE_CURRENT_SOURCE_DIR}/compiz-xorg-gtest-config.h.in
5
 
                ${CMAKE_CURRENT_BINARY_DIR}/compiz-xorg-gtest-config.h
6
 
                @ONLY)
7
 
 
8
 
add_definitions (${_xorg_gtest_cflags})
9
 
 
10
 
include_directories (${COMPIZ_XORG_SYSTEM_TEST_INCLUDE_DIR}
11
 
                     ${XORG_SERVER_INCLUDE_DIRS}
12
 
                     ${GTEST_INCLUDE_DIRS}
13
 
                     ${XORG_SERVER_INCLUDE_XORG_GTEST}
14
 
                     ${XORG_SERVER_GTEST_SRC}
15
 
                     ${CMAKE_CURRENT_BINARY_DIR})
16
 
 
17
 
link_directories (${XORG_SERVER_LIBRARY_DIRS})
18
 
 
19
 
# This actually includes xorg-gtest-all and the defines
20
 
set (_xorg_gtest_all_srcs
21
 
     ${XORG_SERVER_GTEST_SRC}/src/xorg-gtest-all.cpp)
22
 
 
23
 
set (_xorg_gtest_main_srcs
24
 
     ${XORG_SERVER_GTEST_SRC}/src/xorg-gtest_main.cpp)
25
 
 
26
 
add_library (xorg_gtest_all STATIC
27
 
             ${_xorg_gtest_all_srcs})
28
 
 
29
 
add_library (xorg_gtest_main STATIC
30
 
             ${_xorg_gtest_main_srcs})
31
 
 
32
 
add_library (compiz_xorg_gtest_system_test STATIC
33
 
             ${CMAKE_CURRENT_SOURCE_DIR}/compiz-xorg-gtest.cpp)
34
 
 
35
 
target_link_libraries (xorg_gtest_all
36
 
                       ${GTEST_BOTH_LIBRARIES}
37
 
                       ${CMAKE_THREAD_LIBS_INIT}
38
 
                       ${XORG_SERVER_LIBRARIES})
39
 
 
40
 
target_link_libraries (xorg_gtest_main
41
 
                       ${GTEST_BOTH_LIBRARIES}
42
 
                       ${CMAKE_THREAD_LIBS_INIT}
43
 
                       ${XORG_SERVER_LIBRARIES})
44
 
 
45
 
target_link_libraries (compiz_xorg_gtest_system_test
46
 
                       xorg_gtest_all
47
 
                       xorg_gtest_main
48
 
                       ${GTEST_BOTH_LIBRARIES}
49
 
                       ${CMAKE_THREAD_LIBS_INIT}
50
 
                       ${XORG_SERVER_LIBRARIES}
51
 
                       ${X11_XI_LIBRARIES})
 
1
add_executable (xorg_gtest_wrapper
 
2
                ${CMAKE_CURRENT_SOURCE_DIR}/xorg_gtest_wrapper.cpp)