Skip to content

Commit 47186bd

Browse files
committed
Include FoundationConfig.cmake
1 parent caf26e9 commit 47186bd

File tree

6 files changed

+43
-5
lines changed

6 files changed

+43
-5
lines changed

Sources/CoreFoundation/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,3 @@ target_link_libraries(_CoreFoundation PUBLIC
3838

3939
target_link_libraries(_CoreFoundation PRIVATE
4040
dispatch)
41-
42-
set_property(GLOBAL APPEND PROPERTY SWIFT_FOUNDATION_EXPORTS _CoreFoundation)

Sources/Foundation/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ install(TARGETS Foundation
3131
LIBRARY DESTINATION lib
3232
RUNTIME DESTINATION bin)
3333

34-
set_property(GLOBAL APPEND PROPERTY SWIFT_FOUNDATION_EXPORTS Foundation)
34+
set_property(GLOBAL APPEND PROPERTY Foundation_EXPORTS Foundation)

Sources/FoundationNetworking/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ install(TARGETS FoundationNetworking
2929
LIBRARY DESTINATION lib
3030
RUNTIME DESTINATION bin)
3131

32-
set_property(GLOBAL APPEND PROPERTY SWIFT_FOUNDATION_EXPORTS FoundationNetworking)
32+
set_property(GLOBAL APPEND PROPERTY Foundation_EXPORTS FoundationNetworking)

Sources/FoundationXML/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ install(TARGETS FoundationXML
2929
LIBRARY DESTINATION lib
3030
RUNTIME DESTINATION bin)
3131

32-
set_property(GLOBAL APPEND PROPERTY SWIFT_FOUNDATION_EXPORTS FoundationXML)
32+
set_property(GLOBAL APPEND PROPERTY Foundation_EXPORTS FoundationXML)

cmake/modules/CMakeLists.txt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
##===----------------------------------------------------------------------===##
2+
##
3+
## This source file is part of the Swift open source project
4+
##
5+
## Copyright (c) 2024 Apple Inc. and the Swift project authors
6+
## Licensed under Apache License v2.0
7+
##
8+
## See LICENSE.txt for license information
9+
## See CONTRIBUTORS.md for the list of Swift project authors
10+
##
11+
## SPDX-License-Identifier: Apache-2.0
12+
##
13+
##===----------------------------------------------------------------------===##
14+
15+
set(Foundation_EXPORTS_FILE ${CMAKE_CURRENT_BINARY_DIR}/FoundationExports.cmake)
16+
configure_file(FoundationConfig.cmake.in
17+
${CMAKE_CURRENT_BINARY_DIR}/FoundationConfig.cmake)
18+
19+
get_property(Foundation_EXPORTS GLOBAL PROPERTY Foundation_EXPORTS)
20+
export(TARGETS ${Foundation_EXPORTS}
21+
NAMESPACE Foundation::
22+
FILE ${Foundation_EXPORTS_FILE}
23+
EXPORT_LINK_INTERFACE_LIBRARIES)
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
##===----------------------------------------------------------------------===##
2+
##
3+
## This source file is part of the Swift open source project
4+
##
5+
## Copyright (c) 2024 Apple Inc. and the Swift project authors
6+
## Licensed under Apache License v2.0
7+
##
8+
## See LICENSE.txt for license information
9+
## See CONTRIBUTORS.md for the list of Swift project authors
10+
##
11+
## SPDX-License-Identifier: Apache-2.0
12+
##
13+
##===----------------------------------------------------------------------===##
14+
15+
if(NOT TARGET Foundation)
16+
include(@Foundation_EXPORTS_FILE@)
17+
endif()

0 commit comments

Comments
 (0)