emscripten Humble Cloud interface
Edward Rudd
2014-08-21 2ea920b42dc33e39b8307a94888c4e60a83406b8

add some mystical voodoo to CreateProgram to allow me to setup simple file copies to build dir

1 files modified
41 ■■■■■ changed files
cmake/UtilityFunctions.cmake 41 ●●●●● patch | view | raw | blame | history
cmake/UtilityFunctions.cmake
@@ -62,6 +62,32 @@
    unset(__setdefaultscope_temp)
endmacro()
function(MakeCopyFileDepenency outvar file)
    if(IS_ABSOLUTE ${file})
        set(_input ${file})
    else()
        set(_input ${CMAKE_CURRENT_SOURCE_DIR}/${file})
    endif()
    if(ARGC GREATER "2")
        if(IS_ABSOLUTE ${ARGV2})
            set(_output ${ARGV2})
        else()
            set(_output ${CMAKE_CURRENT_BINARY_DIR}/${ARGV2})
        endif()
    else()
        get_filename_component(_outfile ${file} NAME)
        set(_output ${CMAKE_CURRENT_BINARY_DIR}/${_outfile})
    endif()
    add_custom_command(
        OUTPUT ${_output}
        COMMAND ${CMAKE_COMMAND} -E copy ${_input} ${_output}
        DEPENDS ${_input}
        COMMENT "Copying ${file}"
    )
    set(${outvar} ${_output} PARENT_SCOPE)
endfunction()
# magic function to handle the power functions below
function(_BuildDynamicTarget name type)
    set(_mode "files")
@@ -82,12 +108,17 @@
            set(_mode "link")
        elseif(dir STREQUAL "PROPERTIES")
            set(_mode "properties")
        # Simple Copying files to build dir
        elseif(dir STREQUAL "COPY_FILES")
            set(_mode "copyfiles")
        # Emscripten handling
        elseif(dir STREQUAL "ASM_FLAG")
            set(_mode "em_asmflag")
        elseif(dir STREQUAL "PRE_JS")
            set(_mode "em_prejs")
        elseif(dir STREQUAL "JS_LIBS")
            set(_mode "em_jslib")
        # The real work
        else()
            if(_mode STREQUAL "excl")
                file(GLOB _files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
@@ -137,6 +168,16 @@
                        ${_files}
                    )
                endif()
            # simple copy files
            elseif(_mode STREQUAL "copyfiles")
                MakeCopyFileDepenency(_copyfile_target
                    ${dir}
                )
                list(APPEND _source_files
                    ${_copyfile_target}
                )
                unset(_copyfile_target)
            # emscripten handling
            elseif(_mode STREQUAL "em_asmflag")
                list(APPEND _em_asmflag
                    "-s ${dir}"