[cmake] prevent usage of some shell commands if not present
@@ -183,12 +183,12 @@ macro(add_siconos_swig_sub_module fullname)
# Add a post-build step that prepends utf-8 coding indicator to .py files
find_program(SH_COMMAND sh)
- find_program(TAR_COMMAND tar)
+ find_program(CAT_COMMAND cat)
find_program(MV_COMMAND mv)
- if(SH_COMMAND AND TAR_COMMAND)
+ if(SH_COMMAND AND CAT_COMMAND)
if(MV_COMMAND)
add_custom_command(TARGET ${SWIG_MODULE_${_name}_REAL_NAME}
- POST_BUILD COMMAND sh -c "(echo '# -*- coding: utf-8 -*-'; cat ${SICONOS_SWIG_ROOT_DIR}/${_path}/${_name}.py) > ${SICONOS_SWIG_ROOT_DIR}/${_path}/${_name}.tmp; mv ${SICONOS_SWIG_ROOT_DIR}/${_path}/${_name}.tmp ${SICONOS_SWIG_ROOT_DIR}/${_path}/${_name}.py" VERBATIM)
+ POST_BUILD COMMAND ${SH_COMMAND} -c "(echo '# -*- coding: utf-8 -*-'; ${CAT_COMMAND} ${SICONOS_SWIG_ROOT_DIR}/${_path}/${_name}.py) > ${SICONOS_SWIG_ROOT_DIR}/${_path}/${_name}.tmp; ${MV_COMMAND} ${SICONOS_SWIG_ROOT_DIR}/${_path}/${_name}.tmp ${SICONOS_SWIG_ROOT_DIR}/${_path}/${_name}.py" VERBATIM)
endif()
endif()
# Check dependencies and then link ...
