CMakeLists.txt 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. cmake_minimum_required(VERSION 3.7)
  2. if(POLICY CMP0079)
  3. cmake_policy(SET CMP0079 NEW)
  4. endif()
  5. set(CLIENT_UWP_RESOURCES
  6. uwp/Logo.png
  7. uwp/package.appxManifest
  8. uwp/SmallLogo.png
  9. uwp/SmallLogo44x44.png
  10. uwp/SplashScreen.png
  11. uwp/StoreLogo.png
  12. uwp/Windows_TemporaryKey.pfx
  13. )
  14. if(WIN32)
  15. if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
  16. add_executable(datachannel-client main.cpp parse_cl.cpp parse_cl.h getopt.cpp getopt.h ${CLIENT_UWP_RESOURCES})
  17. else()
  18. add_executable(datachannel-client main.cpp parse_cl.cpp parse_cl.h getopt.cpp getopt.h)
  19. endif()
  20. target_compile_definitions(datachannel-client PUBLIC STATIC_GETOPT)
  21. else()
  22. add_executable(datachannel-client main.cpp parse_cl.cpp parse_cl.h)
  23. endif()
  24. set_target_properties(datachannel-client PROPERTIES
  25. CXX_STANDARD 17
  26. OUTPUT_NAME client)
  27. set_target_properties(datachannel-client PROPERTIES
  28. XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER com.github.paullouisageneau.libdatachannel.examples.client)
  29. target_link_libraries(datachannel-client datachannel nlohmann_json)
  30. if(WIN32)
  31. add_custom_command(TARGET datachannel-client POST_BUILD
  32. COMMAND ${CMAKE_COMMAND} -E copy_if_different
  33. "$<TARGET_FILE_DIR:datachannel>/datachannel.dll"
  34. $<TARGET_FILE_DIR:datachannel-client>
  35. )
  36. endif()