aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorredfish <redfish@galactica.pw>2016-08-29 13:56:34 -0400
committerredfish <redfish@galactica.pw>2016-08-30 23:04:53 -0400
commit640a934d5f6163f1069dda933c590bf463d0d5d1 (patch)
tree6810f4649e2e84817378480d1ec4d7b2e7ad27b1 /tests
parenttests: cmake: use a list for enabled tests (diff)
downloadmonero-640a934d5f6163f1069dda933c590bf463d0d5d1.tar.xz
tests: cmake: fix building with system gtest
Issues #980 #983
Diffstat (limited to 'tests')
-rw-r--r--tests/CMakeLists.txt7
-rw-r--r--tests/daemon_tests/CMakeLists.txt2
-rw-r--r--tests/libwallet_api_tests/CMakeLists.txt2
-rw-r--r--tests/net_load_tests/CMakeLists.txt4
-rw-r--r--tests/unit_tests/CMakeLists.txt2
5 files changed, 9 insertions, 8 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 9f546590c..33d6c233d 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -42,21 +42,22 @@ find_package(GTest)
if (GTest_FOUND)
include_directories(SYSTEM ${GTEST_INCLUDE_DIRS})
else ()
+ message(STATUS "GTest not found on the system: will use GTest bundled with this source")
add_subdirectory(gtest)
include_directories(SYSTEM "${gtest_SOURCE_DIR}/include" "${gtest_SOURCE_DIR}")
# Emulate the FindGTest module's variable.
- set(GTEST_MAIN_LIBRARIES gtest_main)
+ set(GTEST_LIBRARIES gtest)
# Ignore some warnings when building gtest binaries.
if(NOT MSVC)
- set_property(TARGET gtest gtest_main
+ set_property(TARGET gtest
APPEND_STRING
PROPERTY
COMPILE_FLAGS " -Wno-undef -Wno-sign-compare")
endif()
- set_property(TARGET gtest gtest_main
+ set_property(TARGET gtest
PROPERTY
FOLDER "${folder}")
endif ()
diff --git a/tests/daemon_tests/CMakeLists.txt b/tests/daemon_tests/CMakeLists.txt
index 25ca09ce4..ae11ab5d5 100644
--- a/tests/daemon_tests/CMakeLists.txt
+++ b/tests/daemon_tests/CMakeLists.txt
@@ -42,7 +42,7 @@ target_link_libraries(transfers
crypto
common
epee
- ${GTEST_MAIN_LIBRARIES}
+ ${GTEST_LIBRARIES}
${Boost_LIBRARIES})
file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/test_transfers")
diff --git a/tests/libwallet_api_tests/CMakeLists.txt b/tests/libwallet_api_tests/CMakeLists.txt
index e60947084..416192cce 100644
--- a/tests/libwallet_api_tests/CMakeLists.txt
+++ b/tests/libwallet_api_tests/CMakeLists.txt
@@ -40,7 +40,7 @@ add_executable(libwallet_api_tests
target_link_libraries(libwallet_api_tests
LINK_PRIVATE
wallet
- ${GTEST_MAIN_LIBRARIES}
+ ${GTEST_LIBRARIES}
${EXTRA_LIBRARIES})
set_property(TARGET libwallet_api_tests
diff --git a/tests/net_load_tests/CMakeLists.txt b/tests/net_load_tests/CMakeLists.txt
index c3a68d18d..2c97acf51 100644
--- a/tests/net_load_tests/CMakeLists.txt
+++ b/tests/net_load_tests/CMakeLists.txt
@@ -40,7 +40,7 @@ target_link_libraries(net_load_tests_clt
otshell_utils
p2p
cryptonote_core
- ${GTEST_MAIN_LIBRARIES}
+ ${GTEST_LIBRARIES}
${Boost_CHRONO_LIBRARY}
${Boost_DATE_TIME_LIBRARY}
${Boost_FILESYSTEM_LIBRARY}
@@ -62,7 +62,7 @@ target_link_libraries(net_load_tests_srv
otshell_utils
p2p
cryptonote_core
- ${GTEST_MAIN_LIBRARIES}
+ ${GTEST_LIBRARIES}
${Boost_CHRONO_LIBRARY}
${Boost_DATE_TIME_LIBRARY}
${Boost_FILESYSTEM_LIBRARY}
diff --git a/tests/unit_tests/CMakeLists.txt b/tests/unit_tests/CMakeLists.txt
index 3d42809e3..d36c2748c 100644
--- a/tests/unit_tests/CMakeLists.txt
+++ b/tests/unit_tests/CMakeLists.txt
@@ -69,7 +69,7 @@ target_link_libraries(unit_tests
rpc
wallet
p2p
- ${GTEST_MAIN_LIBRARIES}
+ ${GTEST_LIBRARIES}
${Boost_CHRONO_LIBRARY}
${Boost_REGEX_LIBRARY}
${Boost_SYSTEM_LIBRARY}