-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
37 lines (30 loc) · 1.27 KB
/
Copy pathCMakeLists.txt
File metadata and controls
37 lines (30 loc) · 1.27 KB
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
# Copyright (C) 2025 Tyopo131
# SPDX-License-Identifier: LGPL-3.0-only
cmake_minimum_required(VERSION 3.31.6)
option(COMPILE_AS_SHARED_LIBRARY "Compile as a shared library (.dll, .so, .dylib) if on, compile as a static library (.lib, .a) if off (default OFF)" OFF)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
project(terminate LANGUAGES CXX)
set(SRC
"src/clear.cpp"
"include/terminate/asciicodes.h"
"include/terminate/libinfo.h"
"include/terminate/clear.h"
"include/terminate/cursor.h"
"src/cursor.cpp"
"include/terminate/terminalpos.h"
"src/terminalpos.cpp"
)
if (COMPILE_AS_SHARED_LIBRARY)
add_library(terminate SHARED ${SRC})
set_target_properties(terminate PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON)
message(STATUS "Will compile as a shared library. (.dll, .so, .dylib)")
else()
add_library(terminate STATIC ${SRC})
message(STATUS "Will compile as a static library. (.lib, .a)")
endif()
target_include_directories(terminate PRIVATE "include/terminate/")
target_include_directories(terminate PRIVATE "include/")
add_executable(ExampleProject example/example.cpp)
target_include_directories(ExampleProject PRIVATE "include/")
target_link_libraries(ExampleProject PUBLIC terminate)