MantisBT - CMake
View Issue Details
0007367CMakeCMakepublic2008-07-18 19:242008-08-16 16:43
F. Goujeon 
Alex Neundorf 
normalminorsometimes
closedno change required 
CMake-2-6 
 
0007367: Code::Blocks generator: Project's file list have absolute path when project name == directory name
Here is my CMakeLists.txt, located in "CppParser" directory:

*********************************************
cmake_minimum_required(VERSION 2.6)



project(CppParser)

file(

    GLOB_RECURSE sources

    src/*.cpp

)

file(

    GLOB_RECURSE headers

    src/*.h

)

add_executable(

    Demo

    ${sources}

    ${headers}

)
*********************************************


This generates a CB project which file tree look like this (under Linux, you'd guess that):

CppParser
---- Sources
-------- home
------------ florian
---------------- Development
-------------------- CppParser
------------------------ src
---------------------------- Grammar.cpp
---------------------------- main.cpp
---- Headers
-------- home
------------ florian
---------------- Development
-------------------- CppParser
------------------------ src
---------------------------- Grammar.h

This kind of tree depth leads to very large tabs and Management sidebar. Very unconvenient!

However, if I change the line:
* project(CppParser)
to (for example):
* project(CppParser2) #or any project's name that is different from the directory's name
I get the expected tree:

CppParser2
---- Sources
-------- src
------------ Grammar.cpp
------------ main.cpp
---- Headers
-------- src
------------ Grammar.h


Unfortunately, this bug doesn't happen in some similar cases. For example, I have another project named "bkm_fw50_library" which doesn't suffer from that issue.
No tags attached.
Issue History
2008-07-18 19:24F. GoujeonNew Issue
2008-07-18 19:47F. GoujeonNote Added: 0012754
2008-07-20 15:25Alex NeundorfStatusnew => assigned
2008-07-20 15:25Alex NeundorfAssigned To => Alex Neundorf
2008-08-16 16:43Alex NeundorfNote Added: 0013043
2008-08-16 16:43Alex NeundorfStatusassigned => closed
2008-08-16 16:43Alex NeundorfResolutionopen => no change required

Notes
(0012754)
F. Goujeon   
2008-07-18 19:47   
I'm sorry, it has finally nothing to do with the project or directory name.
It happens when using a bash script (by double clicking on it) instead of using the command line directly.

Drugs are bad, kids!
(0013043)
Alex Neundorf   
2008-08-16 16:43   
According to the additional note from fgoujeon the bug report was invalid.
If I understood this wrong feel free to reopen it.
Then it would be nice if you could attach a minimal testcase so I can reproduce the problem.

Alex