mirror of
https://github.com/microsoft/vcpkg.git
synced 2025-01-17 16:38:12 +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)
|
||||
|
||||
set(PUBLIC_HDRS
|
||||
http_parser.h
|
||||
)
|
||||
set(PRIVATE_HDRS
|
||||
)
|
||||
set(SRCS
|
||||
http_parser.c
|
||||
)
|
||||
if (BUILD_SHARED_LIBS)
|
||||
SET(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
|
||||
endif()
|
||||
|
||||
add_library(http_parser STATIC ${SRCS} ${PUBLIC_HDRS} ${PRIAVTE_HDRS})
|
||||
add_library(http_parser http_parser.c http_parser.h)
|
||||
|
||||
if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL )
|
||||
install(TARGETS http_parser
|
||||
ARCHIVE DESTINATION "${CMAKE_INSTALL_PREFIX}/lib" )
|
||||
endif()
|
||||
RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin"
|
||||
ARCHIVE DESTINATION "${CMAKE_INSTALL_PREFIX}/lib"
|
||||
)
|
||||
|
||||
if(NOT SKIP_INSTALL_HEADERS AND NOT SKIP_INSTALL_ALL )
|
||||
install(FILES ${PUBLIC_HDRS} DESTINATION "${CMAKE_INSTALL_PREFIX}/include")
|
||||
if (NOT SKIP_INSTALL_HEADERS)
|
||||
install(FILES http_parser.h DESTINATION "${CMAKE_INSTALL_PREFIX}/include")
|
||||
endif()
|
Loading…
x
Reference in New Issue
Block a user