Coder Social home page Coder Social logo

cmake-extensions's Introduction

Cmake_Extensions

CxCopy

Copy files from one directory to another directory.
The output directory is created if it doesn't exist. See Source for examples.

  • FILE copy only files
  • FOLDER copy files along with their folder structure
  • INPUT input folder
  • OUTPUT output folder
  • VAR store the list of copied files (destination)
  • RECURSIVE copy files from subdirectory
  • ONLY filter for files that matches the regex
  • EXCEPT filter against files that matches the regex
add_subdirectory(../.. Build/Debug/CxCopy)

include(${CX_SOURCE_DIR}/CxCopy.cmake)

CxCopy(FILE INPUT "${CX_SOURCE_DIR}/Data/CxCopy" OUTPUT "${CXCOPY_BINARY_DIR}/FileCopy" VAR files)
add_custom_target(FileCopy ALL DEPENDS ${files} COMMENT "CxCopy File test")

CxCopy(FILE INPUT "${CX_SOURCE_DIR}/Data/CxCopy" OUTPUT "${CXCOPY_BINARY_DIR}/FileCopyFilterIn" VAR files ONLY ".*(\\.txt)")
add_custom_target(FileCopyFilterIn ALL DEPENDS ${files} COMMENT "CxCopy File (filtered in) test")

CxCopy(FILE INPUT "${CX_SOURCE_DIR}/Data/CxCopy" OUTPUT "${CXCOPY_BINARY_DIR}/FileCopyFilterOut" VAR files EXCEPT ".*(\\.txt)")
add_custom_target(FileCopyFilterOut ALL DEPENDS ${files} COMMENT "CxCopy File (filtered out) test")

CxCopy(FILE RECURSIVE INPUT "${CX_SOURCE_DIR}/Data/CxCopy" OUTPUT "${CXCOPY_BINARY_DIR}/FileCopyR" VAR files)
add_custom_target(FileCopyR ALL DEPENDS ${files} COMMENT "CxCopy File recursively test")

CxCopy(FILE RECURSIVE INPUT "${CX_SOURCE_DIR}/Data/CxCopy" OUTPUT "${CXCOPY_BINARY_DIR}/FileCopyFilterInR" VAR files ONLY ".*(\\.txt)")
add_custom_target(FileCopyFilterInR ALL DEPENDS ${files} COMMENT "CxCopy File recursively (filtered in) test")

CxCopy(FILE RECURSIVE INPUT "${CX_SOURCE_DIR}/Data/CxCopy" OUTPUT "${CXCOPY_BINARY_DIR}/FileCopyFilterOutR" VAR files EXCEPT ".*(\\.txt)")
add_custom_target(FileCopyFilterOutR ALL DEPENDS ${files} COMMENT "CxCopy File (filtered out) test")

CxCopy(FOLDER INPUT "${CX_SOURCE_DIR}/Data/CxCopy" OUTPUT "${CXCOPY_BINARY_DIR}/FolderCopy" VAR files)
add_custom_target(FolderCopy ALL DEPENDS ${files} COMMENT "CxCopy Files and Folders test")

CxCopy(FOLDER INPUT "${CX_SOURCE_DIR}/Data/CxCopy" OUTPUT "${CXCOPY_BINARY_DIR}/FolderCopyFilterIn" VAR files ONLY ".*(\\.txt)")
add_custom_target(FolderCopyFilterIn ALL DEPENDS ${files} COMMENT "CxCopy Files and Folders (filtered in) test")

CxCopy(FOLDER INPUT "${CX_SOURCE_DIR}/Data/CxCopy" OUTPUT "${CXCOPY_BINARY_DIR}/FolderCopyFilterOut" VAR files EXCEPT ".*(\\.txt)")
add_custom_target(FolderCopyFilterOut ALL DEPENDS ${files} COMMENT "CxCopy Files and Folders (filtered out) test")

CxCopy(FOLDER RECURSIVE INPUT "${CX_SOURCE_DIR}/Data/CxCopy" OUTPUT "${CXCOPY_BINARY_DIR}/FolderCopyR" VAR files)
add_custom_target(FolderCopyR ALL DEPENDS ${files} COMMENT "CxCopy Files and Folders recursively test")

CxCopy(FOLDER RECURSIVE INPUT "${CX_SOURCE_DIR}/Data/CxCopy" OUTPUT "${CXCOPY_BINARY_DIR}/FolderCopyFilterInR" VAR files ONLY ".*(\\.txt)")
add_custom_target(FolderCopyFilterInR ALL DEPENDS ${files} COMMENT "CxCopy Files and Folders recursively (filtered in) test")

CxCopy(FOLDER RECURSIVE INPUT "${CX_SOURCE_DIR}/Data/CxCopy" OUTPUT "${CXCOPY_BINARY_DIR}/FolderCopyFilterOutR" VAR files EXCEPT ".*(\\.txt)")
add_custom_target(FolderCopyFilterOutR ALL DEPENDS ${files} COMMENT "CxCopy Files and Folders recursively (filtered out) test")

License

This project is licensed under the mit license - see the LICENSE file for details. © All rights reserved.

Version

The current version of this project can be seen on the VERSION file.

Authors

See AUTHORS for full list.

Contributing

See CONTRIBUTING.md for how to contribute.



cmake-extensions's People

Contributors

rickodesea avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.