The following lines without a find_package(ament_cmake_core):
find_package(ament_cmake_python)
ament_get_python_install_dir (PYTHON_SITE_PACKAGES)
result in this error:
CMake Error at /opt/ros/jazzy/share/ament_cmake_python/cmake/ament_cmake_python-extras.cmake:59 (get_executable_path):
Unknown CMake command "get_executable_path".
Call Stack (most recent call first):
/opt/ros/jazzy/share/ament_cmake_python/cmake/ament_get_python_install_dir.cmake:23 (_ament_cmake_python_get_python_install_dir)
CMakeLists.txt:172 (ament_get_python_install_dir)
Obviously, ament_cmake_python is missing the find_package(ament_cmake_core) call, which declares the command get_executable_path.