Merge lp:~allanlesage/coverage-builder/lp1371690-remove-FindGtest.cmake into lp:coverage-builder

Proposed by Allan LeSage
Status: Approved
Approved by: Martin Pitt
Approved revision: 282
Proposed branch: lp:~allanlesage/coverage-builder/lp1371690-remove-FindGtest.cmake
Merge into: lp:coverage-builder
Diff against target: 57 lines (+0/-53)
1 file modified
test/cmake-project/cmake/FindGtest.cmake (+0/-53)
To merge this branch: bzr merge lp:~allanlesage/coverage-builder/lp1371690-remove-FindGtest.cmake
Reviewer Review Type Date Requested Status
Martin Pitt (community) Approve
Review via email: mp+235319@code.launchpad.net

Description of the change

Quick fix to removes FindGtest.cmake from our sample CMake project.

To post a comment you must log in.
Revision history for this message
Martin Pitt (pitti) wrote :

Does that actually work? I don't see any replacement, like adding a build dep or copying the file from some common dir. Or is FindGText.cmake not being used in the first place?

review: Needs Information
Revision history for this message
Allan LeSage (allanlesage) wrote :

Please forgive the brevity of my initial proposal--yes this is tested working, yes it's being used in the dummy project; to explain: cmake (cmake-data) simply installs this macro in the default location:

$ dpkg -L cmake-data | grep -i gtest
/usr/share/cmake-2.8/Modules/FindGTest.cmake

From cmake changelog this appears to have been the case for a while, indeed the copied macro is necessary in any project in which it's included, including this one--I can't explain how it came into vogue as I wasn't responsible for spreading it (except to this dummy project).

Revision history for this message
Martin Pitt (pitti) wrote :

Ah, great.

review: Approve
Revision history for this message
Allan LeSage (allanlesage) wrote :

Sorry *is not necessary* or *is unnecessary*, to be absolutely clear :) --thanks Martin for the review.

Unmerged revisions

282. By Allan LeSage

Remove FindGtest.cmake which now ships with CMake.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== removed file 'test/cmake-project/cmake/FindGtest.cmake'
2--- test/cmake-project/cmake/FindGtest.cmake 2014-09-19 02:41:28 +0000
3+++ test/cmake-project/cmake/FindGtest.cmake 1970-01-01 00:00:00 +0000
4@@ -1,53 +0,0 @@
5-include(ExternalProject)
6-include(FindPackageHandleStandardArgs)
7-
8-#gtest
9-set(GTEST_INSTALL_DIR /usr/src/gmock/gtest/include)
10-find_path(GTEST_INCLUDE_DIR gtest/gtest.h
11- HINTS ${GTEST_INSTALL_DIR})
12-
13-#gmock
14-find_path(GMOCK_INSTALL_DIR gmock/CMakeLists.txt
15- HINTS /usr/src)
16-if(${GMOCK_INSTALL_DIR} STREQUAL "GMOCK_INSTALL_DIR-NOTFOUND")
17- message(FATAL_ERROR "google-mock package not found")
18-endif()
19-
20-set(GMOCK_INSTALL_DIR ${GMOCK_INSTALL_DIR}/gmock)
21-find_path(GMOCK_INCLUDE_DIR gmock/gmock.h)
22-
23-set(GMOCK_PREFIX gmock)
24-set(GMOCK_BINARY_DIR ${CMAKE_BINARY_DIR}/${GMOCK_PREFIX}/libs)
25-set(GTEST_BINARY_DIR ${GMOCK_BINARY_DIR}/gtest)
26-
27-set(GTEST_CMAKE_ARGS "")
28-if (${CMAKE_CROSSCOMPILING})
29- set(GTEST_CMAKE_ARGS
30- -DCMAKE_TOOLCHAIN_FILE=${CMAKE_MODULE_PATH}/LinuxCrossCompile.cmake)
31-endif()
32-
33-ExternalProject_Add(
34- GMock
35- #where to build in source tree
36- PREFIX ${GMOCK_PREFIX}
37- #where the source is external to the project
38- SOURCE_DIR ${GMOCK_INSTALL_DIR}
39- #forward the compilers to the subproject so cross-arch builds work
40- CMAKE_ARGS ${GTEST_CMAKE_ARGS}
41- BINARY_DIR ${GMOCK_BINARY_DIR}
42-
43- #we don't need to install, so skip
44- INSTALL_COMMAND ""
45-)
46-
47-set(GMOCK_LIBRARY ${GMOCK_BINARY_DIR}/libgmock.a)
48-set(GMOCK_MAIN_LIBRARY ${GMOCK_BINARY_DIR}/libgmock_main.a)
49-set(GMOCK_BOTH_LIBRARIES ${GMOCK_LIBRARY} ${GMOCK_MAIN_LIBRARY})
50-set(GTEST_LIBRARY ${GTEST_BINARY_DIR}/libgtest.a)
51-set(GTEST_MAIN_LIBRARY ${GTEST_BINARY_DIR}/libgtest_main.a)
52-set(GTEST_BOTH_LIBRARIES ${GTEST_LIBRARY} ${GTEST_MAIN_LIBRARY})
53-set(GTEST_ALL_LIBRARIES ${GTEST_BOTH_LIBRARIES} ${GMOCK_BOTH_LIBRARIES})
54-
55-find_package_handle_standard_args(GTest DEFAULT_MSG
56- GMOCK_INCLUDE_DIR
57- GTEST_INCLUDE_DIR)

Subscribers

People subscribed via source and target branches