Commit fe42933a authored by huihut's avatar huihut Committed by Alexander Alekhin

Merge pull request #15433 from huihut:master

* fix 'chmod' is not recognized as an internal or external command in Windows

https://github.com/opencv/opencv/issues/14939

* cmake: update PCH command handling
parent ba703157
......@@ -305,10 +305,13 @@ fi
${_command} '-D$<JOIN:$<TARGET_PROPERTY:${_targetName},COMPILE_DEFINITIONS>,' '-D>'
")
GET_FILENAME_COMPONENT(_outdir ${_output} PATH)
if(NOT CMAKE_HOST_WIN32) # chmod may be not available on Win32/MinGW (and it is not required)
set(_pch_prepare_command COMMAND chmod +x "${_pch_generate_file_cmd}")
endif()
ADD_CUSTOM_COMMAND(
OUTPUT "${_output}"
COMMAND ${CMAKE_COMMAND} -E make_directory "${_outdir}"
COMMAND chmod +x "${_pch_generate_file_cmd}"
${_pch_prepare_command}
COMMAND "${_pch_generate_file_cmd}"
DEPENDS "${_input}" "${_pch_generate_file_cmd}"
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/${_name}"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment