Skip to content

Commit 4a4aecf

Browse files
authored
[CMake] swift-collections → SwiftCollections (#60)
* [CMake] swift-collections → SwiftCollections This is an integration FIXME for SwiftPM: swiftlang/swift-package-manager#3595 (comment) * [CMake] Generate exports under cmake/modules/SwiftCollectionsConfig.cmake
1 parent f1c6cb4 commit 4a4aecf

File tree

3 files changed

+33
-7
lines changed

3 files changed

+33
-7
lines changed

CMakeLists.txt

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ See https://swift.org/LICENSE.txt for license information
88
#]]
99

1010
cmake_minimum_required(VERSION 3.16)
11-
project(swift-collections
11+
project(SwiftCollections
1212
LANGUAGES C Swift)
1313

1414
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)
@@ -29,9 +29,4 @@ add_subdirectory(Sources)
2929
# if(BUILD_TESTING)
3030
# add_subdirectory(Tests)
3131
# endif()
32-
33-
get_property(SWIFT_COLLECTIONS_EXPORTS GLOBAL PROPERTY SWIFT_COLLECTIONS_EXPORTS)
34-
export(TARGETS ${SWIFT_COLLECTIONS_EXPORTS}
35-
NAMESPACE SwiftCollections::
36-
FILE swift-collections-config.cmake
37-
EXPORT_LINK_INTERFACE_LIBRARIES)
32+
add_subdirectory(cmake/modules)

cmake/modules/CMakeLists.txt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#[[
2+
This source file is part of the Swift Collections Open Source Project
3+
4+
Copyright (c) 2021 Apple Inc. and the Swift project authors
5+
Licensed under Apache License v2.0 with Runtime Library Exception
6+
7+
See https://swift.org/LICENSE.txt for license information
8+
#]]
9+
10+
set(SWIFT_COLLECTIONS_EXPORTS_FILE ${CMAKE_CURRENT_BINARY_DIR}/SwiftCollectionsExports.cmake)
11+
12+
configure_file(SwiftCollectionsConfig.cmake.in
13+
${CMAKE_CURRENT_BINARY_DIR}/SwiftCollectionsConfig.cmake)
14+
15+
get_property(SWIFT_COLLECTIONS_EXPORTS GLOBAL PROPERTY SWIFT_COLLECTIONS_EXPORTS)
16+
export(TARGETS ${SWIFT_COLLECTIONS_EXPORTS}
17+
NAMESPACE SwiftCollections::
18+
FILE ${SWIFT_COLLECTIONS_EXPORTS_FILE}
19+
EXPORT_LINK_INTERFACE_LIBRARIES)
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#[[
2+
This source file is part of the Swift Collections Open Source Project
3+
4+
Copyright (c) 2021 Apple Inc. and the Swift project authors
5+
Licensed under Apache License v2.0 with Runtime Library Exception
6+
7+
See https://swift.org/LICENSE.txt for license information
8+
#]]
9+
10+
if(NOT TARGET SwiftCollections)
11+
include(@SWIFT_COLLECTIONS_EXPORTS_FILE@)
12+
endif()

0 commit comments

Comments
 (0)