-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
61 lines (52 loc) · 1.59 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
59
60
61
cmake_minimum_required(VERSION 3.25)
project(gram_grep
DESCRIPTION "gram_grep: grep for the 21st century"
HOMEPAGE_URL "http://benhanson.net/gram_grep.html"
LANGUAGES CXX
)
if(ENABLE_ASAN)
if(WIN32)
string(REPLACE " /RTC1" "" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}")
string(REPLACE "/RTC1 " "" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}")
string(REPLACE " /RTC1" "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
string(REPLACE "/RTC1 " "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
string(APPEND CMAKE_CXX_FLAGS_DEBUG " /fsanitize=address")
else()
string(APPEND CMAKE_CXX_FLAGS_DEBUG " -fsanitize=address")
endif()
endif()
message(STATUS "CMAKE_CXX_FLAGS_DEBUG: ${CMAKE_CXX_FLAGS_DEBUG}")
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(target_name gram_grep)
set(SOURCES
args.cpp
$<$<BOOL:${WIN32}>:
gram_grep.rc>
main.cpp
output.cpp
parser.cpp
search.cpp
types.cpp
)
set(HEADERS
args.hpp
colours.hpp
gg_error.hpp
option.hpp
output.hpp
parser.hpp
search.hpp
types.hpp
$<$<BOOL:${WIN32}>:
resource.h>
version.hpp
)
if(WIN32)
# Set the gram_grep project as the default in the solution file
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT gram_grep)
endif()
include_directories(${target_name} PRIVATE "../lexertl17/include")
include_directories(${target_name} PRIVATE "../parsertl17/include")
include_directories(${target_name} PRIVATE "../wildcardtl/include")
add_executable(${target_name} ${SOURCES} ${HEADERS})