If OpenBLAS is built using add_subdirectory(OpenBlas) as part of another project then the paths set by CMAKE_XXX_DIR are relative to the parent project and not the OpenBLAS project.