Skip to content
Permalink
Browse files

[test] Avoid "NOTFOUND" in LD_LIBRARY_PATH environment variable

  • Loading branch information
rkanavath authored and nyalldawson committed Feb 22, 2019
1 parent 471865a commit 8e78d2015d8c40c57f7f59c308a963517dc2d722
Showing with 7 additions and 2 deletions.
  1. +7 −2 cmake/UsePythonTest.cmake
@@ -26,7 +26,12 @@ MARK_AS_ADVANCED(PYTHON_EXECUTABLE)
MACRO(ADD_PYTHON_TEST TESTNAME FILENAME)
GET_SOURCE_FILE_PROPERTY(loc ${FILENAME} LOCATION)
GET_SOURCE_FILE_PROPERTY(pyenv ${FILENAME} PYTHONPATH)

#Avoid "NOTFOUND" string when setting LD_LIBRARY_PATH later
if(EXISTS "${pyenv}")
set(pyenv "${pyenv}:")
else()
set(pyenv "")
endif()
IF(WIN32)
STRING(REGEX REPLACE ":" " " wo_semicolon "${ARGN}")
IF(USING_NINJA OR USING_NMAKE)
@@ -48,7 +53,7 @@ MESSAGE(\"PATH:\$ENV{PATH}\")
STRING(REGEX REPLACE ";" " " wo_semicolon "${ARGN}")
FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${TESTNAME}.cmake "
SET(ENV{QGIS_PREFIX_PATH} \"${QGIS_OUTPUT_DIRECTORY}\")
SET(ENV{LD_LIBRARY_PATH} \"${pyenv}:${QGIS_OUTPUT_DIRECTORY}/lib:\$ENV{LD_LIBRARY_PATH}\")
SET(ENV{LD_LIBRARY_PATH} \"${pyenv}${QGIS_OUTPUT_DIRECTORY}/lib:\$ENV{LD_LIBRARY_PATH}\")
SET(ENV{PYTHONPATH} \"${QGIS_OUTPUT_DIRECTORY}/python/:${QGIS_OUTPUT_DIRECTORY}/python/plugins:${CMAKE_SOURCE_DIR}/tests/src/python:\$ENV{PYTHONPATH}\")
MESSAGE(\"export LD_LIBRARY_PATH=\$ENV{LD_LIBRARY_PATH}\")
")

0 comments on commit 8e78d20

Please sign in to comment.
You can’t perform that action at this time.