I'm building Python modules using SWIG and CMake, and have run into a
problem running Python unit tests for these built modules. I can not
find a slick way to set the Python module search path when running the
test. The usual trick of setting sys.path in the scripts will not work
here because I don't know the location of the build directory. I've
tried updating PYTHONPATH in my CMakeList.txt file but that change isn't
picked up when the test is executed. I could create the unit test
modules at build time using CONFIGURE_FILE replacing
@CMAKE_CURRENT_BINARY_DIR@ in a sys.path line, but that seems
heavy-handed. Has anyone else run into this problem and found better a
solution?
--
Lori A. Pritchett-Sheats, PhD.
CCS-2, Computational Physics and Methods
Office: 505-665-6675
Fax: 505-665-4972
Los Alamos National Laboratory
P.O. Box 1663
MS D413
Los Alamos, NM 87544
--
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