Replace CHECK_INCLUDE_FILE_CXX() with CMake find_file()

the former doesn't work when cross-compiling
This commit is contained in:
Antoine Villeret 2018-11-13 11:42:50 +01:00
commit 6c548d517e

View file

@ -22,9 +22,8 @@ target_link_libraries(simple-web-server INTERFACE ${CMAKE_THREAD_LIBS_INIT})
# Remove Boost system, thread, regex components; use Boost::<component> aliases; remove Boost target_include_directories # Remove Boost system, thread, regex components; use Boost::<component> aliases; remove Boost target_include_directories
if(USE_STANDALONE_ASIO) if(USE_STANDALONE_ASIO)
target_compile_definitions(simple-web-server INTERFACE USE_STANDALONE_ASIO) target_compile_definitions(simple-web-server INTERFACE USE_STANDALONE_ASIO)
include(CheckIncludeFileCXX) find_file(ASIO_HEADER asio.hpp)
CHECK_INCLUDE_FILE_CXX(asio.hpp HAVE_ASIO) if(NOT ASIO_HEADER)
if(NOT HAVE_ASIO)
message(FATAL_ERROR "Standalone Asio not found") message(FATAL_ERROR "Standalone Asio not found")
endif() endif()
else() else()