Skip to content
This repository was archived by the owner on Apr 23, 2025. It is now read-only.

Commit 5ed492b

Browse files
committed
Update CMake config
1 parent adaaf94 commit 5ed492b

File tree

4 files changed

+26
-1
lines changed

4 files changed

+26
-1
lines changed

Examples/LeNet-MNIST/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ add_executable(LeNet-MNIST
22
main.swift)
33
target_link_libraries(LeNet-MNIST PRIVATE
44
ImageClassificationModels
5+
LayerInit
56
Datasets)
67

78

Models/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
add_subdirectory(ImageClassification)
2+
add_subdirectory(LayerInit)
23
add_subdirectory(Recommendation)
34
add_subdirectory(Text)

Models/ImageClassification/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ set_target_properties(ImageClassificationModels PROPERTIES
1515
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY})
1616
target_compile_options(ImageClassificationModels PRIVATE
1717
$<$<BOOL:${BUILD_TESTING}>:-enable-testing>)
18-
18+
target_link_libraries(ImageClassificationModels PUBLIC
19+
LayerInit)
1920

2021
install(TARGETS ImageClassificationModels
2122
ARCHIVE DESTINATION lib/swift/$<LOWER_CASE:${CMAKE_SYSTEM_NAME}>

Models/LayerInit/CMakeLists.txt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
add_library(LayerInit
2+
AutoConv.swift
3+
AutoDense.swift
4+
AutoFlatten.swift
5+
AutoLayer.swift
6+
AutoPool.swift
7+
AutoSequenced.swift)
8+
set_target_properties(LayerInit PROPERTIES
9+
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY})
10+
target_compile_options(LayerInit PRIVATE
11+
$<$<BOOL:${BUILD_TESTING}>:-enable-testing>)
12+
13+
14+
install(TARGETS LayerInit
15+
ARCHIVE DESTINATION lib/swift/$<LOWER_CASE:${CMAKE_SYSTEM_NAME}>
16+
LIBRARY DESTINATION lib/swift/$<LOWER_CASE:${CMAKE_SYSTEM_NAME}>
17+
RUNTIME DESTINATION bin)
18+
get_swift_host_arch(swift_arch)
19+
install(FILES
20+
$<TARGET_PROPERTY:LayerInit,Swift_MODULE_DIRECTORY>/LayerInit.swiftdoc
21+
$<TARGET_PROPERTY:LayerInit,Swift_MODULE_DIRECTORY>/LayerInit.swiftmodule
22+
DESTINATION lib/swift$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:_static>/$<LOWER_CASE:${CMAKE_SYSTEM_NAME}>/${swift_arch})

0 commit comments

Comments
 (0)