forked from seanmiddleditch/libtelnet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
51 lines (43 loc) · 1.19 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.5)
project(libtelnet
VERSION 0.30.0
LANGUAGES C
)
set(PROJECT_DESCRIPTION "TELNET protocol handling library")
set(PROJECT_HOMEPAGE_URL https://github.com/seanmiddleditch/libtelne)
if (MSVC)
add_definitions(-D_SCL_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS)
if (LIBTELNET_STRICT)
add_compile_options(/WX)
endif ()
else ()
if (LIBTELNET_STRICT)
add_compile_options(-Wall -Wextra -pedantic -Werror)
endif ()
endif ()
add_library(libtelnet libtelnet.c)
target_include_directories(libtelnet
PUBLIC
$<INSTALL_INTERFACE:include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
)
add_subdirectory(util)
add_subdirectory(doc)
add_subdirectory(test)
include(GNUInstallDirs)
configure_file(libtelnet.pc.in libtelnet.pc)
install(TARGETS libtelnet
EXPORT libtelnet-export
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
install(FILES libtelnet.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
install(EXPORT libtelnet-export
FILE libtelnet.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libtelnet
)
include(CPack)