DOLFIN_PYTHON_INCLUDE_DIRS format on windows

Asked by Chaffra Affouda

When building on windows under MinGW/MSYS the DOLFIN_PYTHON_INCLUDE_DIRS variable has backslashes which breaks cmake. This is because I am using the windows version of Python which returns backslashes for the path to numpy. Any ideas how to fix this?

Chaffra

CMake Error at E:/src/fenics-source-snapshot-win/build/CMakeExternals/src/DOLFIN
-build/dolfin/dolfin-config.cmake:29 (set):
  Syntax error in cmake code at

    E:/src/fenics-source-snapshot-win/build/CMakeExternals/src/DOLFIN-build/dolf
in/dolfin-config.cmake:29

  when parsing string

    E:/Fenics/Semifem/lib/Python27/include;E:\Fenics\Semifem\lib\site-packages\n
umpy\core\include

  Invalid escape sequence \F
Call Stack (most recent call first):
  demo/CMakeLists.txt:11 (find_package)

Question information

Language:
English Edit question
Status:
Solved
For:
DOLFIN Edit question
Assignee:
No assignee Edit question
Solved by:
Johannes Ring
Solved:
Last query:
Last reply:
Revision history for this message
Best Johannes Ring (johannr) said :
#1

You can try to replace the backslashes with forward slashes:

STRING(REGEX REPLACE "\\\\" "/" DOLFIN_PYTHON_INCLUDE_DIRS ${DOLFIN_PYTHON_INCLUDE_DIRS})

Revision history for this message
Chaffra Affouda (chaffra) said :
#2

Thanks Johannes Ring, that solved my question.