CMakeLists.txt 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. target_link_libraries(datachannel-client datachannel nlohmann_json)
  28. if(WIN32)
  29. add_custom_command(TARGET datachannel-client POST_BUILD
  30. COMMAND ${CMAKE_COMMAND} -E copy_if_different
  31. "$<TARGET_FILE_DIR:datachannel>/datachannel.dll"
  32. $<TARGET_FILE_DIR:datachannel-client>
  33. )
  34. endif()