Hi,

I'm having some trouble setting PYTHONPATH in order to test a python
extension module built with cmake.
Currently I do the following:

add_test(NAME py_test COMMAND ${PYTHON_EXECUTABLE}
    ${CMAKE_CURRENT_SOURCE_DIR}/test_runner.py)

if (CMAKE_CONFIGURATION_TYPES)
  set (PY_DIR ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR})
else ()
  set (PY_DIR ${CMAKE_BINARY_DIR}/bin)
endif ()

set_tests_properties(py_test
    PROPERTIES ENVIRONMENT "PYTHONPATH=${PY_DIR}")

The problem is that ${CMAKE_CFG_INTDIR} doesn't get parsed fully, so
PY_DIR expands to ../vs10x64/bin/$(Configuration), which obviously
doesn't work.
Searching this mailing list, I can see that other people have had
trouble with this, but I'm unsure what to do in my case.

Should I use $<CONFIGURATION> and pass arguments to add_test or ... ?

kind regards
Anders
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to