I want to embed Python into one of my applications, which is built using CMake. I do in CMakeLists.txt like this:
find_package(PythonLibs REQUIRED) include_directories(${PYTHON_INCLUDE_DIRS}) ... target_link_libraries(${PROJECT_NAME} ${PYTHON_LIBRARIES}) Under Linux there are no problems, everything is going right away. Put Python (the latest actual version at the moment - 3.6) on Windows. When installing, I chose "Set for all users" and "Add Python to PATH variable". After installation, the Python interpreter works fine. However, CMake cannot find Python:
CMake Error at C:/Program Files/CMake/share/cmake-3.7/Modules/FindPackageHandleStandardArgs.cmake:138 (message): Could NOT find PythonLibs (missing: PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS) Call Stack (most recent call first): C:/Program Files/CMake/share/cmake-3.7/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE) C:/Program Files/CMake/share/cmake-3.7/Modules/FindPythonLibs.cmake:255 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) CMakeLists.txt:3 (find_package) What could be the problem? And how to make the project build on both OSes without any problems?