Details
-
Suggestion
-
Resolution: Won't Do
-
Not Evaluated
-
None
-
6.8
-
None
Description
I love Qt and Qt loves CMake.
Inside my CMakeLists.txt I wrote
project(myAppName LANGUAGES CXX DESCRIPTION "My good app" VERSION 1.2.3.4)
I expect that setApplicationName will done automatically based on CMakeLists.txt The same for setApplicationVersion.
But for now I need dirty hack. Inside CMakeLists.txt
add_compile_definitions( -DMYPROJECT_NAME=${PROJECT_NAME} )
Inside main.cpp
#define Q(x) #x #define QUOTE(x) Q(x) QCoreApplication::setApplicationName(QUOTE(MYPROJECT_NAME));
With dirty hack I can use ${PROJECT_NAME} from CMakeLists.txt for setApplicationName. I suggest Qt automatically load settings from CMakeLists.txt. There is another method to export variables.