summaryrefslogtreecommitdiffstats
path: root/cmake/Modules/MacroCopyFile.cmake
diff options
context:
space:
mode:
authorEndi Sukma Dewata <edewata@redhat.com>2012-03-24 02:27:47 -0500
committerEndi Sukma Dewata <edewata@redhat.com>2012-03-26 11:43:54 -0500
commit621d9e5c413e561293d7484b93882d985b3fe15f (patch)
tree638f3d75761c121d9a8fb50b52a12a6686c5ac5c /cmake/Modules/MacroCopyFile.cmake
parent40d3643b8d91886bf210aa27f711731c81a11e49 (diff)
downloadpki-621d9e5c413e561293d7484b93882d985b3fe15f.tar.gz
pki-621d9e5c413e561293d7484b93882d985b3fe15f.tar.xz
pki-621d9e5c413e561293d7484b93882d985b3fe15f.zip
Removed unnecessary pki folder.
Previously the source code was located inside a pki folder. This folder was created during svn migration and is no longer needed. This folder has now been removed and the contents have been moved up one level. Ticket #131
Diffstat (limited to 'cmake/Modules/MacroCopyFile.cmake')
-rw-r--r--cmake/Modules/MacroCopyFile.cmake33
1 files changed, 33 insertions, 0 deletions
diff --git a/cmake/Modules/MacroCopyFile.cmake b/cmake/Modules/MacroCopyFile.cmake
new file mode 100644
index 000000000..cee1cae37
--- /dev/null
+++ b/cmake/Modules/MacroCopyFile.cmake
@@ -0,0 +1,33 @@
+# - macro_copy_file(_src _dst)
+# Copies a file to ${_dst} only if ${_src} is different (newer) than ${_dst}
+#
+# Example:
+# macro_copy_file(${CMAKE_CURRENT_SOURCE_DIR}/icon.png ${CMAKE_CURRENT_BINARY_DIR}/.)
+# Copies file icon.png to ${CMAKE_CURRENT_BINARY_DIR} directory
+#
+# Copyright (c) 2006-2007 Wengo
+# Copyright (c) 2006-2008 Andreas Schneider <mail@cynapses.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING file.
+
+
+macro (macro_copy_file _src _dst)
+ # Removes all path containing .svn or CVS or CMakeLists.txt during the copy
+ if (NOT ${_src} MATCHES ".*\\.svn|CVS|CMakeLists\\.txt.*")
+
+ if (CMAKE_VERBOSE_MAKEFILE)
+ message(STATUS "Copy file from ${_src} to ${_dst}")
+ endif (CMAKE_VERBOSE_MAKEFILE)
+
+ # Creates directory if necessary
+ get_filename_component(_path ${_dst} PATH)
+ file(MAKE_DIRECTORY ${_path})
+
+ execute_process(
+ COMMAND
+ ${CMAKE_COMMAND} -E copy_if_different ${_src} ${_dst}
+ OUTPUT_QUIET
+ )
+ endif (NOT ${_src} MATCHES ".*\\.svn|CVS|CMakeLists\\.txt.*")
+endmacro (macro_copy_file)