diff options
author | David Seifert <soap@gentoo.org> | 2017-08-14 11:45:56 (GMT) |
---|---|---|
committer | David Seifert <soap@gentoo.org> | 2017-08-14 11:45:56 (GMT) |
commit | 8604c4adac40573f806cfadae44e22f8dfaf212a (patch) | |
tree | d36e71b9f5293a7e077a233cc32a95a6282d3cb1 /googletest/cmake | |
parent | 673c975a963f356b19fea90cb57b69192253da2a (diff) | |
download | googletest-8604c4adac40573f806cfadae44e22f8dfaf212a.zip googletest-8604c4adac40573f806cfadae44e22f8dfaf212a.tar.gz googletest-8604c4adac40573f806cfadae44e22f8dfaf212a.tar.bz2 |
Add support for pkgconfig
Diffstat (limited to 'googletest/cmake')
-rw-r--r-- | googletest/cmake/gtest.pc.in | 9 | ||||
-rw-r--r-- | googletest/cmake/gtest_main.pc.in | 10 | ||||
-rw-r--r-- | googletest/cmake/internal_utils.cmake | 6 |
3 files changed, 23 insertions, 2 deletions
diff --git a/googletest/cmake/gtest.pc.in b/googletest/cmake/gtest.pc.in new file mode 100644 index 0000000..e7967ad --- /dev/null +++ b/googletest/cmake/gtest.pc.in @@ -0,0 +1,9 @@ +libdir=@CMAKE_INSTALL_FULL_LIBDIR@ +includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ + +Name: gtest +Description: GoogleTest (without main() function) +Version: @PROJECT_VERSION@ +URL: https://github.com/google/googletest +Libs: -L${libdir} -lgtest @CMAKE_THREAD_LIBS_INIT@ +Cflags: -I${includedir} @GTEST_HAS_PTHREAD_MACRO@ @CMAKE_THREAD_LIBS_INIT@ diff --git a/googletest/cmake/gtest_main.pc.in b/googletest/cmake/gtest_main.pc.in new file mode 100644 index 0000000..fe25d9c --- /dev/null +++ b/googletest/cmake/gtest_main.pc.in @@ -0,0 +1,10 @@ +libdir=@CMAKE_INSTALL_FULL_LIBDIR@ +includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ + +Name: gtest_main +Description: GoogleTest (with main() function) +Version: @PROJECT_VERSION@ +URL: https://github.com/google/googletest +Requires: gtest +Libs: -L${libdir} -lgtest_main @CMAKE_THREAD_LIBS_INIT@ +Cflags: -I${includedir} @GTEST_HAS_PTHREAD_MACRO@ @CMAKE_THREAD_LIBS_INIT@ diff --git a/googletest/cmake/internal_utils.cmake b/googletest/cmake/internal_utils.cmake index 8878dc1..f0f54d0 100644 --- a/googletest/cmake/internal_utils.cmake +++ b/googletest/cmake/internal_utils.cmake @@ -50,6 +50,7 @@ macro(config_compiler_and_linker) # instead, we use windows threading primitives if (NOT gtest_disable_pthreads AND NOT MINGW) # Defines CMAKE_USE_PTHREADS_INIT and CMAKE_THREAD_LIBS_INIT. + set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads) endif() @@ -126,10 +127,11 @@ macro(config_compiler_and_linker) endif() if (CMAKE_USE_PTHREADS_INIT) # The pthreads library is available and allowed. - set(cxx_base_flags "${cxx_base_flags} -DGTEST_HAS_PTHREAD=1") + set(GTEST_HAS_PTHREAD_MACRO "-DGTEST_HAS_PTHREAD=1") else() - set(cxx_base_flags "${cxx_base_flags} -DGTEST_HAS_PTHREAD=0") + set(GTEST_HAS_PTHREAD_MACRO "-DGTEST_HAS_PTHREAD=0") endif() + set(cxx_base_flags "${cxx_base_flags} ${GTEST_HAS_PTHREAD_MACRO}") # For building gtest's own tests and samples. set(cxx_exception "${CMAKE_CXX_FLAGS} ${cxx_base_flags} ${cxx_exception_flags}") |