CMAKE_CURRENT_BINARY_DIR should be used here instead of CMAKE_BINARY_DIR when using in subproject where the output of sub cmake projects could be in BinaryDirectory/subproject/, CMAKE_BINARY_DIR points to BinaryDirectory/ in that case and the python scripts can not be found.
CMAKE_CURRENT_BINARY_DIR
should be used here instead ofCMAKE_BINARY_DIR
when using in subproject where the output of sub cmake projects could be inBinaryDirectory/subproject/
,CMAKE_BINARY_DIR
points toBinaryDirectory/
in that case and the python scripts can not be found.