diff --git a/Installation/CMakeLists.txt b/Installation/CMakeLists.txt index 0bf1b14dcf3..0ef9a55756e 100644 --- a/Installation/CMakeLists.txt +++ b/Installation/CMakeLists.txt @@ -708,25 +708,27 @@ macro(add_config_flag flag) endif() endmacro() -file(GLOB all_config_tests "${CGAL_INSTALLATION_PACKAGE_DIR}/config/testfiles/*.cpp") -list(SORT all_config_tests) +if(NOT CMAKE_CROSSCOMPILING) + file(GLOB all_config_tests "${CGAL_INSTALLATION_PACKAGE_DIR}/config/testfiles/*.cpp") + list(SORT all_config_tests) -file(WRITE ${CMAKE_BINARY_DIR}/include/CGAL/compiler_config.h "//\n// compiler_config.h is included by CGAL headers to load the needed compiler settings.\n//\n// DO NOT EDIT compiler_config.h. It is generated by CMake.\n//\n\n") + file(WRITE ${CMAKE_BINARY_DIR}/include/CGAL/compiler_config.h "//\n// compiler_config.h is included by CGAL headers to load the needed compiler settings.\n//\n// DO NOT EDIT compiler_config.h. It is generated by CMake.\n//\n\n") -foreach(config_test_cpp ${all_config_tests}) - # Test's name is .cpp's base name - get_filename_component(config_test_name ${config_test_cpp} NAME_WE) + foreach(config_test_cpp ${all_config_tests}) + # Test's name is .cpp's base name + get_filename_component(config_test_name ${config_test_cpp} NAME_WE) - # Compile and run ${config_test_cpp}. Exit code is stored in ${config_test_name}. - CHECK_CXX_FILE_RUNS(${config_test_cpp} ${config_test_name} ${config_test_name}) - if(${config_test_name}) - set(${config_test_name} 0) - else() - set(${config_test_name} 1) - endif() + # Compile and run ${config_test_cpp}. Exit code is stored in ${config_test_name}. + CHECK_CXX_FILE_RUNS(${config_test_cpp} ${config_test_name} ${config_test_name}) + if(${config_test_name}) + set(${config_test_name} 0) + else() + set(${config_test_name} 1) + endif() - add_config_flag(${config_test_name} ${config_test_name}) -endforeach() + add_config_flag(${config_test_name} ${config_test_name}) + endforeach() +endif() add_config_flag(CGAL_USE_GMP) add_config_flag(CGAL_USE_MPFR)