taka-no-me / android-cmake

CMake toolchain file and other scripts for the Android NDK
1.22k stars 437 forks source link

add find_host_file macro #34

Open rlei opened 9 years ago

rlei commented 9 years ago

This pull request adds a find_host_file macro to cmake find_file, just like find_host_package to the original find_package.

I personally experienced the issue with find_file when building https://github.com/rlei/fastd-android using android-cmake. One of its cmake files has the following

    find_file(DOXYFILE_IN "Doxyfile.in"
            PATHS "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_ROOT}/Modules/"
            NO_DEFAULT_PATH
            DOC "Path to the doxygen configuration template file")

which can't find the file Doxyfile.in in the CMAKE_CURRENT_SOURCE_DIR folder. With the new macro it works fine.

And thanks for your nice work on android-cmake :)

taka-no-me commented 9 years ago

Capturing CMAKE_FIND_ROOT_PATH is not a good way to go. It's better to implement find_host_path similarly to find_host_package