2021-11-19 10:50:09 +03:00
|
|
|
cmake_minimum_required(VERSION 3.14)
|
|
|
|
project(runner LANGUAGES CXX)
|
|
|
|
|
2022-08-31 10:13:35 +03:00
|
|
|
# Define the application target. To change its name, change BINARY_NAME in the
|
|
|
|
# top-level CMakeLists.txt, not the value here, or `flutter run` will no longer
|
|
|
|
# work.
|
|
|
|
#
|
|
|
|
# Any new source files that you add to the application should be added here.
|
2021-11-19 10:50:09 +03:00
|
|
|
add_executable(${BINARY_NAME} WIN32
|
|
|
|
"flutter_window.cpp"
|
|
|
|
"main.cpp"
|
|
|
|
"utils.cpp"
|
|
|
|
"win32_window.cpp"
|
|
|
|
"${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc"
|
|
|
|
"Runner.rc"
|
|
|
|
"runner.exe.manifest"
|
|
|
|
)
|
2022-08-31 10:13:35 +03:00
|
|
|
|
|
|
|
# Apply the standard set of build settings. This can be removed for applications
|
|
|
|
# that need different build settings.
|
2021-11-19 10:50:09 +03:00
|
|
|
apply_standard_settings(${BINARY_NAME})
|
2022-08-31 10:13:35 +03:00
|
|
|
|
|
|
|
# Add preprocessor definitions for the build version.
|
|
|
|
target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION=\"${FLUTTER_VERSION}\"")
|
|
|
|
target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTTER_VERSION_MAJOR}")
|
|
|
|
target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MINOR=${FLUTTER_VERSION_MINOR}")
|
|
|
|
target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_PATCH=${FLUTTER_VERSION_PATCH}")
|
|
|
|
target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_BUILD=${FLUTTER_VERSION_BUILD}")
|
|
|
|
|
|
|
|
# Disable Windows macros that collide with C++ standard library functions.
|
2021-11-19 10:50:09 +03:00
|
|
|
target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX")
|
2022-08-31 10:13:35 +03:00
|
|
|
|
|
|
|
# Add dependency libraries and include directories. Add any application-specific
|
|
|
|
# dependencies here.
|
2021-11-19 10:50:09 +03:00
|
|
|
target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app)
|
2023-01-26 16:42:12 +03:00
|
|
|
target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib")
|
2021-11-19 10:50:09 +03:00
|
|
|
target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}")
|
2022-08-31 10:13:35 +03:00
|
|
|
|
|
|
|
# Run the Flutter tool portions of the build. This must not be removed.
|
2021-11-19 10:50:09 +03:00
|
|
|
add_dependencies(${BINARY_NAME} flutter_assemble)
|
2021-11-19 14:58:16 +03:00
|
|
|
|
2022-08-31 10:13:35 +03:00
|
|
|
# Add helper. This can probably be done in a cleaner way.
|
2022-05-06 15:50:00 +03:00
|
|
|
file(COPY "../../build/windows/helper" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/Release")
|
2022-08-31 10:13:35 +03:00
|
|
|
file(COPY "../../build/windows/helper" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/Debug")
|