Commit 12c24766 authored by Manuel Günther's avatar Manuel Günther
Browse files

Correctly implemented BOB_PREFIX_PATH environment variable

parent 9b96c99e
......@@ -23,6 +23,6 @@ install:
- python bootstrap-buildout.py
- CPPFLAGS=--coverage LDFLAGS=--coverage ./bin/buildout buildout:debug=false
script:
- BOB_PREFIX_PATH="/home/travis/virtualenv/python*/" ./bin/coverage run --source=bob.example.cmake ./bin/nosetests -sv
- BOB_PREFIX_PATH=/home/travis/virtualenv/* ./bin/coverage run --source=bob.example.cmake ./bin/nosetests -sv
after_success:
- cpp-coveralls --build-root=`pwd` --exclude=src
......@@ -43,9 +43,6 @@ macro(_find_python)
if (BOB_PREFIX_PATH)
list(APPEND _possible_paths ${BOB_PREFIX_PATH}/bin)
endif()
if (ENV{BOB_PREFIX_PATH})
list(APPEND _possible_paths $ENV{BOB_PREFIX_PATH}/bin)
endif()
find_program(_python python HINTS ${_possible_paths})
endif()
endmacro()
......@@ -107,9 +104,6 @@ function(find_bob_package package)
if (BOB_PREFIX_PATH)
list(APPEND _possible_paths ${BOB_PREFIX_PATH}/lib/*/site-packages)
endif()
if (ENV{BOB_PREFIX_PATH})
list(APPEND _possible_paths $ENV{BOB_PREFIX_PATH}/lib/*/site-packages)
endif()
# add common path to locations
set(_bob_paths)
......@@ -206,6 +200,18 @@ if (NOT Bob_FIND_COMPONENTS)
message(FATAL_ERROR "Please specify the bob packages that you want to search for as COMPONENTS")
endif()
# set BOB_PREFIX_PATH as CMake variable when given in as environment variable
if (NOT "$ENV{BOB_PREFIX_PATH}" STREQUAL "")
if (BOB_PREFIX_PATH)
if (NOT "${BOB_PREFIX_PATH}" STREQUAL "$ENV{BOB_PREFIX_PATH}")
message(WARNING "Ignoring the BOB_PREFIX_PATH environment variable '$ENV{BOB_PREFIX_PATH}' and using '${BOB_PREFIX_PATH}' instead")
endif()
else()
set(BOB_PREFIX_PATH $ENV{BOB_PREFIX_PATH} CACHE STRING "Bob installation path" FORCE)
endif()
endif()
# TODO: Review this setting. It might overwrite some default settings.
set(CMAKE_CXX_FLAGS "-std=c++0x -pthread" CACHE STRING "Flags used by the compiler during release builds" FORCE)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment