LibuvCMakeLists.txt 965 B

12345678910111213141516171819202122232425262728293031323334
  1. cmake_minimum_required(VERSION 2.8.12)
  2. project(libuv LANGUAGES C)
  3. file(GLOB UV_SOURCES_COMMON src/*.c)
  4. file(GLOB UV_SOURCES_WIN src/win/*.c)
  5. add_library(uv ${UV_SOURCES_COMMON} ${UV_SOURCES_WIN})
  6. target_compile_definitions(uv PRIVATE WIN32_LEAN_AND_MEAN "_WIN32_WINNT=0x0600")
  7. target_link_libraries(uv iphlpapi psapi shell32 userenv ws2_32)
  8. target_include_directories(uv PUBLIC ./include PRIVATE ./src)
  9. if(BUILD_SHARED_LIBS)
  10. set_target_properties(uv PROPERTIES DEFINE_SYMBOL BUILDING_UV_SHARED)
  11. endif()
  12. install(FILES
  13. include/uv.h
  14. DESTINATION include)
  15. install(FILES
  16. include/uv/errno.h
  17. include/uv/threadpool.h
  18. include/uv/tree.h
  19. include/uv/version.h
  20. include/uv/win.h
  21. DESTINATION include/uv)
  22. include(GNUInstallDirs)
  23. install(TARGETS uv
  24. PUBLIC_HEADER
  25. ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
  26. LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
  27. RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
  28. PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})