diff options
author | Feng Xiao <xfxyjwf@gmail.com> | 2017-03-10 16:32:19 -0800 |
---|---|---|
committer | Feng Xiao <xfxyjwf@gmail.com> | 2017-03-10 16:32:19 -0800 |
commit | c94555f955e9f250dd95313e2bd10159813d84b0 (patch) | |
tree | bec1e00973eb21bc35c95c5c74210d57879929a2 /cmake/install.cmake | |
parent | e11cd3ee6edd102333a16fcca49de5de3c0bc0e2 (diff) | |
download | protobuf-c94555f955e9f250dd95313e2bd10159813d84b0.tar.gz protobuf-c94555f955e9f250dd95313e2bd10159813d84b0.tar.bz2 protobuf-c94555f955e9f250dd95313e2bd10159813d84b0.zip |
Double-quote file paths in extract_includes.bat.in
This allows the file path to contain spaces which is very common on
windows.
Diffstat (limited to 'cmake/install.cmake')
-rw-r--r-- | cmake/install.cmake | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/cmake/install.cmake b/cmake/install.cmake index 73e31984..28dc90dc 100644 --- a/cmake/install.cmake +++ b/cmake/install.cmake @@ -20,18 +20,12 @@ install(TARGETS protoc EXPORT protobuf-targets file(STRINGS extract_includes.bat.in _extract_strings REGEX "^copy") foreach(_extract_string ${_extract_strings}) - string(REPLACE "copy \${PROTOBUF_SOURCE_WIN32_PATH}\\" "" - _extract_string ${_extract_string}) - string(REPLACE "\\" "/" _extract_string ${_extract_string}) - string(REGEX MATCH "^[^ ]+" - _extract_from ${_extract_string}) - string(REGEX REPLACE "^${_extract_from} ([^$]+)" "\\1" - _extract_to ${_extract_string}) - get_filename_component(_extract_from "${protobuf_SOURCE_DIR}/${_extract_from}" ABSOLUTE) - get_filename_component(_extract_name ${_extract_to} NAME) - get_filename_component(_extract_to ${_extract_to} PATH) - string(REPLACE "include/" "${CMAKE_INSTALL_INCLUDEDIR}/" - _extract_to "${_extract_to}") + string(REGEX REPLACE "^.* .+ include\\\\(.+)$" "\\1" + _header ${_extract_string}) + string(REPLACE "\\" "/" _header ${_header}) + get_filename_component(_extract_from "${protobuf_SOURCE_DIR}/../src/${_header}" ABSOLUTE) + get_filename_component(_extract_name ${_header} NAME) + get_filename_component(_extract_to "${CMAKE_INSTALL_INCLUDEDIR}/${_header}" PATH) if(EXISTS "${_extract_from}") install(FILES "${_extract_from}" DESTINATION "${_extract_to}" |