-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
58 lines (50 loc) · 1.32 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Copyright Jared Irwin 2020-2021
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)
cmake_minimum_required(VERSION 3.16.3)
project(macxx VERSION 0.0.0)
add_library(macxx INTERFACE)
add_library(macxx::macxx ALIAS macxx)
target_include_directories(macxx
INTERFACE
"include"
)
target_link_libraries(macxx
INTERFACE
objc
)
add_library(Foundation INTERFACE)
add_library(macxx::Foundation ALIAS Foundation)
target_link_libraries(Foundation
INTERFACE
macxx
"-framework Foundation"
)
if (MACXX_BUILD_TESTS)
Include(FetchContent)
FetchContent_Declare(
Catch2
GIT_REPOSITORY https://github.com/catchorg/Catch2.git
GIT_TAG v2.13.3
)
FetchContent_MakeAvailable(Catch2)
add_executable(test_app
tests/main.cpp
tests/Foundation/NSProcessInfo.cpp
)
set_target_properties(test_app
PROPERTIES
CXX_STANDARD 20
CXX_STANDARD_REQUIRED YES
CXX_EXTENSIONS NO
)
target_link_libraries(test_app
PRIVATE
Catch2::Catch2
macxx::Foundation
)
target_compile_definitions(test_app
PRIVATE
CATCH_CONFIG_NO_CPP17_UNCAUGHT_EXCEPTIONS
)
endif()