mirror of
https://github.com/microsoft/vcpkg.git
synced 2025-01-19 02:13:03 +08:00
Update the cmakelists to build shared and static libraries properly.
This commit is contained in:
parent
89314e0132
commit
f62ad96c9a
@ -1,22 +1,17 @@
|
|||||||
cmake_minimum_required (VERSION 2.6)
|
cmake_minimum_required (VERSION 3.4)
|
||||||
project (http-parser)
|
project (http-parser)
|
||||||
|
|
||||||
set(PUBLIC_HDRS
|
if (BUILD_SHARED_LIBS)
|
||||||
http_parser.h
|
SET(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
|
||||||
)
|
|
||||||
set(PRIVATE_HDRS
|
|
||||||
)
|
|
||||||
set(SRCS
|
|
||||||
http_parser.c
|
|
||||||
)
|
|
||||||
|
|
||||||
add_library(http_parser STATIC ${SRCS} ${PUBLIC_HDRS} ${PRIAVTE_HDRS})
|
|
||||||
|
|
||||||
if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL )
|
|
||||||
install(TARGETS http_parser
|
|
||||||
ARCHIVE DESTINATION "${CMAKE_INSTALL_PREFIX}/lib" )
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT SKIP_INSTALL_HEADERS AND NOT SKIP_INSTALL_ALL )
|
add_library(http_parser http_parser.c http_parser.h)
|
||||||
install(FILES ${PUBLIC_HDRS} DESTINATION "${CMAKE_INSTALL_PREFIX}/include")
|
|
||||||
|
install(TARGETS http_parser
|
||||||
|
RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin"
|
||||||
|
ARCHIVE DESTINATION "${CMAKE_INSTALL_PREFIX}/lib"
|
||||||
|
)
|
||||||
|
|
||||||
|
if (NOT SKIP_INSTALL_HEADERS)
|
||||||
|
install(FILES http_parser.h DESTINATION "${CMAKE_INSTALL_PREFIX}/include")
|
||||||
endif()
|
endif()
|
Loading…
Reference in New Issue
Block a user