Fixed RelWithDebInfo build (#16159)
This commit is contained in:
@@ -27,22 +27,23 @@ ie_shellcheck_process(DIRECTORY "${OpenVINO_SOURCE_DIR}"
|
||||
ie_cpack_add_component(${OV_CPACK_COMP_SETUPVARS} HIDDEN)
|
||||
|
||||
if(UNIX)
|
||||
set(_setupvars_file "${CMAKE_CURRENT_SOURCE_DIR}/setupvars/setupvars.sh")
|
||||
set(_setupvars_file_full_path "${CMAKE_CURRENT_SOURCE_DIR}/setupvars/setupvars.sh")
|
||||
elseif(WIN32)
|
||||
set(_setupvars_file "${CMAKE_CURRENT_SOURCE_DIR}/setupvars/setupvars.bat")
|
||||
set(_setupvars_file "setupvars/setupvars.bat")
|
||||
set(_setupvars_file_full_path "${CMAKE_CURRENT_SOURCE_DIR}/${_setupvars_file}")
|
||||
if(USE_BUILD_TYPE_SUBFOLDER AND CMAKE_BUILD_TYPE AND NOT CMAKE_BUILD_TYPE MATCHES "^(Debug|Release)$")
|
||||
# Patch primary configuration in setupvars.bat which is "Release" by default.
|
||||
# Note setupvars secondary configuration is always "Debug".
|
||||
message(STATUS "Patching content of ${_setupvars_file} for CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}")
|
||||
file(READ "${_setupvars_file}" _setupvars_content)
|
||||
message(STATUS "Patching content of ${_setupvars_file_full_path} for CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}")
|
||||
file(READ "${_setupvars_file_full_path}" _setupvars_content)
|
||||
string(REPLACE "Release" ${CMAKE_BUILD_TYPE} _setupvars_content "${_setupvars_content}")
|
||||
set(_setupvars_file "${OpenVINO_BINARY_DIR}/${_setupvars_file}")
|
||||
message(STATUS "Writing patched content to ${_setupvars_file}")
|
||||
file(WRITE "${_setupvars_file}" "${_setupvars_content}")
|
||||
set(_setupvars_file_full_path "${OpenVINO_BINARY_DIR}/${_setupvars_file}")
|
||||
message(STATUS "Writing patched content to ${_setupvars_file_full_path}")
|
||||
file(WRITE "${_setupvars_file_full_path}" "${_setupvars_content}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
install(PROGRAMS "${_setupvars_file}"
|
||||
install(PROGRAMS "${_setupvars_file_full_path}"
|
||||
DESTINATION .
|
||||
COMPONENT ${OV_CPACK_COMP_SETUPVARS})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user