Merge lp:~wixkkomi/inkscape/cmake_arch into lp:~inkscape.dev/inkscape/trunk

Proposed by wixkkomi
Status: Needs review
Proposed branch: lp:~wixkkomi/inkscape/cmake_arch
Merge into: lp:~inkscape.dev/inkscape/trunk
Diff against target: 32 lines (+9/-2)
2 files modified
CMakeLists.txt (+2/-1)
testfiles/CMakeLists.txt (+7/-1)
To merge this branch: bzr merge lp:~wixkkomi/inkscape/cmake_arch
Reviewer Review Type Date Requested Status
Inkscape Developers Pending
Review via email: mp+319386@code.launchpad.net

Description of the change

The gmock library on Arch provides pre-compiled shared libraries. The structure of the gmock directory is:

$ ls /usr/src/gmock
gmock-all.cc gmock-cardinalities.cc gmock.cc gmock-internal-utils.cc gmock_main.cc gmock-matchers.cc gmock-spec-builders.cc
$ ls /usr/src/gtest
cmake/ CMakeLists.txt src/

Headers and shared libraries are placed at /usr/include and /usr/lib, separately. So we simply link to those shared libraries.

To post a comment you must log in.

Unmerged revisions

15578. By wixkkomi

Fix issue with building test on Arch Linux.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2017-03-08 21:25:30 +0000
+++ CMakeLists.txt 2017-03-09 06:05:08 +0000
@@ -102,7 +102,8 @@
102# -----------------------------------------------------------------------------102# -----------------------------------------------------------------------------
103if(NOT GMOCK_DIR)103if(NOT GMOCK_DIR)
104 find_path(GMOCK_DIR104 find_path(GMOCK_DIR
105 NAMES src/gmock.cc105 NAMES "src/gmock.cc"
106 "gmock.cc"
106 PATHS "$ENV{GMOCK_DIR}"107 PATHS "$ENV{GMOCK_DIR}"
107 "/usr/src/googletest/googlemock"108 "/usr/src/googletest/googlemock"
108 "/usr/src/gmock"109 "/usr/src/gmock"
109110
=== modified file 'testfiles/CMakeLists.txt'
--- testfiles/CMakeLists.txt 2016-08-09 09:33:34 +0000
+++ testfiles/CMakeLists.txt 2017-03-09 06:05:08 +0000
@@ -1,7 +1,13 @@
1# -----------------------------------------------------------------------------1# -----------------------------------------------------------------------------
2#2#
3# -----------------------------------------------------------------------------3# -----------------------------------------------------------------------------
4add_subdirectory(${GMOCK_DIR} ${CMAKE_BINARY_DIR}/gmock)4# gmock on some distros (e.g. Arch) are provided with pre-compiled
5# shared library.
6if (EXISTS "${GMOCK_DIR}/CMakeLists.txt")
7 add_subdirectory(${GMOCK_DIR} ${CMAKE_BINARY_DIR}/gmock)
8else ()
9 set(INKSCAPE_LIBS gtest ${INKSCAPE_LIBS})
10endif()
511
6include_directories(SYSTEM ${GMOCK_DIR}/gtest/include12include_directories(SYSTEM ${GMOCK_DIR}/gtest/include
7 ${GMOCK_DIR}/include13 ${GMOCK_DIR}/include