Merge pull request #1160 from mwoehlke-kitware/honor-lib_suffix
Fix library install destinations
This commit is contained in:
commit
e3bd4cbeae
|
@ -8,10 +8,22 @@ project( googletest-distribution )
|
||||||
|
|
||||||
enable_testing()
|
enable_testing()
|
||||||
|
|
||||||
|
include(CMakeDependentOption)
|
||||||
|
if (CMAKE_VERSION VERSION_LESS 2.8.5)
|
||||||
|
set(CMAKE_INSTALL_BINDIR "bin" CACHE STRING "User executables (bin)")
|
||||||
|
set(CMAKE_INSTALL_LIBDIR "lib${LIB_SUFFIX}" CACHE STRING "Object code libraries (lib)")
|
||||||
|
set(CMAKE_INSTALL_INCLUDEDIR "include" CACHE STRING "C header files (include)")
|
||||||
|
mark_as_advanced(CMAKE_INSTALL_BINDIR CMAKE_INSTALL_LIBDIR CMAKE_INSTALL_INCLUDEDIR)
|
||||||
|
else()
|
||||||
|
include(GNUInstallDirs)
|
||||||
|
endif()
|
||||||
|
|
||||||
option(BUILD_GTEST "Builds the googletest subproject" OFF)
|
option(BUILD_GTEST "Builds the googletest subproject" OFF)
|
||||||
|
cmake_dependent_option(INSTALL_GTEST "Enable installation of googletest. (Projects embedding googletest may want to turn this OFF.)" ON "BUILD_GTEST OR BUILD_GMOCK" OFF)
|
||||||
|
|
||||||
#Note that googlemock target already builds googletest
|
#Note that googlemock target already builds googletest
|
||||||
option(BUILD_GMOCK "Builds the googlemock subproject" ON)
|
option(BUILD_GMOCK "Builds the googlemock subproject" ON)
|
||||||
|
cmake_dependent_option(INSTALL_GMOCK "Enable installation of googlemock. (Projects embedding googlemock may want to turn this OFF.)" ON "BUILD_GMOCK" OFF)
|
||||||
|
|
||||||
if(BUILD_GMOCK)
|
if(BUILD_GMOCK)
|
||||||
add_subdirectory( googlemock )
|
add_subdirectory( googlemock )
|
||||||
|
|
|
@ -103,10 +103,14 @@ endif()
|
||||||
########################################################################
|
########################################################################
|
||||||
#
|
#
|
||||||
# Install rules
|
# Install rules
|
||||||
install(TARGETS gmock gmock_main
|
if(INSTALL_GMOCK)
|
||||||
DESTINATION lib)
|
install(TARGETS gmock gmock_main
|
||||||
install(DIRECTORY ${gmock_SOURCE_DIR}/include/gmock
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||||
DESTINATION include)
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||||
|
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||||
|
install(DIRECTORY ${gmock_SOURCE_DIR}/include/gmock
|
||||||
|
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
||||||
|
endif()
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
#
|
#
|
||||||
|
|
|
@ -102,10 +102,14 @@ endif()
|
||||||
########################################################################
|
########################################################################
|
||||||
#
|
#
|
||||||
# Install rules
|
# Install rules
|
||||||
install(TARGETS gtest gtest_main
|
if(INSTALL_GTEST)
|
||||||
DESTINATION lib)
|
install(TARGETS gtest gtest_main
|
||||||
install(DIRECTORY ${gtest_SOURCE_DIR}/include/gtest
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||||
DESTINATION include)
|
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||||
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||||
|
install(DIRECTORY ${gtest_SOURCE_DIR}/include/gtest
|
||||||
|
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
||||||
|
endif()
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
#
|
#
|
||||||
|
|
Loading…
Reference in New Issue
Block a user