Rm -rf *.o *.dSYM test_api attributeAuthority To the PKG_CONFIG_PATH environment variable Perhaps you should add the directory containing `libpistache.pc' Package libpistache was not found in the pkg-config search path. My complaint is about inability to locate headers for `openabe` that reside in `/opt/local/include`. Both require `openabe` package that is present. One of those C++ files requires `pistache` package that is currently missing. cpp files and two executables built from each of them. Just a small C++ Makefile project, with two. I recommend you take a look at the FetchContent module documentation to get an idea of how it works and what you can do with it.> some Makefile projects explicitly set `MAKEFLAGS` (or, alternatively, `GNUMAKEFLAGS`), overriding the default values You can put whatever commands you want in that CMakeLists.txt file, so you have an injection point to pull in CMake files with include() to define commands, etc. The FetchContent_MakeAvailable() command will call add_subdirectory() on the fetched repo’s source directory if there is a CMakeLists.txt file at the top level. You can make including the CMake files part of the fetched repo.Developers can therefore work offline after the first run has downloaded the required commit from your repo. If you use a git hash for the GIT_TAG, then it can tell if it already has the commit it needs and will use it without needing to do a git fetch. FetchContent avoids communicating with the remote end if it knows it doesn’t need to.If needed, you can use FetchContent before the first project() call to retrieve part or all of the toolchain being used to build the project.As an added benefit, you no longer need any separate infrastructure to roll out your CMake files to developer machines ahead of time. Now the project has full traceability of the CMake files, since the git hash is included in the project’s own sources. In the project, you specify exactly the git hash of the commit to retrieve in the FetchContent_Declare() command. You put the CMake files in their own git repository or whatever version control system you prefer to use. Consider whether you can have the project download those CMake files on-demand using the FetchContent module instead. If you change those CMake files, your project loses traceability, meaning that you cannot reliably build an earlier version of the project because these CMake file dependencies are not traceable. 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. |