summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Blum2011-08-20 09:07:57 -0700
committerJosh Blum2011-09-11 23:39:09 -0700
commit5f7e76b4fd89fbaf4c0cf72ff53c7c91381ccfad (patch)
tree9d781b83487db38e24a83f3bdda66ac52b4e8d10
parent6fb1b3341a44a5ac3b0b516709820ca9cc418c26 (diff)
downloadgnuradio-5f7e76b4fd89fbaf4c0cf72ff53c7c91381ccfad.tar.gz
gnuradio-5f7e76b4fd89fbaf4c0cf72ff53c7c91381ccfad.tar.bz2
gnuradio-5f7e76b4fd89fbaf4c0cf72ff53c7c91381ccfad.zip
cmake: set the library path for unix machines
-rw-r--r--cmake/Modules/GrTest.cmake12
1 files changed, 8 insertions, 4 deletions
diff --git a/cmake/Modules/GrTest.cmake b/cmake/Modules/GrTest.cmake
index e9e2a0c2e..8a73de3ce 100644
--- a/cmake/Modules/GrTest.cmake
+++ b/cmake/Modules/GrTest.cmake
@@ -33,7 +33,6 @@ SET(__INCLUDED_GR_TEST_CMAKE TRUE)
########################################################################
FUNCTION(GR_ADD_TEST test_name)
- IF(WIN32)
#Ensure that the build exe also appears in the PATH.
LIST(APPEND GR_TEST_TARGET_DEPS ${ARGN})
@@ -50,6 +49,7 @@ FUNCTION(GR_ADD_TEST test_name)
ENDIF(location)
ENDFOREACH(target)
+ IF(WIN32)
#SWIG generates the python library files into a subdirectory.
#Therefore, we must append this subdirectory into PYTHONPATH.
#Only do this for the python directories matching the following:
@@ -74,15 +74,19 @@ FUNCTION(GR_ADD_TEST test_name)
#SET_TESTS_PROPERTIES(${test_name} PROPERTIES ENVIRONMENT "${environs}")
IF(UNIX)
+ SET(LD_PATH_VAR "LD_LIBRARY_PATH")
+ IF(APPLE)
+ SET(LD_PATH_VAR "DYLD_LIBRARY_PATH")
+ ENDIF()
+
SET(binpath "${CMAKE_CURRENT_BINARY_DIR}:$PATH")
- #set both LD and DYLD paths to cover multiple UNIX OS library paths
- LIST(APPEND libpath "$LD_LIBRARY_PATH" "$DYLD_LIBRARY_PATH")
+ LIST(APPEND libpath "$${LD_PATH_VAR}")
LIST(APPEND pypath "$PYTHONPATH")
#replace list separator with the path separator
STRING(REPLACE ";" ":" libpath "${libpath}")
STRING(REPLACE ";" ":" pypath "${pypath}")
- LIST(APPEND environs "PATH=${binpath}" "LD_LIBRARY_PATH=${libpath}" "DYLD_LIBRARY_PATH=${libpath}" "PYTHONPATH=${pypath}")
+ LIST(APPEND environs "PATH=${binpath}" "${LD_PATH_VAR}=${libpath}" "PYTHONPATH=${pypath}")
#generate a bat file that sets the environment and runs the test
FIND_PROGRAM(SHELL sh)