generated from franklange/template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
50 lines (39 loc) · 1.1 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
cmake_minimum_required(VERSION 3.10)
project(pigz-cpp)
find_package(Threads REQUIRED)
find_package(ZLIB REQUIRED)
option(PIGZCPP_TESTS "Enable Tests" OFF)
option(PIGZCPP_EXAMPLES "Enable Examples" OFF)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Build Type" FORCE)
endif()
add_library(${PROJECT_NAME} "")
set_target_properties(${PROJECT_NAME} PROPERTIES
LINKER_LANGUAGE CXX
ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
)
target_sources(${PROJECT_NAME} PRIVATE
include/pigz-cpp/compressor.hpp
include/pigz-cpp/defaults.hpp
include/pigz-cpp/loader.hpp
include/pigz-cpp/pigz.hpp
include/pigz-cpp/types.hpp
include/pigz-cpp/utils.hpp
src/compressor.cpp
src/loader.cpp
src/pigz.cpp
src/utils.cpp
)
target_include_directories(${PROJECT_NAME} PUBLIC include)
target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_20)
target_link_libraries(${PROJECT_NAME} PUBLIC
Threads::Threads
ZLIB::ZLIB
)
if (PIGZCPP_TESTS)
enable_testing()
add_subdirectory(test)
endif()
if (PIGZCPP_EXAMPLES)
add_subdirectory(example)
endif()