1find_package(PkgConfig REQUIRED) 2pkg_search_module(ISL isl) 3if (NOT ISL_FOUND EQUAL 1) 4 message(FATAL_ERROR "No libisl found on this system. Consider setting PKG_CONFIG_PATH.") 5endif() 6 7add_library(ISL INTERFACE IMPORTED) 8foreach (incl IN LISTS ISL_INCLUDE_DIRS) 9 set_property(TARGET ISL APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${incl}) 10endforeach() 11 12foreach (libname IN LISTS ISL_LIBRARIES) 13 if (ISL_LIBRARY_DIRS) 14 foreach (dir IN LISTS ISL_LIBRARY_DIRS) 15 list(APPEND hints ${dir}) 16 endforeach() 17 endif() 18 find_library(lib NAMES ${libname} HINTS ${hints} NO_DEFAULT_PATH) 19 set_property(TARGET ISL APPEND PROPERTY INTERFACE_LINK_LIBRARIES ${lib}) 20endforeach() 21 22foreach (opt IN LISTS ISL_CFLAGS ISL_CFLAGS_OTHER) 23 set_property(TARGET ISL APPEND PROPERTY INTERFACE_COMPILE_OPTIONS ${opt}) 24endforeach() 25