|
|
aff214e |
diff -ur root-6.18.00.orig/cmake/modules/SearchInstalledSoftware.cmake root-6.18.00/cmake/modules/SearchInstalledSoftware.cmake
|
|
|
aff214e |
--- root-6.18.00.orig/cmake/modules/SearchInstalledSoftware.cmake 2019-06-25 10:52:11.000000000 +0200
|
|
|
aff214e |
+++ root-6.18.00/cmake/modules/SearchInstalledSoftware.cmake 2019-06-26 16:00:21.275634375 +0200
|
|
|
aff214e |
@@ -1380,80 +1380,18 @@
|
|
|
7236b9a |
|
|
|
7236b9a |
#---Download googletest--------------------------------------------------------------
|
|
|
7236b9a |
if (testing)
|
|
|
7236b9a |
- # FIXME: Remove our version of gtest in roottest. We can reuse this one.
|
|
|
ea40f6d |
- # Add googletest
|
|
|
7236b9a |
- # http://stackoverflow.com/questions/9689183/cmake-googletest
|
|
|
ea40f6d |
+ # Workaround for missing libraries in Fedora's gmock packaging < 1.8.0
|
|
|
ea40f6d |
+ if(EXISTS ${CMAKE_SOURCE_DIR}/googlemock)
|
|
|
ea40f6d |
+ set(_G_LIBRARY_PATH ${CMAKE_SOURCE_DIR}/googlemock)
|
|
|
ea40f6d |
|
|
|
ea40f6d |
- set(_gtest_byproduct_binary_dir
|
|
|
7236b9a |
- ${CMAKE_CURRENT_BINARY_DIR}/googletest-prefix/src/googletest-build/googlemock/)
|
|
|
ea40f6d |
- set(_gtest_byproducts
|
|
|
ea40f6d |
- ${_gtest_byproduct_binary_dir}/gtest/libgtest.a
|
|
|
ea40f6d |
- ${_gtest_byproduct_binary_dir}/gtest/libgtest_main.a
|
|
|
ea40f6d |
- ${_gtest_byproduct_binary_dir}/libgmock.a
|
|
|
ea40f6d |
- ${_gtest_byproduct_binary_dir}/libgmock_main.a
|
|
|
7236b9a |
- )
|
|
|
7236b9a |
-
|
|
|
ea40f6d |
- if(MSVC)
|
|
|
ea40f6d |
- set(EXTRA_GTEST_OPTS
|
|
|
ea40f6d |
- -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG:PATH=\\\"\\\"
|
|
|
ea40f6d |
- -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE:PATH=\\\"\\\")
|
|
|
ea40f6d |
- endif()
|
|
|
436670d |
- if(APPLE)
|
|
|
436670d |
- set(EXTRA_GTEST_OPTS
|
|
|
436670d |
- -DCMAKE_OSX_SYSROOT=${CMAKE_OSX_SYSROOT})
|
|
|
436670d |
- endif()
|
|
|
ea40f6d |
-
|
|
|
7236b9a |
- ExternalProject_Add(
|
|
|
7236b9a |
- googletest
|
|
|
7236b9a |
- GIT_REPOSITORY https://github.com/google/googletest.git
|
|
|
7236b9a |
- GIT_TAG release-1.8.0
|
|
|
7236b9a |
- UPDATE_COMMAND ""
|
|
|
7236b9a |
- # TIMEOUT 10
|
|
|
7236b9a |
- # # Force separate output paths for debug and release builds to allow easy
|
|
|
7236b9a |
- # # identification of correct lib in subsequent TARGET_LINK_LIBRARIES commands
|
|
|
7236b9a |
- # CMAKE_ARGS -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG:PATH=DebugLibs
|
|
|
7236b9a |
- # -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE:PATH=ReleaseLibs
|
|
|
7236b9a |
- # -Dgtest_force_shared_crt=ON
|
|
|
7236b9a |
- CMAKE_ARGS -G ${CMAKE_GENERATOR}
|
|
|
7236b9a |
- -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
|
|
|
7236b9a |
- -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
|
|
|
7236b9a |
- -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
|
|
|
7236b9a |
- -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
|
|
|
7236b9a |
- -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
|
|
|
b8c8500 |
- -DCMAKE_AR=${CMAKE_AR}
|
|
|
7236b9a |
- -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
|
|
|
ea40f6d |
- ${EXTRA_GTEST_OPTS}
|
|
|
7236b9a |
- # Disable install step
|
|
|
7236b9a |
- INSTALL_COMMAND ""
|
|
|
ea40f6d |
- BUILD_BYPRODUCTS ${_gtest_byproducts}
|
|
|
7236b9a |
- # Wrap download, configure and build steps in a script to log output
|
|
|
7236b9a |
- LOG_DOWNLOAD ON
|
|
|
7236b9a |
- LOG_CONFIGURE ON
|
|
|
7236b9a |
- LOG_BUILD ON)
|
|
|
7236b9a |
-
|
|
|
7236b9a |
- # Specify include dirs for gtest and gmock
|
|
|
7236b9a |
- ExternalProject_Get_Property(googletest source_dir)
|
|
|
7236b9a |
- set(GTEST_INCLUDE_DIR ${source_dir}/googletest/include)
|
|
|
7236b9a |
- set(GMOCK_INCLUDE_DIR ${source_dir}/googlemock/include)
|
|
|
7236b9a |
-
|
|
|
7236b9a |
- # Libraries
|
|
|
7236b9a |
- ExternalProject_Get_Property(googletest binary_dir)
|
|
|
7236b9a |
- set(_G_LIBRARY_PATH ${binary_dir}/googlemock/)
|
|
|
7236b9a |
-
|
|
|
ea40f6d |
- # Register gtest, gtest_main, gmock, gmock_main
|
|
|
ea40f6d |
- foreach (lib gtest gtest_main gmock gmock_main)
|
|
|
ea40f6d |
+ # Register gmock, gmock_main
|
|
|
ea40f6d |
+ foreach (lib gmock gmock_main)
|
|
|
ea40f6d |
add_library(${lib} IMPORTED STATIC GLOBAL)
|
|
|
ea40f6d |
- add_dependencies(${lib} googletest)
|
|
|
aff214e |
- if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND
|
|
|
aff214e |
- ${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER_EQUAL 9)
|
|
|
aff214e |
- target_compile_options(${lib} INTERFACE -Wno-deprecated-copy)
|
|
|
aff214e |
- endif()
|
|
|
ea40f6d |
endforeach()
|
|
|
ea40f6d |
- set_property(TARGET gtest PROPERTY IMPORTED_LOCATION ${_G_LIBRARY_PATH}/gtest/${CMAKE_STATIC_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX})
|
|
|
ea40f6d |
- set_property(TARGET gtest_main PROPERTY IMPORTED_LOCATION ${_G_LIBRARY_PATH}/gtest/${CMAKE_STATIC_LIBRARY_PREFIX}gtest_main${CMAKE_STATIC_LIBRARY_SUFFIX})
|
|
|
ea40f6d |
set_property(TARGET gmock PROPERTY IMPORTED_LOCATION ${_G_LIBRARY_PATH}/${CMAKE_STATIC_LIBRARY_PREFIX}gmock${CMAKE_STATIC_LIBRARY_SUFFIX})
|
|
|
ea40f6d |
set_property(TARGET gmock_main PROPERTY IMPORTED_LOCATION ${_G_LIBRARY_PATH}/${CMAKE_STATIC_LIBRARY_PREFIX}gmock_main${CMAKE_STATIC_LIBRARY_SUFFIX})
|
|
|
7236b9a |
|
|
|
055702a |
+ endif()
|
|
|
7236b9a |
endif()
|
|
|
7236b9a |
|
|
|
aff214e |
#------------------------------------------------------------------------------------
|