aboutsummaryrefslogtreecommitdiff
path: root/ports/http-parser/CMakeLists.txt
blob: 284c8e9033f610ff54bb749a5698c430fb29ff22 (plain)
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
cmake_minimum_required(VERSION 3.4)
project(http-parser C)

if(BUILD_SHARED_LIBS)
  set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
endif()

if(CMAKE_BUILD_TYPE MATCHES "Release")
  add_definitions(-DHTTP_PARSER_STRICT=0)
endif()

add_library(http_parser http_parser.c http_parser.h)

target_include_directories(http_parser PUBLIC $<INSTALL_INTERFACE:include>)

install(
	TARGETS http_parser
	EXPORT NODEJS_HTTP_PARSER_ALL_TARGETS
	LIBRARY DESTINATION lib
	ARCHIVE DESTINATION lib
	RUNTIME DESTINATION bin
)

install(
	EXPORT NODEJS_HTTP_PARSER_ALL_TARGETS
	NAMESPACE unofficial::http_parser::
	FILE unofficial-http-parser-config.cmake
	DESTINATION share/unofficial-http-parser
)

install(FILES http_parser.h DESTINATION include)