Skip to content

Commit

Permalink
Suppress warnings and issues with local windows build using system py…
Browse files Browse the repository at this point in the history
…thon
  • Loading branch information
mattdawkins committed Jul 26, 2023
1 parent 702da14 commit 9afd72b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
14 changes: 12 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,8 @@ if( WIN32 AND VIAME_BUILD_DEPENDENCIES AND VIAME_ENABLE_KWIVER AND VIAME_BUILD_C
must be set to a short path (e.g. C:\\tmp\\kv1 and C:\\tmp\\vm1) on \
Windows due to a current issue with nesting KWIVER exceeding the 260 \
character default filepath size. Alternatively disable VIAME_BUILD_CHECKS \
to ignore this message." )
to ignore this message if you either increased the windows default path \
length, or think your build path is short enough." )
endif()
endif()

Expand Down Expand Up @@ -568,10 +569,19 @@ if( VIAME_ENABLE_PYTHON )

if( WIN32 )
string( REPLACE "/" "\\" VIAME_PYTHON_USERBASE "${VIAME_PYTHON_USERBASE}" )

# Add PYTHON_PATH variables internal to the VIAME build tree, e.g. things installed
# just for VIAME not in an external Python environment or install
set( VIAME_PYTHON_PATH
${PYBASE};${PYBASE}/site-packages;${PYBASE}/dist-packages
CACHE INTERNAL "Pythonpath for all files installed as a part of VIAME" )
if( NOT VIAME_ENABLE_PYTHON-INTERNAL )
# If using system python on windows, add all possible path locations for
# python packages in the system install just so they can be used in addition
# to the ones within the VIAME install tree
set( VIAME_PYTHON_PATH
${VIAME_PYTHON_PATH};${PYTHON_STDLIB};${PYTHON_SITELIB};${PYTHON_RUNTIME_LIBRARY_DIRS}/DLLs
CACHE INTERNAL "Pythonpath for all files installed as a part of VIAME" )
endif()
else()
set( VIAME_PYTHON_PATH
${PYBASE}:${PYBASE}/site-packages:${PYBASE}/dist-packages
Expand Down
7 changes: 6 additions & 1 deletion cmake/common_macros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@ function( FormatPassdownsCond _str _varResult _bothCases _ignoreStr )
if( _type_set_in_cache )
get_property( _var_type CACHE ${_var_name} PROPERTY TYPE )
endif()
set( _tmpResult ${_tmpResult} "-D${_match}:${_var_type}=${${_match}}" )
if( WIN32 )
string( REPLACE "\\" "/" _adjPath "${${_match}}" )
set( _tmpResult ${_tmpResult} "-D${_match}:${_var_type}=${_adjPath}" )
else()
set( _tmpResult ${_tmpResult} "-D${_match}:${_var_type}=${${_match}}" )
endif()
endforeach()
set( ${_varResult} ${_tmpResult} PARENT_SCOPE )
endfunction()
Expand Down

0 comments on commit 9afd72b

Please sign in to comment.