CMakeLists.txt (googletest-release-1.11.0) | : | CMakeLists.txt (googletest-release-1.12.0) | ||
---|---|---|---|---|
skipping to change at line 49 | skipping to change at line 49 | |||
# Name of the project. | # Name of the project. | |||
# | # | |||
# CMake files in this project can refer to the root source directory | # CMake files in this project can refer to the root source directory | |||
# as ${gtest_SOURCE_DIR} and to the root binary directory as | # as ${gtest_SOURCE_DIR} and to the root binary directory as | |||
# ${gtest_BINARY_DIR}. | # ${gtest_BINARY_DIR}. | |||
# Language "C" is required for find_package(Threads). | # Language "C" is required for find_package(Threads). | |||
# Project version: | # Project version: | |||
if (CMAKE_VERSION VERSION_LESS 3.0) | cmake_minimum_required(VERSION 3.5) | |||
project(gtest CXX C) | cmake_policy(SET CMP0048 NEW) | |||
set(PROJECT_VERSION ${GOOGLETEST_VERSION}) | project(gtest VERSION ${GOOGLETEST_VERSION} LANGUAGES CXX C) | |||
else() | ||||
cmake_policy(SET CMP0048 NEW) | ||||
project(gtest VERSION ${GOOGLETEST_VERSION} LANGUAGES CXX C) | ||||
endif() | ||||
cmake_minimum_required(VERSION 2.8.12) | ||||
if (POLICY CMP0063) # Visibility | if (POLICY CMP0063) # Visibility | |||
cmake_policy(SET CMP0063 NEW) | cmake_policy(SET CMP0063 NEW) | |||
endif (POLICY CMP0063) | endif (POLICY CMP0063) | |||
if (COMMAND set_up_hermetic_build) | if (COMMAND set_up_hermetic_build) | |||
set_up_hermetic_build() | set_up_hermetic_build() | |||
endif() | endif() | |||
# These commands only run if this is the main project | # These commands only run if this is the main project | |||
skipping to change at line 138 | skipping to change at line 133 | |||
# are used for other targets, to ensure that gtest can be compiled by a user | # are used for other targets, to ensure that gtest can be compiled by a user | |||
# aggressive about warnings. | # aggressive about warnings. | |||
cxx_library(gtest "${cxx_strict}" src/gtest-all.cc) | cxx_library(gtest "${cxx_strict}" src/gtest-all.cc) | |||
set_target_properties(gtest PROPERTIES VERSION ${GOOGLETEST_VERSION}) | set_target_properties(gtest PROPERTIES VERSION ${GOOGLETEST_VERSION}) | |||
cxx_library(gtest_main "${cxx_strict}" src/gtest_main.cc) | cxx_library(gtest_main "${cxx_strict}" src/gtest_main.cc) | |||
set_target_properties(gtest_main PROPERTIES VERSION ${GOOGLETEST_VERSION}) | set_target_properties(gtest_main PROPERTIES VERSION ${GOOGLETEST_VERSION}) | |||
# If the CMake version supports it, attach header directory information | # If the CMake version supports it, attach header directory information | |||
# to the targets for when we are part of a parent build (ie being pulled | # to the targets for when we are part of a parent build (ie being pulled | |||
# in via add_subdirectory() rather than being a standalone build). | # in via add_subdirectory() rather than being a standalone build). | |||
if (DEFINED CMAKE_VERSION AND NOT "${CMAKE_VERSION}" VERSION_LESS "2.8.11") | if (DEFINED CMAKE_VERSION AND NOT "${CMAKE_VERSION}" VERSION_LESS "2.8.11") | |||
string(REPLACE ";" "$<SEMICOLON>" dirs "${gtest_build_include_dirs}") | ||||
target_include_directories(gtest SYSTEM INTERFACE | target_include_directories(gtest SYSTEM INTERFACE | |||
"$<BUILD_INTERFACE:${gtest_build_include_dirs}>" | "$<BUILD_INTERFACE:${dirs}>" | |||
"$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${CMAKE_INSTALL_INCLUDEDIR}>") | "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${CMAKE_INSTALL_INCLUDEDIR}>") | |||
target_include_directories(gtest_main SYSTEM INTERFACE | target_include_directories(gtest_main SYSTEM INTERFACE | |||
"$<BUILD_INTERFACE:${gtest_build_include_dirs}>" | "$<BUILD_INTERFACE:${dirs}>" | |||
"$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${CMAKE_INSTALL_INCLUDEDIR}>") | "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${CMAKE_INSTALL_INCLUDEDIR}>") | |||
endif() | endif() | |||
if(CMAKE_SYSTEM_NAME MATCHES "QNX") | ||||
target_link_libraries(gtest PUBLIC regex) | ||||
endif() | ||||
target_link_libraries(gtest_main PUBLIC gtest) | target_link_libraries(gtest_main PUBLIC gtest) | |||
######################################################################## | ######################################################################## | |||
# | # | |||
# Install rules | # Install rules | |||
install_project(gtest gtest_main) | install_project(gtest gtest_main) | |||
######################################################################## | ######################################################################## | |||
# | # | |||
# Samples on how to link user tests with gtest or gtest_main. | # Samples on how to link user tests with gtest or gtest_main. | |||
End of changes. 5 change blocks. | ||||
10 lines changed or deleted | 9 lines changed or added |