proper use of CMAKE_SOURCE_DIR
-
Hi all -
I'm trying to follow a Qt example on translations. In the video, the narrator adds this line to his CMakeLists.txt file:
qt_create_translation(QM_FILES $(CMAKE_SOURCE_DIR) simplequick.ts)
I've added an equivalent line to my file, and when trying to build, I get a rather strange-looking error:
ninja: error: 'C:/Users/Michael.Zimmers/Qt_projects/nga_demo/$(CMAKE_SOURCE_DIR)', needed by '.lupdate/latin.ts.stamp', missing and no known rule to make it
("latin.ts" is the name of my .ts file -- it's currently empty.)
I tried adding a definition for CMAKE_SOURCE_DIR in my project configuration, but that didn't change anything.Any ideas what I'm doing wrong here? Thanks...
-
Hi all -
I'm trying to follow a Qt example on translations. In the video, the narrator adds this line to his CMakeLists.txt file:
qt_create_translation(QM_FILES $(CMAKE_SOURCE_DIR) simplequick.ts)
I've added an equivalent line to my file, and when trying to build, I get a rather strange-looking error:
ninja: error: 'C:/Users/Michael.Zimmers/Qt_projects/nga_demo/$(CMAKE_SOURCE_DIR)', needed by '.lupdate/latin.ts.stamp', missing and no known rule to make it
("latin.ts" is the name of my .ts file -- it's currently empty.)
I tried adding a definition for CMAKE_SOURCE_DIR in my project configuration, but that didn't change anything.Any ideas what I'm doing wrong here? Thanks...
I am pretty sure the video is correct but you read it wrong. Cmake is using curly brackets for variables.
-
I am pretty sure the video is correct but you read it wrong. Cmake is using curly brackets for variables.
@Christian-Ehrlicher and I'm pretty sure you're right. (I think I need a vacation.) Thanks for catching that.
As long as we're on the general subject (sort of), later, he includes this line:
#install(FILES ${qm_files} DESTINATION ${INSTALL_EXAMPLEDIR})
I'm assuming that he defined INSTALL_EXAMPLEDIR but he doesn't explicitly mention it. Which Qt variable should I substitute for my project? (I'm using a conventional shadow build.)
Thanks...
-
@Christian-Ehrlicher and I'm pretty sure you're right. (I think I need a vacation.) Thanks for catching that.
As long as we're on the general subject (sort of), later, he includes this line:
#install(FILES ${qm_files} DESTINATION ${INSTALL_EXAMPLEDIR})
I'm assuming that he defined INSTALL_EXAMPLEDIR but he doesn't explicitly mention it. Which Qt variable should I substitute for my project? (I'm using a conventional shadow build.)
Thanks...
I personally install qm files either in an 'translations' subdir or directly embed them in the resource file.
-
I personally install qm files either in an 'translations' subdir or directly embed them in the resource file.
@Christian-Ehrlicher said in proper use of CMAKE_SOURCE_DIR:
I personally install qm files either in an 'translations' subdir or directly embed them in the resource file.
Oh, I guess I misunderstood that line -- I thought he was referring to the build directory. But your answer implies that the install is actually within the source directory.
I think I'd like to use the first approach you mentioned. Should I create a variable for this directory within Creator, or is there something predefined for this purpose?
Thanks...
-
M mzimmers has marked this topic as solved on