Skip to content

sivachandran/cmake-bin2h

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

bin2h.cmake

Pure CMake function to convert any file into C/C++ header, implemented with only CMake commands.

Example Usage

include(bin2h.cmake)
...
message("Embedding following files into header file ${HEADER_FILE}")
foreach(file ${SOURCE_FILES})
    message("   ${file}")

    get_filename_component(variableName ${file} NAME)

    bin2h(SOURCE_FILE ${file} HEADER_FILE ${HEADER_FILE} VARIABLE_NAME ${variableName} APPEND NULL_TERMINATE)
    file(APPEND ${HEADER_FILE} "\n")
endforeach()

About

Pure CMake function to convert any file into C/C++ header, implemented with only CMake commands.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages