One of the drawbacks to rolling out your CMake files to each developer machine and then loading them with include() is that those CMake files sit outside of version control. But I’m wondering if I could even reach my idea. Or should I consider to deploy my scripts into the CMake installation’s module directory? This doesn’t seem right to me as it makes them look like a part of the CMake distribution.Ītm the closest solution I have would be to retrieve the path from a dedicated environment variable right before the include() call. Is this anyways a use case for the include() call or should I consider to treat my collection as a package? My understanding is that packages provide build dependencies and CMake code should be included. Is it possible to make CMake aware of such external modules on a machine? But the user/developer should not need to care about this path. The latter seems like the one to use but it is not available as environment variable (like CMAKE_PREFIX_PATH for find_package()), so the user would need to specify it on the command line for the CMake call. Load and run CMake code from a file or module.īut it seems like I cannot make include() search specific locations other than the current directory, CMake’s module directory and what CMAKE_MODULE_PATH points to (not in this order). I had in mind to somehow propagate the collection’s location on the development machines and let the projects call include() to import this functionality, as its documentation says Our projects should just need to include the collection’s main. I created a collection of CMake functions and macros that will be rolled out on our development machines.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |