1 if (NOT LIBCXX_INSTALL_SUPPORT_HEADERS)
2 set(LIBCXX_SUPPORT_HEADER_PATTERN PATTERN "support" EXCLUDE)
5 set(LIBCXX_HEADER_PATTERN
7 PATTERN "CMakeLists.txt" EXCLUDE
9 PATTERN "__config_site.in" EXCLUDE
10 ${LIBCXX_SUPPORT_HEADER_PATTERN}
13 if(NOT LIBCXX_USING_INSTALLED_LLVM AND LLVM_BINARY_DIR)
15 DESTINATION "${LLVM_BINARY_DIR}/include/c++/v1"
17 ${LIBCXX_HEADER_PATTERN}
21 if (LIBCXX_INSTALL_HEADERS)
23 DESTINATION ${LIBCXX_INSTALL_PREFIX}include/c++/v1
26 ${LIBCXX_HEADER_PATTERN}
27 PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
30 if (LIBCXX_NEEDS_SITE_CONFIG)
31 # Generate and install a custom __config header. The new header is created
32 # by prepending __config_site to the current __config header.
33 add_custom_command(OUTPUT ${LIBCXX_BINARY_DIR}/__generated_config
34 COMMAND ${PYTHON_EXECUTABLE} ${LIBCXX_SOURCE_DIR}/utils/cat_files.py
35 ${LIBCXX_BINARY_DIR}/__config_site
36 ${LIBCXX_SOURCE_DIR}/include/__config
37 -o ${LIBCXX_BINARY_DIR}/__generated_config
38 DEPENDS ${LIBCXX_SOURCE_DIR}/include/__config
39 ${LIBCXX_BINARY_DIR}/__config_site
41 # Add a target that executes the generation commands.
42 add_custom_target(generate_config_header ALL
43 DEPENDS ${LIBCXX_BINARY_DIR}/__generated_config)
44 set(generated_config_deps generate_config_header)
45 # Install the generated header as __config.
46 install(FILES ${LIBCXX_BINARY_DIR}/__generated_config
47 DESTINATION ${LIBCXX_INSTALL_PREFIX}include/c++/v1
48 PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
50 COMPONENT cxx-headers)
53 if (NOT CMAKE_CONFIGURATION_TYPES)
54 # this target is just needed as a placeholder for the distribution target
55 add_custom_target(cxx-headers)
56 add_custom_target(install-cxx-headers
57 DEPENDS cxx-headers ${generated_config_deps}
58 COMMAND "${CMAKE_COMMAND}"
59 -DCMAKE_INSTALL_COMPONENT=cxx-headers
60 -P "${CMAKE_BINARY_DIR}/cmake_install.cmake")
62 add_custom_target(libcxx-headers)
63 add_custom_target(install-libcxx-headers DEPENDS install-cxx-headers)