-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
52 lines (42 loc) · 971 Bytes
/
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
# How to use with mingw: (Windows)
# cmake -S . -B Build -G "MinGW Makefiles"
# cd Build
# mingw32-make
# How to use with msys2: (Windows)
# cmake -S . -B Build -G "MSYS Makefiles"
# cd Build
# make
cmake_minimum_required(VERSION 3.10)
set(CMAKE_CXX_COMPILER "g++")
set(CMAKE_C_COMPILER "gcc")
project(
tests
VERSION 1.0
LANGUAGES CXX C
)
find_package(Threads REQUIRED)
add_executable(tests
stringslib.c
tests.cc
googletest/googletest/src/gtest-all.cc
)
target_include_directories(tests
PRIVATE
"${CMAKE_CURRENT_SOURCE_DIR}/googletest/googletest/include"
"${CMAKE_CURRENT_SOURCE_DIR}/googletest/googletest"
)
target_link_libraries(tests
PRIVATE
Threads::Threads
# Add other libraries if needed
)
target_compile_options(tests
PRIVATE
-Wall -Wextra -pedantic -g -O2
)
set_target_properties(tests
PROPERTIES
CXX_STANDARD 17
CXX_EXTENSIONS OFF
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
)