This pull request addresses the issue where the example app in the fl_chart repository fails to build on Linux due to invalid target names in the CMake configuration.
Issue Description
The build process for the Linux platform fails with the following errors:
CMake Error at CMakeLists.txt:63 (add_executable):
The target name "FL Chart App" is reserved or not valid for certain CMake
features, such as generator expressions, and may result in undefined
behavior.
CMake Error at CMakeLists.txt:43 (target_compile_features):
Cannot specify compile features for target "FL Chart App" which is not
built by this project.
Call Stack (most recent call first):
CMakeLists.txt:71 (apply_standard_settings)
CMake Error at CMakeLists.txt:74 (target_link_libraries):
Cannot specify link libraries for target "FL Chart App" which is not built
by this project.
Steps to Reproduce
Clone the repository and checkout the main branch.
Run flutter run for the Linux platform.
Observe the build failure with the aforementioned error messages.
Root Cause
The target name "FL Chart App" used in the CMake configuration is invalid for certain CMake features and can lead to undefined behavior. CMake target names should not contain spaces or special characters and should adhere to simple alphanumeric naming conventions.
Solution
The solution involves renaming the target in the CMakeLists.txt file to a valid name. The target name was changed from "FL Chart App" to "fLChartApp".
Changes Made
In CMakeLists.txt:
# Old target name
# set(BINARY_NAME "FL Chart App")
# New valid target name
set(BINARY_NAME "fLChartApp")
Testing
After making this change, the example app successfully builds and runs on Linux.
The new target name adheres to CMake naming conventions and resolves the build issues.
Run flutter clean to clear old build and flutter run again.
Summary
This pull request addresses the issue where the example app in the fl_chart repository fails to build on Linux due to invalid target names in the CMake configuration.
Issue Description
The build process for the Linux platform fails with the following errors:
Steps to Reproduce
Root Cause
The target name "FL Chart App" used in the CMake configuration is invalid for certain CMake features and can lead to undefined behavior. CMake target names should not contain spaces or special characters and should adhere to simple alphanumeric naming conventions.
Solution
The solution involves renaming the target in the CMakeLists.txt file to a valid name. The target name was changed from "FL Chart App" to "fLChartApp".
Changes Made In CMakeLists.txt:
Testing
After making this change, the example app successfully builds and runs on Linux. The new target name adheres to CMake naming conventions and resolves the build issues.
Run flutter clean to clear old build and flutter run again.