![]() If none of the above works, there's a simplest and crudest way is to delete the CMakeCache.txt file (which is usually in the cmake build root directory) and reload CMakeLists.txt. PackageName_LIBRARIES contain LIB1,LIB2,LIB3, you need unset(LIB1_LIBRARY CACHE) Note that if some cache variables are set in the package, you also need to add unset, You may need to look at the package's FindpackageName.cmake or CmakeCache.txt to see if there are extra cache variables. ![]() Or you can set a flag in cache, if the flag changed, unset packageName_DIR. Then each time you reload the CMakeLists, it will re-find the package. From those files, CMake can generate projects for the most popular IDEs and build systems on different OSs. CMake allows you to specify the build of a project, in files named CMakeLists.txt, with a simple syntax (much simpler than writing Makefiles). Solution is: unset(packageName_DIR CACHE) In the C/C++ ecosystem, the best tool for project configuration is CMake. So I find the cached value in CMakeCache.txt, value is just link packageName_DIR. Once one of the calls succeeds the result variable will be set and stored in the cache so that no call will search again.īy default the value stored in the result variable will be the path at which the file is found. I noticed that cmake's documentation mentions: I've got the same problem as you.My project is a cross-compiled project that develops debugging on x86 machines and deploys and runs on aarch64 machines, depending on the x86 and aarch64 versions of the same package, but cmake doesn't seem to re-search for packages when switching architectures. set(PATH_BOOST_DEFAULT "/softs/boost/$ CACHE INTERNAL "") In my CMake project, I provide a default path to Boost editable by the user.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |