CMakeLists.txt 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. cmake_minimum_required(VERSION 3.14)
  2. project(runner LANGUAGES CXX)
  3. # Define the application target. To change its name, change BINARY_NAME in the
  4. # top-level CMakeLists.txt, not the value here, or `flutter run` will no longer
  5. # work.
  6. #
  7. # Any new source files that you add to the application should be added here.
  8. add_executable(${BINARY_NAME} WIN32
  9. "flutter_window.cpp"
  10. "main.cpp"
  11. "utils.cpp"
  12. "win32_window.cpp"
  13. "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc"
  14. "Runner.rc"
  15. "runner.exe.manifest"
  16. )
  17. # Apply the standard set of build settings. This can be removed for applications
  18. # that need different build settings.
  19. apply_standard_settings(${BINARY_NAME})
  20. # Add preprocessor definitions for the build version.
  21. target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION=\"${FLUTTER_VERSION}\"")
  22. target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTTER_VERSION_MAJOR}")
  23. target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MINOR=${FLUTTER_VERSION_MINOR}")
  24. target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_PATCH=${FLUTTER_VERSION_PATCH}")
  25. target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_BUILD=${FLUTTER_VERSION_BUILD}")
  26. # Disable Windows macros that collide with C++ standard library functions.
  27. target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX")
  28. # Add dependency libraries and include directories. Add any application-specific
  29. # dependencies here.
  30. target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app)
  31. target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib")
  32. target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}")
  33. # Run the Flutter tool portions of the build. This must not be removed.
  34. add_dependencies(${BINARY_NAME} flutter_assemble)