CMakeLists.txt (googletest-release-1.10.0) | : | CMakeLists.txt (googletest-release-1.11.0) | ||
---|---|---|---|---|
skipping to change at line 45 | skipping to change at line 45 | |||
# 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 ${gmock_SOURCE_DIR} and to the root binary directory as | # as ${gmock_SOURCE_DIR} and to the root binary directory as | |||
# ${gmock_BINARY_DIR}. | # ${gmock_BINARY_DIR}. | |||
# Language "C" is required for find_package(Threads). | # Language "C" is required for find_package(Threads). | |||
if (CMAKE_VERSION VERSION_LESS 3.0) | if (CMAKE_VERSION VERSION_LESS 3.0) | |||
project(gmock CXX C) | project(gmock CXX C) | |||
else() | else() | |||
cmake_policy(SET CMP0048 NEW) | cmake_policy(SET CMP0048 NEW) | |||
project(gmock VERSION ${GOOGLETEST_VERSION} LANGUAGES CXX C) | project(gmock VERSION ${GOOGLETEST_VERSION} LANGUAGES CXX C) | |||
endif() | endif() | |||
cmake_minimum_required(VERSION 2.6.4) | cmake_minimum_required(VERSION 2.8.12) | |||
if (COMMAND set_up_hermetic_build) | if (COMMAND set_up_hermetic_build) | |||
set_up_hermetic_build() | set_up_hermetic_build() | |||
endif() | endif() | |||
# Instructs CMake to process Google Test's CMakeLists.txt and add its | # Instructs CMake to process Google Test's CMakeLists.txt and add its | |||
# targets to the current scope. We are placing Google Test's binary | # targets to the current scope. We are placing Google Test's binary | |||
# directory in a subdirectory of our own as VC compilation may break | # directory in a subdirectory of our own as VC compilation may break | |||
# if they are the same (the default). | # if they are the same (the default). | |||
add_subdirectory("${gtest_dir}" "${gmock_BINARY_DIR}/${gtest_dir}") | add_subdirectory("${gtest_dir}" "${gmock_BINARY_DIR}/${gtest_dir}") | |||
skipping to change at line 102 | skipping to change at line 102 | |||
src/gmock-all.cc) | src/gmock-all.cc) | |||
cxx_library(gmock_main | cxx_library(gmock_main | |||
"${cxx_strict}" | "${cxx_strict}" | |||
"${gtest_dir}/src/gtest-all.cc" | "${gtest_dir}/src/gtest-all.cc" | |||
src/gmock-all.cc | src/gmock-all.cc | |||
src/gmock_main.cc) | src/gmock_main.cc) | |||
else() | else() | |||
cxx_library(gmock "${cxx_strict}" src/gmock-all.cc) | cxx_library(gmock "${cxx_strict}" src/gmock-all.cc) | |||
target_link_libraries(gmock PUBLIC gtest) | target_link_libraries(gmock PUBLIC gtest) | |||
set_target_properties(gmock PROPERTIES VERSION ${GOOGLETEST_VERSION}) | ||||
cxx_library(gmock_main "${cxx_strict}" src/gmock_main.cc) | cxx_library(gmock_main "${cxx_strict}" src/gmock_main.cc) | |||
target_link_libraries(gmock_main PUBLIC gmock) | target_link_libraries(gmock_main PUBLIC gmock) | |||
set_target_properties(gmock_main PROPERTIES VERSION ${GOOGLETEST_VERSION}) | ||||
endif() | endif() | |||
# 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") | |||
target_include_directories(gmock SYSTEM INTERFACE | target_include_directories(gmock SYSTEM INTERFACE | |||
"$<BUILD_INTERFACE:${gmock_build_include_dirs}>" | "$<BUILD_INTERFACE:${gmock_build_include_dirs}>" | |||
"$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${CMAKE_INSTALL_INCLUDEDIR}>") | "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${CMAKE_INSTALL_INCLUDEDIR}>") | |||
target_include_directories(gmock_main SYSTEM INTERFACE | target_include_directories(gmock_main SYSTEM INTERFACE | |||
"$<BUILD_INTERFACE:${gmock_build_include_dirs}>" | "$<BUILD_INTERFACE:${gmock_build_include_dirs}>" | |||
skipping to change at line 138 | skipping to change at line 140 | |||
# | # | |||
# The tests are not built by default. To build them, set the | # The tests are not built by default. To build them, set the | |||
# gmock_build_tests option to ON. You can do it by running ccmake | # gmock_build_tests option to ON. You can do it by running ccmake | |||
# or specifying the -Dgmock_build_tests=ON flag when running cmake. | # or specifying the -Dgmock_build_tests=ON flag when running cmake. | |||
if (gmock_build_tests) | if (gmock_build_tests) | |||
# This must be set in the root directory for the tests to be run by | # This must be set in the root directory for the tests to be run by | |||
# 'make test' or ctest. | # 'make test' or ctest. | |||
enable_testing() | enable_testing() | |||
if (WIN32) | ||||
file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/RunTest.ps1" | ||||
CONTENT | ||||
"$project_bin = \"${CMAKE_BINARY_DIR}/bin/$<CONFIG>\" | ||||
$env:Path = \"$project_bin;$env:Path\" | ||||
& $args") | ||||
elseif (MINGW OR CYGWIN) | ||||
file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/RunTest.ps1" | ||||
CONTENT | ||||
"$project_bin = (cygpath --windows ${CMAKE_BINARY_DIR}/bin) | ||||
$env:Path = \"$project_bin;$env:Path\" | ||||
& $args") | ||||
endif() | ||||
if (MINGW OR CYGWIN) | if (MINGW OR CYGWIN) | |||
if (CMAKE_VERSION VERSION_LESS "2.8.12") | if (CMAKE_VERSION VERSION_LESS "2.8.12") | |||
add_compile_options("-Wa,-mbig-obj") | add_compile_options("-Wa,-mbig-obj") | |||
else() | else() | |||
add_definitions("-Wa,-mbig-obj") | add_definitions("-Wa,-mbig-obj") | |||
endif() | endif() | |||
endif() | endif() | |||
############################################################ | ############################################################ | |||
# C++ tests built with standard compiler flags. | # C++ tests built with standard compiler flags. | |||
cxx_test(gmock-actions_test gmock_main) | cxx_test(gmock-actions_test gmock_main) | |||
cxx_test(gmock-cardinalities_test gmock_main) | cxx_test(gmock-cardinalities_test gmock_main) | |||
cxx_test(gmock_ex_test gmock_main) | cxx_test(gmock_ex_test gmock_main) | |||
cxx_test(gmock-function-mocker_test gmock_main) | cxx_test(gmock-function-mocker_test gmock_main) | |||
cxx_test(gmock-generated-actions_test gmock_main) | ||||
cxx_test(gmock-generated-function-mockers_test gmock_main) | ||||
cxx_test(gmock-generated-matchers_test gmock_main) | ||||
cxx_test(gmock-internal-utils_test gmock_main) | cxx_test(gmock-internal-utils_test gmock_main) | |||
cxx_test(gmock-matchers_test gmock_main) | cxx_test(gmock-matchers_test gmock_main) | |||
cxx_test(gmock-more-actions_test gmock_main) | cxx_test(gmock-more-actions_test gmock_main) | |||
cxx_test(gmock-nice-strict_test gmock_main) | cxx_test(gmock-nice-strict_test gmock_main) | |||
cxx_test(gmock-port_test gmock_main) | cxx_test(gmock-port_test gmock_main) | |||
cxx_test(gmock-spec-builders_test gmock_main) | cxx_test(gmock-spec-builders_test gmock_main) | |||
cxx_test(gmock_link_test gmock_main test/gmock_link2_test.cc) | cxx_test(gmock_link_test gmock_main test/gmock_link2_test.cc) | |||
cxx_test(gmock_test gmock_main) | cxx_test(gmock_test gmock_main) | |||
if (DEFINED GTEST_HAS_PTHREAD) | if (DEFINED GTEST_HAS_PTHREAD) | |||
End of changes. 5 change blocks. | ||||
18 lines changed or deleted | 3 lines changed or added |