Hi

I have a project for which I would like to generate a CodeBlocks,
There are a bunch of libraries I build under project_root/src/lib{1,2,3}

The CMakeLists.txt file in the lib{1,2,3} directories use the following
function
to set up the relevant bits

function( add_cxx_library lib_name )

set( dependencies ${ARGN} )
project( ${lib_name} )
file( GLOB_RECURSE lib_sources "*.cpp" )
file( GLOB_RECURSE lib_headers "*.h" )
add_library( ${lib_name} SHARED ${lib_sources} ${lib_headers} )

install( DIRECTORY ${PROJECT_SOURCE_DIR}
         DESTINATION include/{lib_name}
         FILES_MATCHING PATTERN "*.h" )

endfunction()

I added the header files because appearantly that makes the headers show up
in the IDE...

When running (OSX Maverick, CMake 3.1.1)

cmake -G "CodeBlocks - Unix Makefiles"

from project_root/build the cbp file is generated, and on opening in
CodeBlocks
the files in the project show up under an absolute path from / instead of
relative to project_root/src

/Users/Jiri/dev/cpp/project/src/Lib1/file{1,2,3}.{h,cpp}

instead of

Lib1/file{1,2,3}.{h,cpp}

Switching to

file( GLOB_RECURSE lib_sources RELATIVE ${PROJECT_SOURCE_DIR} "*.cpp" )
file( GLOB_RECURSE lib_headers RELATIVE ${PROJECT_SOURCE_DIR} "*.h" )

doesnt help...

If I would generate the cbp file directly in CodeBlocks it would do exactly
what I want.

Could it be there is some bug in cmake ?
Googling around there is some mention of this type of behaviour in CMake
2.8.4,
which was fixed in 2.8.6... http://www.cmake.org/Bug/view.php?id=12110

I am a bit at loss what is going on here..
Is the bug still there ?
There is no documentation found anywhere

Could someone shed some light, and possible a solution ?
Many thanks

Jiri
-- 

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

Reply via email to