2018-06-16 07:20:25 -07:00
|
|
|
cmake_minimum_required(VERSION 2.8.12)
|
2018-03-17 14:20:28 -07:00
|
|
|
project(libuv LANGUAGES C)
|
|
|
|
|
|
|
|
file(GLOB UV_SOURCES_COMMON src/*.c)
|
|
|
|
file(GLOB UV_SOURCES_WIN src/win/*.c)
|
|
|
|
|
2018-05-23 04:22:05 -07:00
|
|
|
add_library(uv ${UV_SOURCES_COMMON} ${UV_SOURCES_WIN})
|
|
|
|
target_compile_definitions(uv PRIVATE WIN32_LEAN_AND_MEAN "_WIN32_WINNT=0x0600")
|
|
|
|
target_link_libraries(uv iphlpapi psapi shell32 userenv ws2_32)
|
|
|
|
target_include_directories(uv PUBLIC ./include PRIVATE ./src)
|
2018-05-23 04:06:37 -07:00
|
|
|
if(BUILD_SHARED_LIBS)
|
2018-05-23 04:22:05 -07:00
|
|
|
set_target_properties(uv PROPERTIES DEFINE_SYMBOL BUILDING_UV_SHARED)
|
2018-05-21 09:08:41 -07:00
|
|
|
endif()
|
2018-03-17 14:20:28 -07:00
|
|
|
|
|
|
|
install(FILES
|
|
|
|
include/uv.h
|
|
|
|
DESTINATION include)
|
|
|
|
|
2018-10-31 20:35:36 -07:00
|
|
|
install(FILES
|
|
|
|
include/uv/errno.h
|
|
|
|
include/uv/threadpool.h
|
|
|
|
include/uv/tree.h
|
|
|
|
include/uv/version.h
|
|
|
|
include/uv/win.h
|
|
|
|
DESTINATION include/uv)
|
|
|
|
|
2018-03-17 14:20:28 -07:00
|
|
|
include(GNUInstallDirs)
|
2018-05-23 04:22:05 -07:00
|
|
|
install(TARGETS uv
|
2018-03-17 14:20:28 -07:00
|
|
|
PUBLIC_HEADER
|
|
|
|
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
|
|
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
2018-05-23 06:02:35 -07:00
|
|
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
2018-03-17 14:20:28 -07:00
|
|
|
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|