CMakeLists.txt 799 B

123456789101112131415161718192021222324252627282930313233
  1. cmake_minimum_required(VERSION 2.6)
  2. project(enet C)
  3. set(ENET_DEBUG "0" CACHE BOOL "Enable debug functionality")
  4. set(ENET_STATIC "0" CACHE BOOL "Create a static library")
  5. set(ENET_SHARED "0" CACHE BOOL "Create a shared library")
  6. set(ENET_LZ4 "0" CACHE BOOL "Add support for an optional packet-level compression")
  7. if (ENET_DEBUG)
  8. add_definitions(-DENET_DEBUG)
  9. endif()
  10. if (ENET_LZ4)
  11. add_definitions(-DENET_LZ4)
  12. set(SOURCES lz4/lz4.c)
  13. endif()
  14. if (ENET_STATIC)
  15. add_library(enet_static STATIC enet.c ${SOURCES})
  16. if (WIN32)
  17. target_link_libraries(enet_static winmm ws2_32)
  18. endif()
  19. endif()
  20. if (ENET_SHARED)
  21. add_definitions(-DENET_DLL)
  22. add_library(enet SHARED enet.c ${SOURCES})
  23. if (WIN32)
  24. target_link_libraries(enet winmm ws2_32)
  25. endif()
  26. endif()