[CMake] Python project using Cmake

Matthew Keeler mkeeler at tenable.com
Wed Oct 21 12:22:03 EDT 2015


What are you trying to do? Are you trying to build Python C extensions? If so then the FindPythonLibs module will help you in that regard. It will determine if the Python development files are installed and populate variables with the necessary paths to provide to link_directories and include_directories. https://cmake.org/cmake/help/v3.3/module/FindPythonLibs.html

Additionally there is the FindPythonInterp module which will find the Python interpreter for invoking via custom commands or execute_process.
https://cmake.org/cmake/help/v3.3/module/FindPythonInterp.html

Also if you aren’t actually compiling any C/C++ code it will speed up build system generation if you specify the languages as NONE during the project command invocation. That behavior is documented at: https://cmake.org/cmake/help/v3.3/command/project.html

In the past I have used cmake even for pure Python projects to just get the benefits of generic packaging with cpack and to be able to use ctest. If this is the case for you then you may end up defining a bunch of functions/macros to do all the work as I did.

--
Matt Keeler


On October 21, 2015 at 11:28:28, srinivas boppu (srinivas.boppu at gmail.com<mailto:srinivas.boppu at gmail.com>) wrote:

Hello All,

I am new to cmake and its build and ctest system. I read some where that cmake default look for c++ compiler and we need to modify/configure the cmake to recongize the python files.
I googled for the same but I couldn't find any concrete and complete example.
Any pointers in this regard would be useful.

Thanks in advance.

--
Apologizing doesn't mean U r wrong & the other is right,It means that U value the relationship more than Ur ego...

--

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20151021/694f1c24/attachment.html>


More information about the CMake mailing list