1 cmake_minimum_required(VERSION 2.8.8)
3 # FIXME: It may be removed when we use 2.8.12.
4 if(CMAKE_VERSION VERSION_LESS 2.8.12)
5 # Invalidate a couple of keywords.
6 set(cmake_2_8_12_INTERFACE)
7 set(cmake_2_8_12_PRIVATE)
9 # Use ${cmake_2_8_12_KEYWORD} intead of KEYWORD in target_link_libraries().
10 set(cmake_2_8_12_INTERFACE INTERFACE)
11 set(cmake_2_8_12_PRIVATE PRIVATE)
13 cmake_policy(SET CMP0022 NEW) # automatic when 2.8.12 is required
17 # If we are not building as a part of LLVM, build Clang as an
18 # standalone project, using LLVM as an external library:
19 if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )
22 # Rely on llvm-config.
24 find_program(LLVM_CONFIG "llvm-config")
26 message(STATUS "Found LLVM_CONFIG as ${LLVM_CONFIG}")
27 set(CONFIG_COMMAND ${LLVM_CONFIG}
35 COMMAND ${CONFIG_COMMAND}
36 RESULT_VARIABLE HAD_ERROR
37 OUTPUT_VARIABLE CONFIG_OUTPUT
41 "[ \t]*[\r\n]+[ \t]*" ";"
42 CONFIG_OUTPUT ${CONFIG_OUTPUT})
44 string(REPLACE ";" " " CONFIG_COMMAND_STR "${CONFIG_COMMAND}")
45 message(STATUS "${CONFIG_COMMAND_STR}")
46 message(FATAL_ERROR "llvm-config failed with status ${HAD_ERROR}")
49 message(FATAL_ERROR "llvm-config not found -- ${LLVM_CONFIG}")
52 list(GET CONFIG_OUTPUT 0 ENABLE_ASSERTIONS)
53 list(GET CONFIG_OUTPUT 1 TOOLS_BINARY_DIR)
54 list(GET CONFIG_OUTPUT 2 LIBRARY_DIR)
55 list(GET CONFIG_OUTPUT 3 INCLUDE_DIR)
56 list(GET CONFIG_OUTPUT 4 LLVM_OBJ_ROOT)
57 list(GET CONFIG_OUTPUT 5 MAIN_SRC_DIR)
60 set(LLVM_ENABLE_ASSERTIONS ${ENABLE_ASSERTIONS}
61 CACHE BOOL "Enable assertions")
62 # Assertions should follow llvm-config's.
63 mark_as_advanced(LLVM_ENABLE_ASSERTIONS)
66 set(LLVM_TOOLS_BINARY_DIR ${TOOLS_BINARY_DIR} CACHE PATH "Path to llvm/bin")
67 set(LLVM_LIBRARY_DIR ${LIBRARY_DIR} CACHE PATH "Path to llvm/lib")
68 set(LLVM_MAIN_INCLUDE_DIR ${INCLUDE_DIR} CACHE PATH "Path to llvm/include")
69 set(LLVM_BINARY_DIR ${LLVM_OBJ_ROOT} CACHE PATH "Path to LLVM build tree")
70 set(LLVM_MAIN_SRC_DIR ${MAIN_SRC_DIR} CACHE PATH "Path to LLVM source tree")
72 find_program(LLVM_TABLEGEN_EXE "llvm-tblgen" ${LLVM_TOOLS_BINARY_DIR}
75 set(LLVM_CMAKE_PATH "${LLVM_BINARY_DIR}/share/llvm/cmake")
76 set(LLVMCONFIG_FILE "${LLVM_CMAKE_PATH}/LLVMConfig.cmake")
77 if(EXISTS ${LLVMCONFIG_FILE})
78 list(APPEND CMAKE_MODULE_PATH "${LLVM_CMAKE_PATH}")
79 include(${LLVMCONFIG_FILE})
81 message(FATAL_ERROR "Not found: ${LLVMCONFIG_FILE}")
84 # They are used as destination of target generators.
85 set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin)
86 set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX})
88 # DLL platform -- put DLLs into bin.
89 set(LLVM_SHLIB_OUTPUT_INTDIR ${LLVM_RUNTIME_OUTPUT_INTDIR})
91 set(LLVM_SHLIB_OUTPUT_INTDIR ${LLVM_LIBRARY_OUTPUT_INTDIR})
94 option(LLVM_INSTALL_TOOLCHAIN_ONLY
95 "Only include toolchain files in the 'install' target." OFF)
97 option(LLVM_FORCE_USE_OLD_HOST_TOOLCHAIN
98 "Set to ON to force using an old, unsupported host toolchain." OFF)
102 include(HandleLLVMOptions)
104 set(PACKAGE_VERSION "${LLVM_PACKAGE_VERSION}")
106 if (NOT DEFINED LLVM_INCLUDE_TESTS)
107 set(LLVM_INCLUDE_TESTS ON)
110 include_directories("${LLVM_BINARY_DIR}/include" "${LLVM_MAIN_INCLUDE_DIR}")
111 link_directories("${LLVM_LIBRARY_DIR}")
113 set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin )
114 set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX} )
115 set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX} )
117 if(LLVM_INCLUDE_TESTS)
118 # Check prebuilt llvm/utils.
119 if(EXISTS ${LLVM_TOOLS_BINARY_DIR}/FileCheck${CMAKE_EXECUTABLE_SUFFIX}
120 AND EXISTS ${LLVM_TOOLS_BINARY_DIR}/count${CMAKE_EXECUTABLE_SUFFIX}
121 AND EXISTS ${LLVM_TOOLS_BINARY_DIR}/not${CMAKE_EXECUTABLE_SUFFIX})
122 set(LLVM_UTILS_PROVIDED ON)
125 if(EXISTS ${LLVM_MAIN_SRC_DIR}/utils/lit/lit.py)
126 set(LLVM_LIT ${LLVM_MAIN_SRC_DIR}/utils/lit/lit.py)
127 if(NOT LLVM_UTILS_PROVIDED)
128 add_subdirectory(${LLVM_MAIN_SRC_DIR}/utils/FileCheck utils/FileCheck)
129 add_subdirectory(${LLVM_MAIN_SRC_DIR}/utils/count utils/count)
130 add_subdirectory(${LLVM_MAIN_SRC_DIR}/utils/not utils/not)
131 set(LLVM_UTILS_PROVIDED ON)
132 set(CLANG_TEST_DEPS FileCheck count not)
134 set(UNITTEST_DIR ${LLVM_MAIN_SRC_DIR}/utils/unittest)
135 if(EXISTS ${UNITTEST_DIR}/googletest/include/gtest/gtest.h
136 AND NOT EXISTS ${LLVM_LIBRARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX}
137 AND EXISTS ${UNITTEST_DIR}/CMakeLists.txt)
138 add_subdirectory(${UNITTEST_DIR} utils/unittest)
141 # Seek installed Lit.
142 find_program(LLVM_LIT "lit.py" ${LLVM_MAIN_SRC_DIR}/utils/lit
143 DOC "Path to lit.py")
147 # Define the default arguments to use with 'lit', and an option for the user
149 set(LIT_ARGS_DEFAULT "-sv")
151 set(LIT_ARGS_DEFAULT "${LIT_ARGS_DEFAULT} --no-progress-bar")
153 set(LLVM_LIT_ARGS "${LIT_ARGS_DEFAULT}" CACHE STRING "Default options for lit")
155 # On Win32 hosts, provide an option to specify the path to the GnuWin32 tools.
156 if( WIN32 AND NOT CYGWIN )
157 set(LLVM_LIT_TOOLS_DIR "" CACHE PATH "Path to GnuWin32 tools")
160 set(LLVM_INCLUDE_TESTS OFF)
164 set( CLANG_BUILT_STANDALONE 1 )
165 set(BACKEND_PACKAGE_STRING "LLVM ${LLVM_PACKAGE_VERSION}")
167 set(BACKEND_PACKAGE_STRING "${PACKAGE_STRING}")
170 find_package(LibXml2)
172 set(CLANG_HAVE_LIBXML 1)
175 set(CLANG_RESOURCE_DIR "" CACHE STRING
176 "Relative directory from the Clang binary to its resource files.")
178 set(C_INCLUDE_DIRS "" CACHE STRING
179 "Colon separated list of directories clang will search for headers.")
181 set(GCC_INSTALL_PREFIX "" CACHE PATH "Directory where gcc is installed." )
182 set(DEFAULT_SYSROOT "" CACHE PATH
183 "Default <path> to all compiler invocations for --sysroot=<path>." )
185 set(CLANG_DEFAULT_OPENMP_RUNTIME "libgomp" CACHE STRING
186 "Default OpenMP runtime used by -fopenmp.")
188 set(CLANG_VENDOR "" CACHE STRING
189 "Vendor-specific text for showing with version information.")
192 add_definitions( -DCLANG_VENDOR="${CLANG_VENDOR} " )
195 set(CLANG_REPOSITORY_STRING "" CACHE STRING
196 "Vendor-specific text for showing the repository the source is taken from.")
198 if(CLANG_REPOSITORY_STRING)
199 add_definitions(-DCLANG_REPOSITORY_STRING="${CLANG_REPOSITORY_STRING}")
202 set(CLANG_VENDOR_UTI "org.llvm.clang" CACHE STRING
203 "Vendor-specific uti.")
205 # The libdir suffix must exactly match whatever LLVM's configuration used.
206 set(CLANG_LIBDIR_SUFFIX "${LLVM_LIBDIR_SUFFIX}")
208 set(CLANG_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
209 set(CLANG_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
211 if( CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR AND NOT MSVC_IDE )
212 message(FATAL_ERROR "In-source builds are not allowed. CMake would overwrite "
213 "the makefiles distributed with LLVM. Please create a directory and run cmake "
214 "from there, passing the path to this source directory as the last argument. "
215 "This process created the file `CMakeCache.txt' and the directory "
216 "`CMakeFiles'. Please delete them.")
219 if( NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR )
221 tablegenned_files_on_include_dir
222 "${CLANG_SOURCE_DIR}/include/clang/*.inc")
223 if( tablegenned_files_on_include_dir )
224 message(FATAL_ERROR "Apparently there is a previous in-source build, "
225 "probably as the result of running `configure' and `make' on "
226 "${CLANG_SOURCE_DIR}. This may cause problems. The suspicious files are:\n"
227 "${tablegenned_files_on_include_dir}\nPlease clean the source directory.")
231 # Compute the Clang version from the LLVM version.
232 string(REGEX MATCH "[0-9]+\\.[0-9]+(\\.[0-9]+)?" CLANG_VERSION
234 message(STATUS "Clang version: ${CLANG_VERSION}")
236 string(REGEX REPLACE "([0-9]+)\\.[0-9]+(\\.[0-9]+)?" "\\1" CLANG_VERSION_MAJOR
238 string(REGEX REPLACE "[0-9]+\\.([0-9]+)(\\.[0-9]+)?" "\\1" CLANG_VERSION_MINOR
240 if (${CLANG_VERSION} MATCHES "[0-9]+\\.[0-9]+\\.[0-9]+")
241 set(CLANG_HAS_VERSION_PATCHLEVEL 1)
242 string(REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" CLANG_VERSION_PATCHLEVEL
245 set(CLANG_HAS_VERSION_PATCHLEVEL 0)
248 # Configure the Version.inc file.
250 ${CMAKE_CURRENT_SOURCE_DIR}/include/clang/Basic/Version.inc.in
251 ${CMAKE_CURRENT_BINARY_DIR}/include/clang/Basic/Version.inc)
253 # Add appropriate flags for GCC
254 if (LLVM_COMPILER_IS_GCC_COMPATIBLE)
255 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-common -Woverloaded-virtual -fno-strict-aliasing")
257 # Enable -pedantic for Clang even if it's not enabled for LLVM.
258 if (NOT LLVM_ENABLE_PEDANTIC)
259 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Wno-long-long")
262 check_cxx_compiler_flag("-Werror -Wnested-anon-types" CXX_SUPPORTS_NO_NESTED_ANON_TYPES_FLAG)
263 if( CXX_SUPPORTS_NO_NESTED_ANON_TYPES_FLAG )
264 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-nested-anon-types" )
268 # Determine HOST_LINK_VERSION on Darwin.
269 set(HOST_LINK_VERSION)
273 COMMAND sh -c "${CMAKE_LINKER} -v 2>&1 | head -1"
274 RESULT_VARIABLE HAD_ERROR
275 OUTPUT_VARIABLE LD_V_OUTPUT
278 if ("${LD_V_OUTPUT}" MATCHES ".*ld64-([0-9.]+).*")
279 string(REGEX REPLACE ".*ld64-([0-9.]+).*" "\\1" HOST_LINK_VERSION ${LD_V_OUTPUT})
280 elseif ("${LD_V_OUTPUT}" MATCHES "[^0-9]*([0-9.]+).*")
281 string(REGEX REPLACE "[^0-9]*([0-9.]+).*" "\\1" HOST_LINK_VERSION ${LD_V_OUTPUT})
284 message(FATAL_ERROR "${CMAKE_LINKER} failed with status ${HAD_ERROR}")
289 ${CLANG_SOURCE_DIR}/include/clang/Config/config.h.cmake
290 ${CLANG_BINARY_DIR}/include/clang/Config/config.h)
292 include(CMakeParseArguments)
294 function(clang_tablegen)
296 # clang_tablegen output-file [tablegen-arg ...] SOURCE source-file
297 # [[TARGET cmake-target-name] [DEPENDS extra-dependency ...]]
299 # Generates a custom command for invoking tblgen as
301 # tblgen source-file -o=output-file tablegen-arg ...
303 # and, if cmake-target-name is provided, creates a custom target for
304 # executing the custom command depending on output-file. It is
305 # possible to list more files to depend after DEPENDS.
307 cmake_parse_arguments(CTG "" "SOURCE;TARGET" "" ${ARGN})
310 message(FATAL_ERROR "SOURCE source-file required by clang_tablegen")
313 set( LLVM_TARGET_DEFINITIONS ${CTG_SOURCE} )
314 tablegen(CLANG ${CTG_UNPARSED_ARGUMENTS})
317 add_public_tablegen_target(${CTG_TARGET})
318 set_target_properties( ${CTG_TARGET} PROPERTIES FOLDER "Clang tablegenning")
319 set_property(GLOBAL APPEND PROPERTY CLANG_TABLEGEN_TARGETS ${CTG_TARGET})
321 endfunction(clang_tablegen)
323 macro(set_clang_windows_version_resource_properties name)
324 if(DEFINED windows_resource_file)
325 set_windows_version_resource_properties(${name} ${windows_resource_file}
326 VERSION_MAJOR ${CLANG_VERSION_MAJOR}
327 VERSION_MINOR ${CLANG_VERSION_MINOR}
328 VERSION_PATCHLEVEL ${CLANG_VERSION_PATCHLEVEL}
329 VERSION_STRING "${CLANG_VERSION} (${BACKEND_PACKAGE_STRING})"
330 PRODUCT_NAME "clang")
334 macro(add_clang_library name)
335 cmake_parse_arguments(ARG
341 if(MSVC_IDE OR XCODE)
343 file(RELATIVE_PATH lib_path
344 ${CLANG_SOURCE_DIR}/lib/
345 ${CMAKE_CURRENT_SOURCE_DIR}
347 if(NOT lib_path MATCHES "^[.][.]")
348 file( GLOB_RECURSE headers
349 ${CLANG_SOURCE_DIR}/include/clang/${lib_path}/*.h
350 ${CLANG_SOURCE_DIR}/include/clang/${lib_path}/*.def
352 set_source_files_properties(${headers} PROPERTIES HEADER_FILE_ONLY ON)
354 file( GLOB_RECURSE tds
355 ${CLANG_SOURCE_DIR}/include/clang/${lib_path}/*.td
357 source_group("TableGen descriptions" FILES ${tds})
358 set_source_files_properties(${tds}} PROPERTIES HEADER_FILE_ONLY ON)
361 set(srcs ${headers} ${tds})
364 endif(MSVC_IDE OR XCODE)
365 if(srcs OR ARG_ADDITIONAL_HEADERS)
369 ${ARG_ADDITIONAL_HEADERS} # It may contain unparsed unknown args.
372 llvm_add_library(${name} ${ARG_UNPARSED_ARGUMENTS} ${srcs})
375 target_link_libraries(${name} ${cmake_2_8_12_INTERFACE} ${LLVM_COMMON_LIBS})
377 if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ${name} STREQUAL "libclang")
378 install(TARGETS ${name}
380 LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
381 ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}
382 RUNTIME DESTINATION bin)
384 set_property(GLOBAL APPEND PROPERTY CLANG_EXPORTS ${name})
386 # Add empty "phony" target
387 add_custom_target(${name})
390 set_target_properties(${name} PROPERTIES FOLDER "Clang libraries")
391 set_clang_windows_version_resource_properties(${name})
392 endmacro(add_clang_library)
394 macro(add_clang_executable name)
395 add_llvm_executable( ${name} ${ARGN} )
396 set_target_properties(${name} PROPERTIES FOLDER "Clang executables")
397 set_clang_windows_version_resource_properties(${name})
398 endmacro(add_clang_executable)
400 set(CMAKE_INCLUDE_CURRENT_DIR ON)
402 include_directories(BEFORE
403 ${CMAKE_CURRENT_BINARY_DIR}/include
404 ${CMAKE_CURRENT_SOURCE_DIR}/include
407 if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
408 install(DIRECTORY include/clang include/clang-c
413 PATTERN "config.h" EXCLUDE
414 PATTERN ".svn" EXCLUDE
417 install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/clang
420 PATTERN "CMakeFiles" EXCLUDE
426 install(DIRECTORY include/clang-c
430 PATTERN ".svn" EXCLUDE
433 add_definitions( -D_GNU_SOURCE )
435 option(CLANG_ENABLE_ARCMT "Build ARCMT." ON)
436 if (CLANG_ENABLE_ARCMT)
437 set(ENABLE_CLANG_ARCMT "1")
439 set(ENABLE_CLANG_ARCMT "0")
442 option(CLANG_ENABLE_STATIC_ANALYZER "Build static analyzer." ON)
443 if (CLANG_ENABLE_STATIC_ANALYZER)
444 set(ENABLE_CLANG_STATIC_ANALYZER "1")
446 set(ENABLE_CLANG_STATIC_ANALYZER "0")
449 if (NOT CLANG_ENABLE_STATIC_ANALYZER AND CLANG_ENABLE_ARCMT)
450 message(FATAL_ERROR "Cannot disable static analyzer while enabling ARCMT")
453 if(CLANG_ENABLE_ARCMT)
454 add_definitions(-DCLANG_ENABLE_ARCMT)
455 add_definitions(-DCLANG_ENABLE_OBJC_REWRITER)
457 if(CLANG_ENABLE_STATIC_ANALYZER)
458 add_definitions(-DCLANG_ENABLE_STATIC_ANALYZER)
461 # Clang version information
462 set(CLANG_EXECUTABLE_VERSION
463 "${CLANG_VERSION_MAJOR}.${CLANG_VERSION_MINOR}" CACHE STRING
464 "Version number that will be placed into the clang executable, in the form XX.YY")
465 set(LIBCLANG_LIBRARY_VERSION
466 "${CLANG_VERSION_MAJOR}.${CLANG_VERSION_MINOR}" CACHE STRING
467 "Version number that will be placed into the libclang library , in the form XX.YY")
468 mark_as_advanced(CLANG_EXECUTABLE_VERSION LIBCLANG_LIBRARY_VERSION)
470 add_subdirectory(utils/TableGen)
472 add_subdirectory(include)
474 # All targets below may depend on all tablegen'd files.
475 get_property(CLANG_TABLEGEN_TARGETS GLOBAL PROPERTY CLANG_TABLEGEN_TARGETS)
476 list(APPEND LLVM_COMMON_DEPENDS ${CLANG_TABLEGEN_TARGETS})
478 add_subdirectory(lib)
479 add_subdirectory(tools)
480 add_subdirectory(runtime)
482 option(CLANG_BUILD_EXAMPLES "Build CLANG example programs by default." OFF)
483 if (CLANG_BUILD_EXAMPLES)
484 set(ENABLE_CLANG_EXAMPLES "1")
486 set(ENABLE_CLANG_EXAMPLES "0")
488 add_subdirectory(examples)
490 option(CLANG_INCLUDE_TESTS
491 "Generate build targets for the Clang unit tests."
492 ${LLVM_INCLUDE_TESTS})
494 if( CLANG_INCLUDE_TESTS )
495 if(EXISTS ${LLVM_MAIN_SRC_DIR}/utils/unittest/googletest/include/gtest/gtest.h)
496 add_subdirectory(unittests)
497 list(APPEND CLANG_TEST_DEPS ClangUnitTests)
498 list(APPEND CLANG_TEST_PARAMS
499 clang_unit_site_config=${CMAKE_CURRENT_BINARY_DIR}/test/Unit/lit.site.cfg
502 add_subdirectory(test)
504 if(CLANG_BUILT_STANDALONE)
505 # Add a global check rule now that all subdirectories have been traversed
506 # and we know the total set of lit testsuites.
507 get_property(LLVM_LIT_TESTSUITES GLOBAL PROPERTY LLVM_LIT_TESTSUITES)
508 get_property(LLVM_LIT_PARAMS GLOBAL PROPERTY LLVM_LIT_PARAMS)
509 get_property(LLVM_LIT_DEPENDS GLOBAL PROPERTY LLVM_LIT_DEPENDS)
510 get_property(LLVM_LIT_EXTRA_ARGS GLOBAL PROPERTY LLVM_LIT_EXTRA_ARGS)
511 add_lit_target(check-all
512 "Running all regression tests"
513 ${LLVM_LIT_TESTSUITES}
514 PARAMS ${LLVM_LIT_PARAMS}
515 DEPENDS ${LLVM_LIT_DEPENDS}
516 ARGS ${LLVM_LIT_EXTRA_ARGS}
521 option(CLANG_INCLUDE_DOCS "Generate build targets for the Clang docs."
522 ${LLVM_INCLUDE_DOCS})
523 if( CLANG_INCLUDE_DOCS )
524 add_subdirectory(docs)
527 set(CLANG_ORDER_FILE "" CACHE FILEPATH
528 "Order file to use when compiling clang in order to improve startup time.")
530 if (CLANG_BUILT_STANDALONE)
531 # Generate a list of CMake library targets so that other CMake projects can
532 # link against them. LLVM calls its version of this file LLVMExports.cmake, but
533 # the usual CMake convention seems to be ${Project}Targets.cmake.
534 set(CLANG_INSTALL_PACKAGE_DIR share/clang/cmake)
535 set(clang_cmake_builddir "${CMAKE_BINARY_DIR}/${CLANG_INSTALL_PACKAGE_DIR}")
536 get_property(CLANG_EXPORTS GLOBAL PROPERTY CLANG_EXPORTS)
537 export(TARGETS ${CLANG_EXPORTS} FILE ${clang_cmake_builddir}/ClangTargets.cmake)
539 # Install a <prefix>/share/clang/cmake/ClangConfig.cmake file so that
540 # find_package(Clang) works. Install the target list with it.
541 install(EXPORT ClangTargets DESTINATION ${CLANG_INSTALL_PACKAGE_DIR})
544 ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/ClangConfig.cmake
545 DESTINATION share/clang/cmake)
547 # Also copy ClangConfig.cmake to the build directory so that dependent projects
548 # can build against a build directory of Clang more easily.
550 ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/ClangConfig.cmake
551 ${CLANG_BINARY_DIR}/share/clang/cmake/ClangConfig.cmake