llvm-project
24 строки · 825.0 Байт
1find_package(PkgConfig REQUIRED)
2pkg_search_module(ISL isl)
3if (NOT ISL_FOUND EQUAL 1)
4message(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)
9set_property(TARGET ISL APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${incl})
10endforeach()
11
12foreach (libname IN LISTS ISL_LIBRARIES)
13if (ISL_LIBRARY_DIRS)
14foreach (dir IN LISTS ISL_LIBRARY_DIRS)
15list(APPEND hints ${dir})
16endforeach()
17endif()
18find_library(lib NAMES ${libname} HINTS ${hints} NO_DEFAULT_PATH)
19set_property(TARGET ISL APPEND PROPERTY INTERFACE_LINK_LIBRARIES ${lib})
20endforeach()
21
22foreach (opt IN LISTS ISL_CFLAGS ISL_CFLAGS_OTHER)
23set_property(TARGET ISL APPEND PROPERTY INTERFACE_COMPILE_OPTIONS ${opt})
24endforeach()
25