1- # Project-level configuration.
21cmake_minimum_required (VERSION 3.10)
32project (runner LANGUAGES CXX)
43
5- # The name of the executable created for the application. Change this to change
6- # the on-disk name of your application.
74set (BINARY_NAME "nebuchadnezzar" )
8- # The unique GTK application identifier for this application. See:
9- # https://wiki.gnome.org/HowDoI/ChooseApplicationID
10- set (APPLICATION_ID "org.feichtmeier.nebuchadnezzar" )
5+ set (APPLICATION_ID "org.feichtmeier.Nebuchadnezzar" )
116
12- # Explicitly opt in to modern CMake behaviors to avoid warnings with recent
13- # versions of CMake.
147cmake_policy (SET CMP0063 NEW)
158
16- set (USE_LIBHANDY ON )
17-
18- # Load bundled libraries from the lib/ directory relative to the binary.
199set (CMAKE_INSTALL_RPATH "$ORIGIN/lib" )
2010
21- # Root filesystem for cross-building.
22- if (FLUTTER_TARGET_PLATFORM_SYSROOT)
23- set (CMAKE_SYSROOT ${FLUTTER_TARGET_PLATFORM_SYSROOT} )
24- set (CMAKE_FIND_ROOT_PATH ${CMAKE_SYSROOT} )
25- set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
26- set (CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
27- set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
28- set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
29- endif ()
30-
31- # Define build configuration options.
11+ # Configure build options.
3212if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES )
3313 set (CMAKE_BUILD_TYPE "Debug" CACHE
3414 STRING "Flutter build mode" FORCE)
@@ -37,19 +17,16 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
3717endif ()
3818
3919# Compilation settings that should be applied to most targets.
40- #
41- # Be cautious about adding new options here, as plugins use this function by
42- # default. In most cases, you should add new options to specific targets instead
43- # of modifying this function.
4420function (APPLY_STANDARD_SETTINGS TARGET )
4521 target_compile_features (${TARGET} PUBLIC cxx_std_14)
4622 target_compile_options (${TARGET} PRIVATE -Wall -Werror)
4723 target_compile_options (${TARGET} PRIVATE "$<$<NOT:$<CONFIG:Debug>>:-O3>" )
4824 target_compile_definitions (${TARGET} PRIVATE "$<$<NOT:$<CONFIG:Debug>>:NDEBUG>" )
4925endfunction ()
5026
51- # Flutter library and tool build rules.
5227set (FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR} /flutter" )
28+
29+ # Flutter library and tool build rules.
5330add_subdirectory (${FLUTTER_MANAGED_DIR} )
5431
5532# System-level dependencies.
@@ -58,27 +35,16 @@ pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0)
5835
5936add_definitions (-DAPPLICATION_ID="${APPLICATION_ID} " )
6037
61- # Define the application target. To change its name, change BINARY_NAME above,
62- # not the value here, or `flutter run` will no longer work.
63- #
64- # Any new source files that you add to the application should be added here.
38+ # Application build
6539add_executable (${BINARY_NAME}
6640 "main.cc"
6741 "my_application.cc"
6842 "${FLUTTER_MANAGED_DIR} /generated_plugin_registrant.cc"
6943)
70-
71- # Apply the standard set of build settings. This can be removed for applications
72- # that need different build settings.
7344apply_standard_settings(${BINARY_NAME} )
74-
75- # Add dependency libraries. Add any application-specific dependencies here.
7645target_link_libraries (${BINARY_NAME} PRIVATE flutter)
7746target_link_libraries (${BINARY_NAME} PRIVATE PkgConfig::GTK)
78-
79- # Run the Flutter tool portions of the build. This must not be removed.
8047add_dependencies (${BINARY_NAME} flutter_assemble)
81-
8248# Only the install-generated bundle's copy of the executable will launch
8349# correctly, since the resources must in the right relative locations. To avoid
8450# people trying to run the unbundled copy, put it in a subdirectory instead of
@@ -88,11 +54,11 @@ set_target_properties(${BINARY_NAME}
8854 RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR} /intermediates_do_not_run"
8955)
9056
91-
9257# Generated plugin build rules, which manage building the plugins and adding
9358# them to the application.
9459include (flutter/generated_plugins.cmake)
9560
61+ target_link_libraries (${BINARY_NAME} PRIVATE ${MIMALLOC_LIB} )
9662
9763# === Installation ===
9864# By default, "installing" just makes a relocatable bundle in the build
@@ -119,17 +85,11 @@ install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}
11985install (FILES "${FLUTTER_LIBRARY} " DESTINATION "${INSTALL_BUNDLE_LIB_DIR} "
12086 COMPONENT Runtime)
12187
122- foreach (bundled_library ${ PLUGIN_BUNDLED_LIBRARIES} )
123- install (FILES "${bundled_library } "
88+ if ( PLUGIN_BUNDLED_LIBRARIES)
89+ install (FILES "${PLUGIN_BUNDLED_LIBRARIES } "
12490 DESTINATION "${INSTALL_BUNDLE_LIB_DIR} "
12591 COMPONENT Runtime)
126- endforeach (bundled_library)
127-
128- # Copy the native assets provided by the build.dart from all packages.
129- set (NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR} native_assets/linux/" )
130- install (DIRECTORY "${NATIVE_ASSETS_DIR} "
131- DESTINATION "${INSTALL_BUNDLE_LIB_DIR} "
132- COMPONENT Runtime)
92+ endif ()
13393
13494# Fully re-copy the assets directory on each build to avoid having stale files
13595# from a previous install.
@@ -144,4 +104,4 @@ install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}"
144104if (NOT CMAKE_BUILD_TYPE MATCHES "Debug" )
145105 install (FILES "${AOT_LIBRARY} " DESTINATION "${INSTALL_BUNDLE_LIB_DIR} "
146106 COMPONENT Runtime)
147- endif ()
107+ endif ()
0 commit comments