I have custom Find.cmake. Is it possible to retrieve version, passed to the find_package() call, inside of it?
How can I get the version argument of a find_package() call in my find module script?
159 Views Asked by Nickolay Olshevsky At
1
There are 1 best solutions below
Related Questions in CMAKE
- Build issue in my STM32-NUCLEO project using the Eclipse IDE
- CMake: "dereference" INCLUDE commands to create a single CMakeLists.txt
- Conda CMAKE CXX Compiler error while compiling Pytorch
- How to setup nist nbis in raspbian raspberry pi 4
- Compiling c++ code by VS Code is always blocked by clang-tidy error 'Error running 'clang-tidy'
- library X11_Xmu_LIB is not found
- Cannot build a basic project with curl on Mac (M2) for Raspberry Pi Pico
- How to install spdlog library?
- How to generate vulkan project so it is cross-platform? (Using CMake)
- If target A depends on B, are B's POST_BUILD commands guaranteed to be executed before A starting to build?
- i have installed qt version 6.0.3 and this error QMYSQL driver not loaded displaying again and again
- Configure CmakeLists.txt to avoid manually copying dlls
- Cmake is not building an executable
- How to use "wx_dpi_aware.manifest" of wxWidgets wxMSW with MinGW and CMake?
- Try to Install GLFW on Steam Deck
Related Questions in CMAKE-MODULES
- link dependent android ndk cmake project to main android ndk library project
- Creating so files from Android Project and loading them in the other project
- Github repository giving an error while building in PyCharm venv
- Wrong include directory when ICU_ROOT is defined for FindICU.cmake
- find_package python3 error on windows with missing Python3_SOABI
- Excluding cmake's own distribution modules with `find_package()`
- How to define a target to include multiple libraries stored in a single directory
- How to compile Apache Arrow Flight C++ example in Windows-10 (VS 2019)
- CMake Error: Unknown argument -VV when installing Trilinos
- CMake variable contents dependent on build/install
- Set LINK_FLAGS for INTERFACE libraries in cmake
- CMake find_package: where did it find the package?
- CMake is searching for packages in a strange location
- Including pybind11 cmake files with Hunter
- How do I Install bundled interface dependencies with modern CMake?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
The requested version can be extracted via
<PackageName>_FIND_VERSIONvariable, where<PackageName>substitution denotes the package name (the first parameter of thefind_package):There are also other variables, which describes the version request in more details. See documentation for find_package.
Note, that if your Find script searches the only instance of the package, then you don't need to explicitly check the requested version: just extract version of the package which you have found, and pass it via VERSION_VAR parameter of find_package_handle_standard_args helper. That helper will automatically checks whether requested version is compatible with the one which has been found.