Merge pull request #267 from dgrove-oss/cmake-copy-libdisaptch

CMake compatibility with Swift build assumptions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 4ce0e33..2ec2691 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -188,6 +188,15 @@
                  -fuse-ld=gold)
 endif()
 
+# Temporary staging; the various swift projects that depend on libdispatch
+# all expect libdispatch.so to be in src/.libs/libdispatch.so
+# So for now, make a copy so we don't have to do a coordinated commit across
+# all the swift projects to change this assumption.
+add_custom_command(TARGET dispatch POST_BUILD
+                   COMMAND cmake -E make_directory .libs
+                   COMMAND cmake -E copy $<TARGET_FILE:dispatch> .libs
+                   COMMENT "Copying libdispatch to .libs")
+
 install(TARGETS
           dispatch
         DESTINATION