-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
51 lines (39 loc) · 1.24 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
cmake_minimum_required(VERSION 3.10)
project(ANSI_SGR2HTML VERSION 1.0.0 DESCRIPTION "Basic ANSI Select Graphic Rendition Control Sequence to HTML library.")
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(LIBRARY_SRCS
# src/ansi_sgr2html.h
src/ansi_esc2html.cpp
)
add_library(ANSIEsc2HTML SHARED
"${LIBRARY_SRCS}"
)
add_library(ANSIEsc2HTML_static STATIC
"${LIBRARY_SRCS}"
)
add_executable(tests
EXCLUDE_FROM_ALL
tests/catch.hpp
tests/tests.cpp
)
target_link_libraries(tests ANSIEsc2HTML_static)
#target_compile_definitions(tests PRIVATE CATCH_CONFIG_ENABLE_BENCHMARKING)
#set(RELEASE_OPTIONS
# -O3
#)
#target_compile_options(ANSIEsc2HTML_static PUBLIC "$<$<CONFIG:RELEASE>:${RELEASE_OPTIONS}>")
#target_compile_options(tests PUBLIC "$<$<CONFIG:RELEASE>:${RELEASE_OPTIONS}>")
add_dependencies(tests ANSIEsc2HTML_static)
set_target_properties(ANSIEsc2HTML ANSIEsc2HTML_static tests PROPERTIES
PUBLIC_HEADER src/ansi_esc2html.h
# VERSION ${PROJECT_VERSION}
# SOVERSION 0
CXX_STANDARD 17
CXX_EXTENSIONS OFF
)
# locate Catch2 scripts for CMake
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/tests)
include(CTest)
include(Catch)
# register Catch2 tests as individual CTest tests
catch_discover_tests(tests)