![]() ![]() Instead, try to simply append to it within the very CMakeList you try to access the modules/files. Perhaps your issue is that you are trying to define the Module path from the environment. Include(stdint) # simply executes flat CMake code In CMakeLists.txt I have: set (CMAKE_MODULE_PATH "$/cmake")įind_package (Matlab) # runs FindMatlab.cmake In a CMake project I'm working on, I have a very similar directory structure as to what you propose. In other words, I need -isystem /path/to/my/include added to my compiler flags, but when calling something like cmake. That said, if you include a file without the extension, it too will search through your MODULE_PATH for that file.cmake. 49 I'm in a situation where I should not disturb the existing CMakeLists.txt files, but I still should add some g++ system include directory to my build. ![]() ![]() That is, when you run find_package(Module), it searches for a file in the MODULE_PATH that is named FindModule.cmake. I believe that a CMake 'module' is simply a file that can be used with the find_package directive. I think what I should be doing is writing something that find_package can work with.Īs things stand though, I'm still some way from being able to answer my own question. I'm pretty confident that the problem here is not understanding how cmake is supposed to work. For example, a module is also a dynamic library loaded using LoadLibrary/dl_open.Ĭan anyone explain what the difference is between a file and a module in this context, and how I create my own module so that the cmake include command can find and use it? Searching the manual for "module" isn't much help as the word seems to be overloaded. I guessed that the missing extension might be enough (as with standard modules) but clearly it isn't. But there is no explanation of what the difference is. In the cmake manual, it kind of implies that a "file" is different from a "module" - only a module gets the automatic add-the-extension-and-search-the-path treatment. and I restarted the command prompt each time and checked that the environment variable was present and correct. On the off-chance, I even tried specifying the path in the environment variable several ways - once with backslashes, once with forward slashes. Cmake doesn't find the file I specify in the include command. The obvious solution seems to be to use the "include" command, and to factor out relevant chunks of cmake script into *.cmake files, and set up a CMAKE_MODULE_PATH environment variable.Įxcept it just plain doesn't work. Even having the cmake code to find and import these in every cmakefile is excessive. A very understandable example is LLVM, which has 78 static libraries. I use some libraries that I don't want built as part of every project that uses them. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |