Skip to content

Latest commit

 

History

History
115 lines (48 loc) · 2.7 KB

README.md

File metadata and controls

115 lines (48 loc) · 2.7 KB

Creating Checksums

CMake provides you with two hashing functions: string(<hash-algorithm>) and file(<hash-algorithm>). These work just fine but I reformed them to work well with cmakepp and extended the functionality:

Function Details

checksum_dir

(<direcotry> [--algorthm <checksum algorithm> = "MD5"])-><checksum>

calculates the checksum for the specified directory just like checksum_layout however also factors in the file's contents

checksum_file

(<file> [--algorithm <checksum algorithm> = "MD5"])-><checksum>

calculates the checksum for the specified file delegates the call to CMake's file() function

checksum_files

(<base dir> <file...>)-><checksum>

create a checksum from specified files relative to

the checksum is influenced by the files relative paths and the file content

checksum_glob_ignore

(<glob ignore expressions...> [--algorithm <hash algorithm> = "MD5"])-><checksum>

calculates the checksum for the specified glob ignore expressIONS uses checksum_files internally. the checksum is unique to file content and relative file structure

checksum_layout

(<directory> [--algorithm <hash algorithm> "MD5"])-><checksum>

this method generates the checksum for the specified directory it is done by taking every file's relative path into consideration and generating the hash. The file's content does not influence the hash

checksum_object

(<any> [--algorithm <hash algorithm> = "MD5"])-><checksum>

this function takes any value and generates its hash the difference to string hash is that it serializes the specified object which lets you create the hash for the whoile object graph.

checksum_string

(<string> [--algorithm <hash algorithm> = MD5])-><checksum> <hash algorithm> ::= "MD5"|"SHA1"|"SHA224"|"SHA256"|"SHA384"|"SHA512"

this function takes any string and computes the hash value of it using the hash algorithm specified (which defaults to MD5) returns the checksum

content_dir_check

content_dir_update