![]() ![]() You can also undefine a variable: cmake -UVARIABLE path/to/source Variables are stored in the CMake cache. libraries and parsers, CMake was designed with only one major dependency. I am afraid that this can change from app to app in respect to which module I need or in respect of the dependecies tree in the modules itself so I'm looking for a cleaner solution. Options and variables are defined on the CMake command line like this: cmake -DVARIABLEvalue path/to/source You can set a variable after the initial CMake invocation to change its value. The system required several environment variables to be set prior to running. placeholder expect zero or more arguments. Signatures of this command that specify a .See the cmake-language(7) variables documentation for the scopes and interaction of normal variables and cache entries. ![]() ![]() So I have tried to add it in some module that I think could be nested and hidden in some dependencies but compiling all the application I suddenly faced with: CMake Warning (dev) at /path_to_repo/cmake/FindFooX.cmake:6 (set):Ĭannot set "LIB": current scope has no parent. set Set a normal, cache, or environment variable to a given value. For bypass this I have to add PARENT_SCOPE in the set). So I have defined such a variable in the CMake-file: SET(LIBINTERFACEVERSION 1 CACHE INTEGER 'Version of libInterface') With this definition I can generate a version.rc file according to Microsoft's definition, which I compile into the library and afterwards shows up correctly in the properties window of my dll-file. So in one of the final applications that uses some modules I can just do: target_link_libraries($/include)īut it happened sometimes that some module require another modules so that the add_subdirectory creates new scopes and can correctly load LIB but cannot write it (when I use set it is in the deeper scope and not changes the upper scope). I have a cmake project in which I have some modules and I'm using Find-*.cmake for including the shared modules in the application.įor not taking in account every module that I add, I have defined a kind of global LIB variables tor the linker: # inside a Find-*.cmake or in the CMakeLists.txt of the modules: ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |