-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathCMakeLists.txt
42 lines (34 loc) · 1.06 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# Copyright (c) 2014-2016, Ruslan Baratov
# All rights reserved.
cmake_minimum_required(VERSION 3.2)
### Hunter snapshot that will be used ###
include("cmake/HunterGate.cmake")
HunterGate(
URL "https://github.com/ruslo/hunter/archive/v0.23.111.tar.gz"
SHA1 "4189bbd869abe4eb69b5303d3f916c03d34dc154"
)
project(HunterSimple)
### Download dependencies ###
hunter_add_package(GTest)
### Find dependencies ###
find_package(GTest CONFIG REQUIRED) # GTest::main
### Targets ###
add_executable(simple simple.cpp)
target_link_libraries(simple PUBLIC GTest::main)
### Testing ###
enable_testing()
if(IOS)
# Extra cmake modules needed for iOS testing:
# * https://github.com/ruslo/sugar/tree/master/cmake/core#sugar_add_ios_gtest
add_test(
NAME SimpleTest COMMAND "${CMAKE_COMMAND}" -E echo "iOS testing ignored"
)
elseif(ANDROID)
# Building .apk, testing: https://github.com/forexample/android-cmake
add_test(
NAME SimpleTest
COMMAND "${CMAKE_COMMAND}" -E echo "Android testing ignored"
)
else()
add_test(NAME SimpleTest COMMAND simple)
endif()