cmake_path — CMake 3.23.0-rc4 Documentation
cmake.org › cmake › helpcmake_path. ¶. New in version 3.20. This command is for the manipulation of paths. Only syntactic aspects of paths are handled, there is no interaction of any kind with any underlying file system. The path may represent a non-existing path or even one that is not allowed to exist on the current file system or platform.
get_filename_component — CMake 3.23.0-rc4 Documentation
cmake.org › cmake › helpIf no base directory is provided, the default base directory will be CMAKE_CURRENT_SOURCE_DIR. Paths are returned with forward slashes and have no trailing slashes. If the optional CACHE argument is specified, the result variable is added to the cache. get_filename_component (<var> <FileName> PROGRAM [PROGRAM_ARGS <arg_var>] [CACHE])
CMake : parent directory?
newbedev.com › cmake-parent-directoryAs of CMake 3.20, you can use the cmake_path command to get the parent directory of a given path: cmake_path(GET <path-var> PARENT_PATH <out-var>) This command supersedes the get_filename_component command. So, in your example, it would look like this: cmake_path(GET MYPROJECT_DIR PARENT_PATH PARENT_DIR)
find_path — CMake 3.23.0-rc3 Documentation
cmake.org › cmake › helpThe CMake variable CMAKE_FIND_ROOT_PATH specifies one or more directories to be prepended to all other search directories. This effectively "re-roots" the entire search under given locations. Paths which are descendants of the CMAKE_STAGING_PREFIX are excluded from this re-rooting, because that variable is always a path on the host system.