![]() I just don’t know how to refer directly to these files from within this function scope. Since this function is called from the scope of a top level project, this is invalid. Set(VERSION_H_FILEPATH $ PARENT_SCOPE)Īs you can see, the templates are being referred to in a relative path, with the expectation that they are relative to the module itself. To answer your direct question, here is the relevant portion of GenerateBinaryVersion.cmake. Project(cmake-binary-versioning LANGUAGES NONE)ĭESTINATION share/cmake/GenerateBinaryVersion CMakeBinaryVersioning/CMakeLists.txt: cmake_minimum_required(VERSION 3.25) Project(company-CMakeModules LANGUAGES NONE)Īnd the contents of. The cmake project file that contains the cmake module looks like this: cmake_minimum_required(VERSION 3.25) I’m at my PC now so let me share a little bit of the code: I’ve been searching for hours and rereading the book trying to figure this out. This is for my job, so I can’t really post too much detail. What am I doing wrong? What is the right way to achieve this? I would love it if my modules were consumable as installed (packaged zip), by fetch content, and by external project, but I will accept only fetch content or only external project if it works well. Then the calling scope would add these to the target include directories and my dll gets built with version meta data.īut as I said before, I cannot generate the configured files because they are located relative to the cmake module itself (and part of that module’s git repo). ![]() In order to achieve this, there are two template files which are processed by configure_file and which generate a version.h and a versionresource.rc file, then adds the path to those generated files into a list variable provided to the function. I currently have one module which has a function used to generate windows dll/exe version properties. Maybe there is a way to get the path to these files once my module subdirectory is added (but how)? But I also don’t want to do that because it would clutter my source tree with module files. However, my module’s functions don’t actually work because the files that the function requires are buried deep inside the cmake build structure and I don’t know how to trigger an install to deliver the files to the local project scope. I have achieved bringing this into another project using the Fetch Content pattern presented by Craig Scott in his book (and likely by others too). All other trademarks are property of their respective owners.I have been attempting to setup a git repository that will contain cmake modules. ![]() Qt and respective logos are trademarks of The Qt Company Ltd. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. The book Professional CMake: A Practical Guide provides a great introduction to the most relevant CMake features.īuild with CMake Building projects on the command lineĭocumentation contributions included herein are the copyrights of The official CMake Tutorial covers common build system tasks. The official CMake Documentation is an invaluable source for working with CMake. qm files are handled, use the underlying commands qt_add_lupdate and qt_add_lrelease. The qt_add_translations command is a convenience wrapper. ts files and the embedding into a resource, see the qt_add_translations documentation. target release_translationsįor more information about how to influence the handling of.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |