diff --git a/CMakeLists.txt b/CMakeLists.txt index 99047e58..71e0b9bc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,8 @@ CMAKE_MINIMUM_REQUIRED(VERSION 3.5 FATAL_ERROR) +# Allow specifying -D_ROOT +CMAKE_POLICY(SET CMP0074 NEW) + # ---[ Setup project PROJECT( cpuinfo @@ -129,6 +132,9 @@ SET(CONFU_DEPENDENCIES_BINARY_DIR ${CMAKE_BINARY_DIR}/deps IF(CPUINFO_SUPPORTED_PLATFORM AND (CPUINFO_BUILD_MOCK_TESTS OR CPUINFO_BUILD_UNIT_TESTS)) IF(USE_SYSTEM_GOOGLETEST) FIND_PACKAGE(GTest REQUIRED) + INCLUDE_DIRECTORIES(GTest::gtest) + SET(GOOGLETEST_LIB GTest::gtest) + SET(GOOGLETEST_MAIN_LIB GTest::gtest_main) ELSEIF(NOT DEFINED GOOGLETEST_SOURCE_DIR) MESSAGE(STATUS "Downloading Google Test to ${CONFU_DEPENDENCIES_SOURCE_DIR}/googletest (define GOOGLETEST_SOURCE_DIR to avoid it)") CONFIGURE_FILE(cmake/DownloadGoogleTest.cmake "${CONFU_DEPENDENCIES_BINARY_DIR}/googletest-download/CMakeLists.txt") @@ -137,12 +143,16 @@ IF(CPUINFO_SUPPORTED_PLATFORM AND (CPUINFO_BUILD_MOCK_TESTS OR CPUINFO_BUILD_UNI EXECUTE_PROCESS(COMMAND "${CMAKE_COMMAND}" --build . WORKING_DIRECTORY "${CONFU_DEPENDENCIES_BINARY_DIR}/googletest-download") SET(GOOGLETEST_SOURCE_DIR "${CONFU_DEPENDENCIES_SOURCE_DIR}/googletest" CACHE STRING "Google Test source directory") + SET(GOOGLETEST_LIB gtest) + SET(GOOGLETEST_MAIN_LIB gtest_main) ENDIF() ENDIF() IF(CPUINFO_SUPPORTED_PLATFORM AND CPUINFO_BUILD_BENCHMARKS) IF(USE_SYSTEM_GOOGLEBENCHMARK) FIND_PACKAGE(benchmark REQUIRED) + INCLUDE_DIRECTORIES(benchmark::benchmark) + SET(GOOGLEBENCHMARK_LIB benchmark::benchmark) ELSEIF(NOT DEFINED GOOGLEBENCHMARK_SOURCE_DIR) MESSAGE(STATUS "Downloading Google Benchmark to ${CONFU_DEPENDENCIES_SOURCE_DIR}/googlebenchmark (define GOOGLEBENCHMARK_SOURCE_DIR to avoid it)") CONFIGURE_FILE(cmake/DownloadGoogleBenchmark.cmake "${CONFU_DEPENDENCIES_BINARY_DIR}/googlebenchmark-download/CMakeLists.txt") @@ -151,6 +161,7 @@ IF(CPUINFO_SUPPORTED_PLATFORM AND CPUINFO_BUILD_BENCHMARKS) EXECUTE_PROCESS(COMMAND "${CMAKE_COMMAND}" --build . WORKING_DIRECTORY "${CONFU_DEPENDENCIES_BINARY_DIR}/googlebenchmark-download") SET(GOOGLEBENCHMARK_SOURCE_DIR "${CONFU_DEPENDENCIES_SOURCE_DIR}/googlebenchmark" CACHE STRING "Google Benchmark source directory") + SET(GOOGLEBENCHMARK_LIB benchmark) ENDIF() ENDIF() @@ -339,11 +350,11 @@ IF(CPUINFO_SUPPORTED_PLATFORM AND CPUINFO_BUILD_BENCHMARKS) IF(CMAKE_SYSTEM_NAME MATCHES "^(Linux|Android)$") ADD_EXECUTABLE(get-current-bench bench/get-current.cc) - TARGET_LINK_LIBRARIES(get-current-bench cpuinfo benchmark) + TARGET_LINK_LIBRARIES(get-current-bench cpuinfo ${GOOGLEBENCHMARK_LIB}) ENDIF() ADD_EXECUTABLE(init-bench bench/init.cc) - TARGET_LINK_LIBRARIES(init-bench cpuinfo benchmark) + TARGET_LINK_LIBRARIES(init-bench cpuinfo ${GOOGLEBENCHMARK_LIB}) ENDIF() IF(CPUINFO_SUPPORTED_PLATFORM) @@ -387,406 +398,406 @@ IF(CPUINFO_SUPPORTED_PLATFORM AND CPUINFO_BUILD_MOCK_TESTS) IF(CMAKE_SYSTEM_NAME STREQUAL "Android" AND CMAKE_SYSTEM_PROCESSOR MATCHES "^(armv5te|armv7-a)$") ADD_EXECUTABLE(atm7029b-tablet-test test/mock/atm7029b-tablet.cc) TARGET_INCLUDE_DIRECTORIES(atm7029b-tablet-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(atm7029b-tablet-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(atm7029b-tablet-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME atm7029b-tablet-test COMMAND atm7029b-tablet-test) ADD_EXECUTABLE(blu-r1-hd-test test/mock/blu-r1-hd.cc) TARGET_INCLUDE_DIRECTORIES(blu-r1-hd-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(blu-r1-hd-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(blu-r1-hd-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME blu-r1-hd-test COMMAND blu-r1-hd-test) ADD_EXECUTABLE(galaxy-a3-2016-eu-test test/mock/galaxy-a3-2016-eu.cc) TARGET_INCLUDE_DIRECTORIES(galaxy-a3-2016-eu-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(galaxy-a3-2016-eu-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(galaxy-a3-2016-eu-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME galaxy-a3-2016-eu-test COMMAND galaxy-a3-2016-eu-test) ADD_EXECUTABLE(galaxy-a8-2016-duos-test test/mock/galaxy-a8-2016-duos.cc) TARGET_INCLUDE_DIRECTORIES(galaxy-a8-2016-duos-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(galaxy-a8-2016-duos-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(galaxy-a8-2016-duos-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME galaxy-a8-2016-duos-test COMMAND galaxy-a8-2016-duos-test) ADD_EXECUTABLE(galaxy-grand-prime-value-edition-test test/mock/galaxy-grand-prime-value-edition.cc) TARGET_INCLUDE_DIRECTORIES(galaxy-grand-prime-value-edition-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(galaxy-grand-prime-value-edition-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(galaxy-grand-prime-value-edition-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME galaxy-grand-prime-value-edition-test COMMAND galaxy-grand-prime-value-edition-test) ADD_EXECUTABLE(galaxy-j1-2016-test test/mock/galaxy-j1-2016.cc) TARGET_INCLUDE_DIRECTORIES(galaxy-j1-2016-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(galaxy-j1-2016-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(galaxy-j1-2016-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME galaxy-j1-2016-test COMMAND galaxy-j1-2016-test) ADD_EXECUTABLE(galaxy-j5-test test/mock/galaxy-j5.cc) TARGET_INCLUDE_DIRECTORIES(galaxy-j5-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(galaxy-j5-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(galaxy-j5-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME galaxy-j5-test COMMAND galaxy-j5-test) ADD_EXECUTABLE(galaxy-j7-prime-test test/mock/galaxy-j7-prime.cc) TARGET_INCLUDE_DIRECTORIES(galaxy-j7-prime-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(galaxy-j7-prime-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(galaxy-j7-prime-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME galaxy-j7-prime-test COMMAND galaxy-j7-prime-test) ADD_EXECUTABLE(galaxy-j7-tmobile-test test/mock/galaxy-j7-tmobile.cc) TARGET_INCLUDE_DIRECTORIES(galaxy-j7-tmobile-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(galaxy-j7-tmobile-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(galaxy-j7-tmobile-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME galaxy-j7-tmobile-test COMMAND galaxy-j7-tmobile-test) ADD_EXECUTABLE(galaxy-j7-uae-test test/mock/galaxy-j7-uae.cc) TARGET_INCLUDE_DIRECTORIES(galaxy-j7-uae-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(galaxy-j7-uae-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(galaxy-j7-uae-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME galaxy-j7-uae-test COMMAND galaxy-j7-uae-test) ADD_EXECUTABLE(galaxy-s3-us-test test/mock/galaxy-s3-us.cc) TARGET_INCLUDE_DIRECTORIES(galaxy-s3-us-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(galaxy-s3-us-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(galaxy-s3-us-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME galaxy-s3-us-test COMMAND galaxy-s3-us-test) ADD_EXECUTABLE(galaxy-s4-us-test test/mock/galaxy-s4-us.cc) TARGET_INCLUDE_DIRECTORIES(galaxy-s4-us-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(galaxy-s4-us-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(galaxy-s4-us-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME galaxy-s4-us-test COMMAND galaxy-s4-us-test) ADD_EXECUTABLE(galaxy-s5-global-test test/mock/galaxy-s5-global.cc) TARGET_INCLUDE_DIRECTORIES(galaxy-s5-global-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(galaxy-s5-global-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(galaxy-s5-global-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME galaxy-s5-global-test COMMAND galaxy-s5-global-test) ADD_EXECUTABLE(galaxy-s5-us-test test/mock/galaxy-s5-us.cc) TARGET_INCLUDE_DIRECTORIES(galaxy-s5-us-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(galaxy-s5-us-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(galaxy-s5-us-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME galaxy-s5-us-test COMMAND galaxy-s5-us-test) ADD_EXECUTABLE(galaxy-tab-3-7.0-test test/mock/galaxy-tab-3-7.0.cc) TARGET_INCLUDE_DIRECTORIES(galaxy-tab-3-7.0-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(galaxy-tab-3-7.0-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(galaxy-tab-3-7.0-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME galaxy-tab-3-7.0-test COMMAND galaxy-tab-3-7.0-test) ADD_EXECUTABLE(galaxy-tab-3-lite-test test/mock/galaxy-tab-3-lite.cc) TARGET_INCLUDE_DIRECTORIES(galaxy-tab-3-lite-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(galaxy-tab-3-lite-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(galaxy-tab-3-lite-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME galaxy-tab-3-lite-test COMMAND galaxy-tab-3-lite-test) ADD_EXECUTABLE(galaxy-win-duos-test test/mock/galaxy-win-duos.cc) TARGET_INCLUDE_DIRECTORIES(galaxy-win-duos-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(galaxy-win-duos-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(galaxy-win-duos-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME galaxy-win-duos-test COMMAND galaxy-win-duos-test) ADD_EXECUTABLE(huawei-ascend-p7-test test/mock/huawei-ascend-p7.cc) TARGET_INCLUDE_DIRECTORIES(huawei-ascend-p7-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(huawei-ascend-p7-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(huawei-ascend-p7-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME huawei-ascend-p7-test COMMAND huawei-ascend-p7-test) ADD_EXECUTABLE(huawei-honor-6-test test/mock/huawei-honor-6.cc) TARGET_INCLUDE_DIRECTORIES(huawei-honor-6-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(huawei-honor-6-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(huawei-honor-6-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME huawei-honor-6-test COMMAND huawei-honor-6-test) ADD_EXECUTABLE(lenovo-a6600-plus-test test/mock/lenovo-a6600-plus.cc) TARGET_INCLUDE_DIRECTORIES(lenovo-a6600-plus-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(lenovo-a6600-plus-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(lenovo-a6600-plus-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME lenovo-a6600-plus-test COMMAND lenovo-a6600-plus-test) ADD_EXECUTABLE(lenovo-vibe-x2-test test/mock/lenovo-vibe-x2.cc) TARGET_INCLUDE_DIRECTORIES(lenovo-vibe-x2-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(lenovo-vibe-x2-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(lenovo-vibe-x2-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME lenovo-vibe-x2-test COMMAND lenovo-vibe-x2-test) ADD_EXECUTABLE(lg-k10-eu-test test/mock/lg-k10-eu.cc) TARGET_INCLUDE_DIRECTORIES(lg-k10-eu-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(lg-k10-eu-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(lg-k10-eu-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME lg-k10-eu-test COMMAND lg-k10-eu-test) ADD_EXECUTABLE(lg-optimus-g-pro-test test/mock/lg-optimus-g-pro.cc) TARGET_INCLUDE_DIRECTORIES(lg-optimus-g-pro-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(lg-optimus-g-pro-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(lg-optimus-g-pro-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME lg-optimus-g-pro-test COMMAND lg-optimus-g-pro-test) ADD_EXECUTABLE(moto-e-gen1-test test/mock/moto-e-gen1.cc) TARGET_INCLUDE_DIRECTORIES(moto-e-gen1-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(moto-e-gen1-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(moto-e-gen1-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME moto-e-gen1-test COMMAND moto-e-gen1-test) ADD_EXECUTABLE(moto-g-gen1-test test/mock/moto-g-gen1.cc) TARGET_INCLUDE_DIRECTORIES(moto-g-gen1-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(moto-g-gen1-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(moto-g-gen1-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME moto-g-gen1-test COMMAND moto-g-gen1-test) ADD_EXECUTABLE(moto-g-gen2-test test/mock/moto-g-gen2.cc) TARGET_INCLUDE_DIRECTORIES(moto-g-gen2-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(moto-g-gen2-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(moto-g-gen2-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME moto-g-gen2-test COMMAND moto-g-gen2-test) ADD_EXECUTABLE(moto-g-gen3-test test/mock/moto-g-gen3.cc) TARGET_INCLUDE_DIRECTORIES(moto-g-gen3-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(moto-g-gen3-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(moto-g-gen3-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME moto-g-gen3-test COMMAND moto-g-gen3-test) ADD_EXECUTABLE(moto-g-gen4-test test/mock/moto-g-gen4.cc) TARGET_INCLUDE_DIRECTORIES(moto-g-gen4-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(moto-g-gen4-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(moto-g-gen4-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME moto-g-gen4-test COMMAND moto-g-gen4-test) ADD_EXECUTABLE(moto-g-gen5-test test/mock/moto-g-gen5.cc) TARGET_INCLUDE_DIRECTORIES(moto-g-gen5-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(moto-g-gen5-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(moto-g-gen5-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME moto-g-gen5-test COMMAND moto-g-gen5-test) ADD_EXECUTABLE(nexus-s-test test/mock/nexus-s.cc) TARGET_INCLUDE_DIRECTORIES(nexus-s-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(nexus-s-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(nexus-s-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME nexus-s-test COMMAND nexus-s-test) ADD_EXECUTABLE(nexus4-test test/mock/nexus4.cc) TARGET_INCLUDE_DIRECTORIES(nexus4-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(nexus4-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(nexus4-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME nexus4-test COMMAND nexus4-test) ADD_EXECUTABLE(nexus6-test test/mock/nexus6.cc) TARGET_INCLUDE_DIRECTORIES(nexus6-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(nexus6-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(nexus6-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME nexus6-test COMMAND nexus6-test) ADD_EXECUTABLE(nexus10-test test/mock/nexus10.cc) TARGET_INCLUDE_DIRECTORIES(nexus10-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(nexus10-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(nexus10-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME nexus10-test COMMAND nexus10-test) ADD_EXECUTABLE(padcod-10.1-test test/mock/padcod-10.1.cc) TARGET_INCLUDE_DIRECTORIES(padcod-10.1-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(padcod-10.1-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(padcod-10.1-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME padcod-10.1-test COMMAND padcod-10.1-test) ADD_EXECUTABLE(xiaomi-redmi-2a-test test/mock/xiaomi-redmi-2a.cc) TARGET_INCLUDE_DIRECTORIES(xiaomi-redmi-2a-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(xiaomi-redmi-2a-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(xiaomi-redmi-2a-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME xiaomi-redmi-2a-test COMMAND xiaomi-redmi-2a-test) ADD_EXECUTABLE(xperia-sl-test test/mock/xperia-sl.cc) TARGET_INCLUDE_DIRECTORIES(xperia-sl-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(xperia-sl-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(xperia-sl-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME xperia-sl-test COMMAND xperia-sl-test) ENDIF() IF(CMAKE_SYSTEM_NAME STREQUAL "Android" AND CMAKE_SYSTEM_PROCESSOR MATCHES "^(armv5te|armv7-a|aarch64)$") ADD_EXECUTABLE(alcatel-revvl-test test/mock/alcatel-revvl.cc) TARGET_INCLUDE_DIRECTORIES(alcatel-revvl-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(alcatel-revvl-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(alcatel-revvl-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME alcatel-revvl-test COMMAND alcatel-revvl-test) ADD_EXECUTABLE(galaxy-a8-2018-test test/mock/galaxy-a8-2018.cc) TARGET_INCLUDE_DIRECTORIES(galaxy-a8-2018-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(galaxy-a8-2018-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(galaxy-a8-2018-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME galaxy-a8-2018-test COMMAND galaxy-a8-2018-test) ADD_EXECUTABLE(galaxy-c9-pro-test test/mock/galaxy-c9-pro.cc) TARGET_INCLUDE_DIRECTORIES(galaxy-c9-pro-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(galaxy-c9-pro-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(galaxy-c9-pro-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME galaxy-c9-pro-test COMMAND galaxy-c9-pro-test) ADD_EXECUTABLE(galaxy-s6-test test/mock/galaxy-s6.cc) TARGET_INCLUDE_DIRECTORIES(galaxy-s6-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(galaxy-s6-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(galaxy-s6-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME galaxy-s6-test COMMAND galaxy-s6-test) ADD_EXECUTABLE(galaxy-s7-us-test test/mock/galaxy-s7-us.cc) TARGET_INCLUDE_DIRECTORIES(galaxy-s7-us-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(galaxy-s7-us-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(galaxy-s7-us-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME galaxy-s7-us-test COMMAND galaxy-s7-us-test) ADD_EXECUTABLE(galaxy-s7-global-test test/mock/galaxy-s7-global.cc) TARGET_INCLUDE_DIRECTORIES(galaxy-s7-global-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(galaxy-s7-global-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(galaxy-s7-global-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME galaxy-s7-global-test COMMAND galaxy-s7-global-test) ADD_EXECUTABLE(galaxy-s8-us-test test/mock/galaxy-s8-us.cc) TARGET_INCLUDE_DIRECTORIES(galaxy-s8-us-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(galaxy-s8-us-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(galaxy-s8-us-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME galaxy-s8-us-test COMMAND galaxy-s8-us-test) ADD_EXECUTABLE(galaxy-s8-global-test test/mock/galaxy-s8-global.cc) TARGET_INCLUDE_DIRECTORIES(galaxy-s8-global-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(galaxy-s8-global-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(galaxy-s8-global-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME galaxy-s8-global-test COMMAND galaxy-s8-global-test) ADD_EXECUTABLE(galaxy-s9-us-test test/mock/galaxy-s9-us.cc) TARGET_INCLUDE_DIRECTORIES(galaxy-s9-us-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(galaxy-s9-us-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(galaxy-s9-us-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME galaxy-s9-us-test COMMAND galaxy-s9-us-test) ADD_EXECUTABLE(galaxy-s9-global-test test/mock/galaxy-s9-global.cc) TARGET_INCLUDE_DIRECTORIES(galaxy-s9-global-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(galaxy-s9-global-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(galaxy-s9-global-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME galaxy-s9-global-test COMMAND galaxy-s9-global-test) ADD_EXECUTABLE(huawei-mate-8-test test/mock/huawei-mate-8.cc) TARGET_INCLUDE_DIRECTORIES(huawei-mate-8-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(huawei-mate-8-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(huawei-mate-8-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME huawei-mate-8-test COMMAND huawei-mate-8-test) ADD_EXECUTABLE(huawei-mate-9-test test/mock/huawei-mate-9.cc) TARGET_INCLUDE_DIRECTORIES(huawei-mate-9-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(huawei-mate-9-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(huawei-mate-9-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME huawei-mate-9-test COMMAND huawei-mate-9-test) ADD_EXECUTABLE(huawei-mate-10-test test/mock/huawei-mate-10.cc) TARGET_INCLUDE_DIRECTORIES(huawei-mate-10-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(huawei-mate-10-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(huawei-mate-10-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME huawei-mate-10-test COMMAND huawei-mate-10-test) ADD_EXECUTABLE(huawei-mate-20-test test/mock/huawei-mate-20.cc) TARGET_INCLUDE_DIRECTORIES(huawei-mate-20-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(huawei-mate-20-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(huawei-mate-20-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME huawei-mate-20-test COMMAND huawei-mate-20-test) ADD_EXECUTABLE(huawei-p8-lite-test test/mock/huawei-p8-lite.cc) TARGET_INCLUDE_DIRECTORIES(huawei-p8-lite-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(huawei-p8-lite-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(huawei-p8-lite-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME huawei-p8-lite-test COMMAND huawei-p8-lite-test) ADD_EXECUTABLE(huawei-p9-lite-test test/mock/huawei-p9-lite.cc) TARGET_INCLUDE_DIRECTORIES(huawei-p9-lite-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(huawei-p9-lite-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(huawei-p9-lite-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME huawei-p9-lite-test COMMAND huawei-p9-lite-test) ADD_EXECUTABLE(huawei-p20-pro-test test/mock/huawei-p20-pro.cc) TARGET_INCLUDE_DIRECTORIES(huawei-p20-pro-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(huawei-p20-pro-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(huawei-p20-pro-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME huawei-p20-pro-test COMMAND huawei-p20-pro-test) ADD_EXECUTABLE(iconia-one-10-test test/mock/iconia-one-10.cc) TARGET_INCLUDE_DIRECTORIES(iconia-one-10-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(iconia-one-10-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(iconia-one-10-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME iconia-one-10-test COMMAND iconia-one-10-test) ADD_EXECUTABLE(meizu-pro-6-test test/mock/meizu-pro-6.cc) TARGET_INCLUDE_DIRECTORIES(meizu-pro-6-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(meizu-pro-6-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(meizu-pro-6-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME meizu-pro-6-test COMMAND meizu-pro-6-test) ADD_EXECUTABLE(meizu-pro-6s-test test/mock/meizu-pro-6s.cc) TARGET_INCLUDE_DIRECTORIES(meizu-pro-6s-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(meizu-pro-6s-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(meizu-pro-6s-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME meizu-pro-6s-test COMMAND meizu-pro-6s-test) ADD_EXECUTABLE(meizu-pro-7-plus-test test/mock/meizu-pro-7-plus.cc) TARGET_INCLUDE_DIRECTORIES(meizu-pro-7-plus-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(meizu-pro-7-plus-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(meizu-pro-7-plus-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME meizu-pro-7-plus-test COMMAND meizu-pro-7-plus-test) ADD_EXECUTABLE(nexus5x-test test/mock/nexus5x.cc) TARGET_INCLUDE_DIRECTORIES(nexus5x-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(nexus5x-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(nexus5x-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME nexus5x-test COMMAND nexus5x-test) ADD_EXECUTABLE(nexus6p-test test/mock/nexus6p.cc) TARGET_INCLUDE_DIRECTORIES(nexus6p-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(nexus6p-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(nexus6p-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME nexus6p-test COMMAND nexus6p-test) ADD_EXECUTABLE(nexus9-test test/mock/nexus9.cc) TARGET_INCLUDE_DIRECTORIES(nexus9-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(nexus9-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(nexus9-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME nexus9-test COMMAND nexus9-test) ADD_EXECUTABLE(oneplus-3t-test test/mock/oneplus-3t.cc) TARGET_INCLUDE_DIRECTORIES(oneplus-3t-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(oneplus-3t-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(oneplus-3t-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME oneplus-3t-test COMMAND oneplus-3t-test) ADD_EXECUTABLE(oneplus-5-test test/mock/oneplus-5.cc) TARGET_INCLUDE_DIRECTORIES(oneplus-5-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(oneplus-5-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(oneplus-5-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME oneplus-5-test COMMAND oneplus-5-test) ADD_EXECUTABLE(oneplus-5t-test test/mock/oneplus-5t.cc) TARGET_INCLUDE_DIRECTORIES(oneplus-5t-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(oneplus-5t-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(oneplus-5t-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME oneplus-5t-test COMMAND oneplus-5t-test) ADD_EXECUTABLE(oppo-a37-test test/mock/oppo-a37.cc) TARGET_INCLUDE_DIRECTORIES(oppo-a37-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(oppo-a37-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(oppo-a37-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME oppo-a37-test COMMAND oppo-a37-test) ADD_EXECUTABLE(oppo-r9-test test/mock/oppo-r9.cc) TARGET_INCLUDE_DIRECTORIES(oppo-r9-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(oppo-r9-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(oppo-r9-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME oppo-r9-test COMMAND oppo-r9-test) ADD_EXECUTABLE(oppo-r15-test test/mock/oppo-r15.cc) TARGET_INCLUDE_DIRECTORIES(oppo-r15-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(oppo-r15-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(oppo-r15-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME oppo-r15-test COMMAND oppo-r15-test) ADD_EXECUTABLE(pixel-test test/mock/pixel.cc) TARGET_INCLUDE_DIRECTORIES(pixel-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(pixel-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(pixel-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME pixel-test COMMAND pixel-test) ADD_EXECUTABLE(pixel-c-test test/mock/pixel-c.cc) TARGET_INCLUDE_DIRECTORIES(pixel-c-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(pixel-c-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(pixel-c-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME pixel-c-test COMMAND pixel-c-test) ADD_EXECUTABLE(pixel-xl-test test/mock/pixel-xl.cc) TARGET_INCLUDE_DIRECTORIES(pixel-xl-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(pixel-xl-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(pixel-xl-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME pixel-xl-test COMMAND pixel-xl-test) ADD_EXECUTABLE(pixel-2-xl-test test/mock/pixel-2-xl.cc) TARGET_INCLUDE_DIRECTORIES(pixel-2-xl-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(pixel-2-xl-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(pixel-2-xl-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME pixel-2-xl-test COMMAND pixel-2-xl-test) ADD_EXECUTABLE(xiaomi-mi-5c-test test/mock/xiaomi-mi-5c.cc) TARGET_INCLUDE_DIRECTORIES(xiaomi-mi-5c-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(xiaomi-mi-5c-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(xiaomi-mi-5c-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME xiaomi-mi-5c-test COMMAND xiaomi-mi-5c-test) ADD_EXECUTABLE(xiaomi-redmi-note-3-test test/mock/xiaomi-redmi-note-3.cc) TARGET_INCLUDE_DIRECTORIES(xiaomi-redmi-note-3-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(xiaomi-redmi-note-3-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(xiaomi-redmi-note-3-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME xiaomi-redmi-note-3-test COMMAND xiaomi-redmi-note-3-test) ADD_EXECUTABLE(xiaomi-redmi-note-4-test test/mock/xiaomi-redmi-note-4.cc) TARGET_INCLUDE_DIRECTORIES(xiaomi-redmi-note-4-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(xiaomi-redmi-note-4-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(xiaomi-redmi-note-4-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME xiaomi-redmi-note-4-test COMMAND xiaomi-redmi-note-4-test) ADD_EXECUTABLE(xperia-c4-dual-test test/mock/xperia-c4-dual.cc) TARGET_INCLUDE_DIRECTORIES(xperia-c4-dual-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(xperia-c4-dual-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(xperia-c4-dual-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME xperia-c4-dual-test COMMAND xperia-c4-dual-test) ENDIF() IF(CMAKE_SYSTEM_NAME STREQUAL "Android" AND CMAKE_SYSTEM_PROCESSOR MATCHES "^(i686|x86_64)$") ADD_EXECUTABLE(alldocube-iwork8-test test/mock/alldocube-iwork8.cc) TARGET_INCLUDE_DIRECTORIES(alldocube-iwork8-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(alldocube-iwork8-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(alldocube-iwork8-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME alldocube-iwork8-test COMMAND alldocube-iwork8-test) ADD_EXECUTABLE(leagoo-t5c-test test/mock/leagoo-t5c.cc) TARGET_INCLUDE_DIRECTORIES(leagoo-t5c-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(leagoo-t5c-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(leagoo-t5c-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME leagoo-t5c-test COMMAND leagoo-t5c-test) ADD_EXECUTABLE(memo-pad-7-test test/mock/memo-pad-7.cc) TARGET_INCLUDE_DIRECTORIES(memo-pad-7-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(memo-pad-7-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(memo-pad-7-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME memo-pad-7-test COMMAND memo-pad-7-test) ADD_EXECUTABLE(zenfone-c-test test/mock/zenfone-c.cc) TARGET_INCLUDE_DIRECTORIES(zenfone-c-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(zenfone-c-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(zenfone-c-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME zenfone-c-test COMMAND zenfone-c-test) ADD_EXECUTABLE(zenfone-2-test test/mock/zenfone-2.cc) TARGET_INCLUDE_DIRECTORIES(zenfone-2-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(zenfone-2-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(zenfone-2-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME zenfone-2-test COMMAND zenfone-2-test) ADD_EXECUTABLE(zenfone-2e-test test/mock/zenfone-2e.cc) TARGET_INCLUDE_DIRECTORIES(zenfone-2e-test BEFORE PRIVATE test/mock) - TARGET_LINK_LIBRARIES(zenfone-2e-test PRIVATE cpuinfo_mock gtest) + TARGET_LINK_LIBRARIES(zenfone-2e-test PRIVATE cpuinfo_mock ${GOOGLETEST_LIB}) ADD_TEST(NAME zenfone-2e-test COMMAND zenfone-2e-test) ENDIF() ENDIF() @@ -796,14 +807,14 @@ IF(CPUINFO_SUPPORTED_PLATFORM AND CPUINFO_BUILD_UNIT_TESTS) ADD_EXECUTABLE(init-test test/init.cc) CPUINFO_TARGET_ENABLE_CXX11(init-test) CPUINFO_TARGET_RUNTIME_LIBRARY(init-test) - TARGET_LINK_LIBRARIES(init-test PRIVATE cpuinfo gtest gtest_main) + TARGET_LINK_LIBRARIES(init-test PRIVATE cpuinfo ${GOOGLETEST_LIB} ${GOOGLETEST_MAIN_LIB}) ADD_TEST(NAME init-test COMMAND init-test) IF(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "Android") ADD_EXECUTABLE(get-current-test test/get-current.cc) CPUINFO_TARGET_ENABLE_CXX11(get-current-test) CPUINFO_TARGET_RUNTIME_LIBRARY(get-current-test) - TARGET_LINK_LIBRARIES(get-current-test PRIVATE cpuinfo gtest gtest_main) + TARGET_LINK_LIBRARIES(get-current-test PRIVATE cpuinfo ${GOOGLETEST_LIB} ${GOOGLETEST_MAIN_LIB}) ADD_TEST(NAME get-current-test COMMAND get-current-test) ENDIF() @@ -811,7 +822,7 @@ IF(CPUINFO_SUPPORTED_PLATFORM AND CPUINFO_BUILD_UNIT_TESTS) ADD_EXECUTABLE(brand-string-test test/name/brand-string.cc) CPUINFO_TARGET_ENABLE_CXX11(brand-string-test) CPUINFO_TARGET_RUNTIME_LIBRARY(brand-string-test) - TARGET_LINK_LIBRARIES(brand-string-test PRIVATE cpuinfo_internals gtest gtest_main) + TARGET_LINK_LIBRARIES(brand-string-test PRIVATE cpuinfo_internals ${GOOGLETEST_LIB} ${GOOGLETEST_MAIN_LIB}) ADD_TEST(NAME brand-string-test COMMAND brand-string-test) ENDIF() @@ -831,14 +842,14 @@ IF(CPUINFO_SUPPORTED_PLATFORM AND CPUINFO_BUILD_UNIT_TESTS) test/name/android-properties.cc) CPUINFO_TARGET_ENABLE_CXX11(chipset-test) CPUINFO_TARGET_RUNTIME_LIBRARY(chipset-test) - TARGET_LINK_LIBRARIES(chipset-test PRIVATE android_properties_interface gtest gtest_main) + TARGET_LINK_LIBRARIES(chipset-test PRIVATE android_properties_interface ${GOOGLETEST_LIB} ${GOOGLETEST_MAIN_LIB}) ADD_TEST(NAME chipset-test COMMAND chipset-test) ADD_EXECUTABLE(cache-test test/arm-cache.cc) CPUINFO_TARGET_ENABLE_CXX11(cache-test) CPUINFO_TARGET_RUNTIME_LIBRARY(cache-test) TARGET_COMPILE_DEFINITIONS(cache-test PRIVATE __STDC_LIMIT_MACROS=1 __STDC_CONSTANT_MACROS=1) - TARGET_LINK_LIBRARIES(cache-test PRIVATE cpuinfo_internals gtest gtest_main) + TARGET_LINK_LIBRARIES(cache-test PRIVATE cpuinfo_internals ${GOOGLETEST_LIB} ${GOOGLETEST_MAIN_LIB}) ADD_TEST(NAME cache-test COMMAND cache-test) ENDIF() ENDIF()