CMakeLists.txt 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. "dump.cpp"
  12. "utils.cpp"
  13. "win32_window.cpp"
  14. "file_icon.cpp"
  15. "file_info.cpp"
  16. "tray_icon.cpp"
  17. "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc"
  18. "Runner.rc"
  19. "runner.exe.manifest"
  20. )
  21. # Apply the standard set of build settings. This can be removed for applications
  22. # that need different build settings.
  23. apply_standard_settings(${BINARY_NAME})
  24. # Add preprocessor definitions for the build version.
  25. target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION=\"${FLUTTER_VERSION}\"")
  26. target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTTER_VERSION_MAJOR}")
  27. target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MINOR=${FLUTTER_VERSION_MINOR}")
  28. target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_PATCH=${FLUTTER_VERSION_PATCH}")
  29. target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_BUILD=${FLUTTER_VERSION_BUILD}")
  30. # Disable Windows macros that collide with C++ standard library functions.
  31. target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX")
  32. # Add dependency libraries and include directories. Add any application-specific
  33. # dependencies here.
  34. target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app)
  35. target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib")
  36. target_link_libraries(${BINARY_NAME} PRIVATE "version.lib")
  37. target_link_libraries(${BINARY_NAME} PRIVATE "gdiplus.lib")
  38. target_link_libraries(${BINARY_NAME} PRIVATE "Shlwapi.lib")
  39. target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}")
  40. # Run the Flutter tool portions of the build. This must not be removed.
  41. add_dependencies(${BINARY_NAME} flutter_assemble)