MantisBT - CMake
View Issue Details
0014081CMakeModulespublic2013-04-14 13:232013-04-15 08:25
Damien Cassou 
Eric NOULARD 
normalblockalways
closedwon't fix 
MacBook ProUbuntu LinuxRaring
CMake 2.8.10.2 
 
0014081: Commit 7195aca54f breaks my project
Hi,

I've run git-bisect on the cmake source-code and it seems that commit 7195aca54f makes my project not compile anymore:

$ cmake .
CMake Error: Could not open file for write in copy operation /CMakeSystem.cmake.tmp
CMake Error: : System Error: Permission denied
CMake Error at /home/cassou/cmake/Modules/CMakeDetermineSystem.cmake:172 (configure_file):
  configure_file Problem configuring file
Call Stack (most recent call first):
  CMakeLists.txt:3 (include)

I'm quite sure the problem comes from my project, but I have no idea what is wrong.
wget https://launchpad.net/~cassou/+archive/pharo/+files/pharo-vm_2013.03.22.orig.tar.gz [^]
tar xfz pharo-vm_2013.03.22.orig.tar.gz
cd pharo-vm-2013.03.22/build
cmake .
No tags attached.
Issue History
2013-04-14 13:23Damien CassouNew Issue
2013-04-14 13:59Eric NOULARDNote Added: 0032824
2013-04-15 06:41Damien CassouNote Added: 0032827
2013-04-15 08:25Eric NOULARDNote Added: 0032829
2013-04-15 08:25Eric NOULARDStatusnew => closed
2013-04-15 08:25Eric NOULARDAssigned To => Eric NOULARD
2013-04-15 08:25Eric NOULARDResolutionopen => won't fix

Notes
(0032824)
Eric NOULARD   
2013-04-14 13:59   
Hi Damien,

First of all the
include(CMakeDetermineSystem)
looks suspicious.

Why would you need to do that explicitely?
This CMake scripts gets included by CMake itself in the process of
discovering the system and compiler when crossing the 'project' command.

I cannot really imagine why you would need to include that explicitely
*before* the project statement.
Unless you can explain me why you are doing that I suggest you remove that line.

Now, if you remove that line from the main CMakeLists.txt you get:
CMake Error at CMakeLists.txt:19 (add_executable):
  Cannot find source file:

    /builds/workspace/PharoVM/Architecture/32/Slave/vm-builder-linux/cog/src/vm/cogit.c

Which seems to come from:
include(directories.cmake)

because "directories.cmake" contains absolute paths...

Now at the top of your main CMakeLists.txt one can read:
# This is automatically generated file using PharoUnixConfig on 4 April 2013 5:49:29.53 pm

So I bet this CMakeLists.txt may have to be re-generated when the source
tree moves or the generation scheme is broken and should be fixed in order
to produce relative path.

Now a more cosmetic question:
  Why didn't you put the CMakeLists.txt along with the source?
  Do you have to maintain alternative build system?
(0032827)
Damien Cassou   
2013-04-15 06:41   
Thank you for your fast answer. Regarding your comments:

- you find "include(CMakeDetermineSystem)" suspicious and you are right. Removing it solved my problem. Thank you very much

- about the absolute paths, we are fixing that. It's not so much of a problem right now as I have a patch that fixes that for the Ubuntu packaging. This patches replaces /builds/.../cog/ by ${CMAKE_SOURCE_DIR}/../.

- about the generation part: I guess we could ship CMakeLists.txt directly instead of generating it, you are probably right. There is no alternative build system but all the sources are generated out of Smalltalk source code.

Thank you again for your help. This bug report can probably be closed now.
(0032829)
Eric NOULARD   
2013-04-15 08:25   
The error was due to a user misuse.