0

I have a python project with a CMakeLists.txt and a custom made python module (a *.py file), that is not in the same directory, as the file, containing main. Right I use the ugly sys.path.append("../../path/to/module.py").

How can I tell python, where to search for modules to import? Maybe include_directories from cmake will help?

Asalle
  • 1,239
  • 19
  • 41
  • 1
    CMake doesn't help with searching imported modules. CMake even doesn't preprocess python scripts - the scripts are not compiled at all. Your problem is related **only with python**, and described in that question: https://stackoverflow.com/questions/4383571/importing-files-from-different-folder. – Tsyvarev Aug 14 '17 at 13:50
  • Why don't you add an answer? Or, should I delete the question? – Asalle Aug 16 '17 at 11:20

0 Answers0