Skip to content

Commit

Permalink
implement new option ENABLE_GOOGLETEST_INSTALL; implement GNUInstallD…
Browse files Browse the repository at this point in the history
…irs for correct lib target name.

Apply changes from google#1161 to support windows better (dll goes to runtime, .lib(export) to lib and .lib(static) to lib )
  • Loading branch information
d3x0r committed Jul 31, 2017
1 parent 4bab34d commit 9246ecb
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ project( googletest-distribution )

enable_testing()

include(GNUInstallDirs)

option(DISBLE_GOOGLETEST_INSTALL "Skip installation" ON)

option(BUILD_GTEST "Builds the googletest subproject" OFF)

#Note that googlemock target already builds googletest
Expand Down
12 changes: 8 additions & 4 deletions googlemock/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,14 @@ endif()
########################################################################
#
# Install rules
install(TARGETS gmock gmock_main
DESTINATION lib)
install(DIRECTORY ${gmock_SOURCE_DIR}/include/gmock
DESTINATION include)
if(NOT DISABLE_GOOGLETEST_INSTALL)
install(TARGETS gmock gmock_main
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(DIRECTORY ${gmock_SOURCE_DIR}/include/gmock
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
endif(NOT DISABLE_GOOGLETEST_INSTALL)

########################################################################
#
Expand Down
12 changes: 8 additions & 4 deletions googletest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,14 @@ endif()
########################################################################
#
# Install rules
install(TARGETS gtest gtest_main
DESTINATION lib)
install(DIRECTORY ${gtest_SOURCE_DIR}/include/gtest
DESTINATION include)
if(NOT DISABLE_GOOGLETEST_INSTALL)
install(TARGETS gtest gtest_main
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
install(DIRECTORY ${gtest_SOURCE_DIR}/include/gtest
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
endif(NOT DISABLE_GOOGLETEST_INSTALL)

########################################################################
#
Expand Down

0 comments on commit 9246ecb

Please sign in to comment.