-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
55 lines (42 loc) · 983 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
53
54
55
cmake_minimum_required(VERSION 3.26)
# kan's lzw implementation (klzw)
set(TARGET
klzw
)
set(SOURCES
src/main.cpp
src/comptable.h
src/comptable.cpp
src/compress.cpp
src/compress.h
src/decompress.cpp
src/decompress.h
src/decomptable.cpp
src/decomptable.h
src/klzw.h
src/utils.h
src/utils.cpp
)
set(TARGET_LIB
klzw_shared
)
project(${TARGET})
#set(CMAKE_BUILD_TYPE Release)
set(CMAKE_CXX_FLAGS "-Wall -Wextra")
set(CMAKE_CXX_FLAGS_DEBUG "-g -Werror")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
add_executable(${TARGET} ${SOURCES})
add_library(${TARGET_LIB} STATIC ${SOURCES})
target_compile_features(${TARGET} PRIVATE cxx_std_17)
# gtest
# Download and install GoogleTest
include(FetchContent)
FetchContent_Declare(
googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG v1.13.0
)
FetchContent_MakeAvailable(googletest)
# Enable testing
enable_testing()
add_subdirectory(testing)