Skip to content

Commit

Permalink
Merge pull request #6891 from ev-mp/win_cmake_fix
Browse files Browse the repository at this point in the history
Adjust windows cmake build to v3.6+
  • Loading branch information
ev-mp authored Jul 22, 2020
2 parents 2b28b79 + 55adad0 commit 305fd80
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
11 changes: 10 additions & 1 deletion CMake/windows_config.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
message(STATUS "Setting Windows configurations")

cmake_minimum_required(VERSION 3.6.0) #Required by list(FILTER ...
config_crt()

macro(os_set_flags)
Expand Down Expand Up @@ -89,3 +89,12 @@ macro(os_target_config)
source_group("Source Files\\${_file_path_msvc}" FILES "${_relative_file}")
endforeach()
endmacro()

#modify variable with prefix. Mimics list(TRANSFORM ... PREPEND introduced with cmake 3.12
FUNCTION(PREPEND var prefix)
SET(listVar "")
FOREACH(f ${ARGN})
LIST(APPEND listVar "${prefix}/${f}")
ENDFOREACH(f)
SET(${var} "${listVar}" PARENT_SCOPE)
ENDFUNCTION(PREPEND)
4 changes: 3 additions & 1 deletion tools/depth-quality/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ if(BUILD_GRAPHICAL_EXAMPLES)
../../third-party/tinyfiledialogs
${CMAKE_CURRENT_SOURCE_DIR}/res/)

list(TRANSFORM DELAYED PREPEND " /DELAYLOAD:")
#list(TRANSFORM DELAYED PREPEND " /DELAYLOAD:")
PREPEND(DELAYED " /DELAYLOAD:" ${DELAYED})
#infoValue(DELAYED)
string(REPLACE ";" " " LD_FLAGS_STR "${DELAYED}")
set_target_properties(rs-depth-quality PROPERTIES LINK_FLAGS "${LD_FLAGS_STR}")

Expand Down
3 changes: 2 additions & 1 deletion tools/realsense-viewer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ if(WIN32)

source_group("OpenVINO" FILES ${OPENVINO_FILES})

list(TRANSFORM DELAYED PREPEND " /DELAYLOAD:")
#list(TRANSFORM DELAYED PREPEND " /DELAYLOAD:") - Requires cmake v3.12
PREPEND(DELAYED " /DELAYLOAD:" ${DELAYED})
string(REPLACE ";" " " LD_FLAGS_STR "${DELAYED}")
set_target_properties(realsense-viewer PROPERTIES LINK_FLAGS "${LD_FLAGS_STR}")

Expand Down

0 comments on commit 305fd80

Please sign in to comment.