MantisBT - CMake
View Issue Details
0011715CMakeModulespublic2011-01-17 12:172011-05-02 14:46
Marcel Loose 
Marcus D. Hanwell 
normalminoralways
closedfixed 
CMake 2.8.3 
CMake 2.8.4CMake 2.8.4 
0011715: FindPythonLibs: python_write_modules_header() write in source tree and fails silently
The function python_write_modules_header() generates a file in the source tree, because the filename supplied to FILE(WRITE ...) is not absolute. Then the "copy_if_different" command further down fails silently (I guess because it cannot find the input file).
$ cat << EOF > CMakeLists.txt
cmake_minimum_required(VERSION 2.6)
project(MyPython)
find_package(PythonLibs)
python_add_module(pyfoo pyfoo.cc)
python_write_modules_header(mypython.h)
EOF

$ touch pyfoo.cc
$ mkdir build
$ cd build
$ cmake ..
$ ls ..
build CMakeLists.txt mypython.h.in pyfoo.cc
No tags attached.
patch FindPythonLibs.cmake.patch (565) 2011-01-17 12:19
https://public.kitware.com/Bug/file/3638/FindPythonLibs.cmake.patch
Issue History
2011-01-17 12:17Marcel LooseNew Issue
2011-01-17 12:19Marcel LooseFile Added: FindPythonLibs.cmake.patch
2011-01-17 12:19Marcel LooseNote Added: 0024770
2011-01-17 13:38Brad KingAssigned To => Marcus D. Hanwell
2011-01-17 13:38Brad KingStatusnew => assigned
2011-01-17 15:33Marcus D. HanwellNote Added: 0024802
2011-01-18 14:19David ColeCategory(No Category) => Modules
2011-01-20 08:15David ColeTarget Version => CMake 2.8.4
2011-01-20 08:15David ColeStatusassigned => resolved
2011-01-20 08:15David ColeFixed in Version => CMake 2.8.4
2011-01-20 08:15David ColeResolutionopen => fixed
2011-05-02 14:46David ColeNote Added: 0026370
2011-05-02 14:46David ColeStatusresolved => closed

Notes
(0024770)
Marcel Loose   
2011-01-17 12:19   
I've uploaded a patch that fixes this issue.
(0024802)
Marcus D. Hanwell   
2011-01-17 15:33   
Looks good to me, I have staged and merged the patch to next,

23635ff Bug 0011715 - generate header in the build tree.

I will see if this can be merged in for the 2.8.4 release.
(0026370)
David Cole   
2011-05-02 14:46   
Closing resolved issues that have not been updated in more than 3 months.