gnucash/gnucash-4.1-fix-gtest-path.patch
2024-11-24 15:32:14 +00:00

53 lines
2.0 KiB
Diff

--- gnucash-4.1/common/cmake_modules/GncAddTest.cmake.orig 2020-08-02 21:15:33.177983850 +0200
+++ gnucash-4.1/common/cmake_modules/GncAddTest.cmake 2020-08-08 10:13:40.567411650 +0200
@@ -130,13 +130,17 @@ function(gnc_gtest_configure)
unset(GTEST_SRC_DIR CACHE)
if (GTEST_ROOT)
find_path(GTEST_SRC_DIR src/gtest-all.cc NO_CMAKE_SYSTEM_PATH
- PATHS ${GTEST_ROOT}/googletest)
+ PATHS ${GTEST_ROOT})
endif()
if (GTEST_SRC_DIR)
- if (EXISTS ${GTEST_SRC_DIR}/include/gtest/gtest.h)
- set(GTEST_INCLUDE_DIR ${GTEST_SRC_DIR}/include CACHE PATH "" FORCE)
+ if (EXISTS ${GTEST_SRC_DIR}/googletest/include/gtest/gtest.h)
+ set(GTEST_INCLUDE_DIR ${GTEST_SRC_DIR}/googletest/include CACHE PATH "" FORCE)
else()
- message(FATAL_ERROR "GTEST sources found, but it doesn't have 'gtest/gtest.h'")
+ if (EXISTS ${GTEST_SRC_DIR}/gtest.h)
+ set(GTEST_INCLUDE_DIR ${GTEST_SRC_DIR} CACHE PATH "" FORCE)
+ else()
+ message(FATAL_ERROR "GTEST sources found, but it doesn't have 'gtest/gtest.h'")
+ endif()
endif()
else()
if (GTEST_ROOT)
@@ -168,15 +172,24 @@ function(gnc_gtest_configure)
message(STATUS "Checking for GMOCK")
unset(GMOCK_SRC_DIR CACHE)
- if (GTEST_ROOT)
+ if (GMOCK_ROOT)
find_path(GMOCK_SRC_DIR src/gmock-all.cc NO_CMAKE_SYSTEM_PATH
- PATHS ${GTEST_ROOT}/googlemock)
+ PATHS ${GMOCK_ROOT})
+ else()
+ if (GTEST_ROOT)
+ find_path(GMOCK_SRC_DIR src/gmock-all.cc NO_CMAKE_SYSTEM_PATH
+ PATHS ${GTEST_ROOT}/googlemock)
+ endif()
endif()
if (GMOCK_SRC_DIR)
if (EXISTS ${GMOCK_SRC_DIR}/include/gmock/gmock.h)
set(GMOCK_INCLUDE_DIR ${GMOCK_SRC_DIR}/include CACHE PATH "" FORCE)
else()
- message(FATAL_ERROR "GMOCK sources found, but it doesn't have 'gmock/gmock.h'")
+ if (EXISTS ${GMOCK_SRC_DIR}/gmock.h)
+ set(GMOCK_INCLUDE_DIR ${GMOCK_SRC_DIR} CACHE PATH "" FORCE)
+ else()
+ message(FATAL_ERROR "GMOCK sources found, but it doesn't have 'gmock/gmock.h'")
+ endif()
endif()
else()
if (GTEST_ROOT)