I'm currently creating a CMake project in which a couple of Python scripts are called as commands/targets whenever some classic targets are properly executed (classic compilation).
I want CMake to Check the presence of 2 kind of elements (error if not found):
- Presence of Python interpreter (let's say Python 3 but both Python 2.7 and 3 are compatible),
- Presence of Python packages installed by pip(3).
For the first part, I use that code snippet which seems to work well:
find_package(
Python3
REQUIRED
COMPONENTS Interpreter
)
But how to specify that I want some pip packages (like pycryptodome) to be installed?
Note: The Python scripts I use are third-party scripts which are only run as post-compilation tools: They are not required as development dependency for any target.