Merge lp:~smspillaz/compiz-core/compiz-core.fix_964248 into lp:compiz-core

Proposed by Sam Spilsbury
Status: Merged
Approved by: Alan Griffiths
Approved revision: 3064
Merged at revision: 3071
Proposed branch: lp:~smspillaz/compiz-core/compiz-core.fix_964248
Merge into: lp:compiz-core
Diff against target: 33 lines (+24/-0)
1 file modified
CMakeLists.txt (+24/-0)
To merge this branch: bzr merge lp:~smspillaz/compiz-core/compiz-core.fix_964248
Reviewer Review Type Date Requested Status
Alan Griffiths Approve
Daniel van Vugt Approve
Review via email: mp+99193@code.launchpad.net

Description of the change

Fix LP#964248 - Build GTest locally

== Problem ==

See LP#964248 - If libgtest isn't installed then FindGTest will fail, but Ubuntu doesn't ship the gtest library anymore so we need to compile it locally

== Solution ==

Added CMake commands to compile gtest locally, link to that

== Test ==

make

To post a comment you must log in.
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Works OK, though possibly needs some more indentation inside if/endif.

review: Approve
Revision history for this message
Alan Griffiths (alan-griffiths) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2012-02-02 17:10:07 +0000
3+++ CMakeLists.txt 2012-03-25 00:47:17 +0000
4@@ -121,6 +121,30 @@
5
6 # Build Google Test and make its headers known
7 find_package (GTest)
8+
9+if (NOT GTEST_FOUND)
10+
11+ # Check for google test and build it locally
12+ set (GTEST_ROOT_DIR
13+ "/usr/src/gtest" # Default value, adjustable by user with e.g., ccmake
14+ CACHE
15+ PATH
16+ "Path to Google test srcs"
17+ )
18+
19+ find_path (GTEST_INCLUDE_DIR gtest/gtest.h)
20+
21+ if (GTEST_INCLUDE_DIR)
22+ #FIXME - hardcoded is bad!
23+ add_subdirectory (${GTEST_ROOT_DIR}
24+ gtest)
25+ endif(GTEST_INCLUDE_DIR)
26+
27+ set (GTEST_BOTH_LIBRARIES gtest gtest_main)
28+ set (GTEST_FOUND TRUE)
29+
30+endif (NOT GTEST_FOUND)
31+
32 find_library (GMOCK_LIBRARY gmock)
33 find_library (GMOCK_MAIN_LIBRARY gmock_main)
34

Subscribers

People subscribed via source and target branches