mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-25 16:39:01 +08:00
8a624f93b7
* Improve cmake routine for nodejs/http-parser. Now it is installed as a propper target and can be searched with `find_package(http-parser REQUIRED)` and then used as a dependency like this: `target_link_libraries(main PRIVATE nodejs::http_parser)`. Also using namespace for referencing http-parser lib, which is safer, although the old name must still work, as names of the binaries remained unchanged. * Remove duplicate variable definition and add newlines at the end of files. * [http-parser] Rename exported targets to "unofficial", since they are not blessed by upstream
32 lines
723 B
CMake
32 lines
723 B
CMake
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)
|