| | |
| | | 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") |
| | |
| | | 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} |
| | |
| | | ${_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}" |