--- CMakeLists.txt.old 2010-04-15 23:02:08.000000000 +0100 +++ CMakeLists.txt 2011-09-25 11:48:26.628895896 +0100 @@ -96,8 +96,12 @@ set(cxx_no_rtti_flags "-qnortti -DGTEST_HAS_RTTI=0") endif() -if (CMAKE_USE_PTHREADS_INIT) # The pthreads library is available. +option(build_with_pthreads "Build with pthreads library." OFF) + +if (build_with_pthreads AND CMAKE_USE_PTHREADS_INIT) # The pthreads library is available. set(cxx_base_flags "${cxx_base_flags} -DGTEST_HAS_PTHREAD=1") +else() + set(cxx_base_flags "${cxx_base_flags} -DGTEST_HAS_PTHREAD=0") endif() # For building gtest's own tests and samples. @@ -122,7 +126,7 @@ set_target_properties(${name} PROPERTIES COMPILE_FLAGS "${cxx_flags}") - if (CMAKE_USE_PTHREADS_INIT) + if (build_with_pthreads AND CMAKE_USE_PTHREADS_INIT) target_link_libraries(${name} ${CMAKE_THREAD_LIBS_INIT}) endif() endfunction() @@ -140,11 +144,8 @@ cxx_static_library(${name} "${cxx_flags}" ${ARGN}) endfunction() -# Static versions of Google Test libraries. We build them using more -# strict warnings than what are used for other targets, to ensure that -# gtest can be compiled by a user aggressive about warnings. -cxx_static_library(gtest "${cxx_strict}" src/gtest-all.cc) -cxx_static_library(gtest_main "${cxx_strict}" src/gtest_main.cc) +cxx_shared_library(gtest "${cxx_strict}" src/gtest-all.cc) +cxx_shared_library(gtest_main "${cxx_strict}" src/gtest_main.cc) target_link_libraries(gtest_main gtest) ######################################################################## @@ -382,3 +383,11 @@ cxx_executable(gtest_xml_output_unittest_ test gtest) py_test(gtest_xml_output_unittest) endif() + +install(FILES m4/gtest.m4 DESTINATION share/aclocal) +install(PROGRAMS scripts/gtest-config DESTINATION bin) +install(DIRECTORY include/gtest DESTINATION include + FILES_MATCHING PATTERN "*.pump" EXCLUDE + PATTERN "*") +install(TARGETS gtest gtest_main + LIBRARY DESTINATION lib)