[CMake] Inconsistent lib dependancie/name for libnames with dots
Bastian Moldenhauer
bastianmoldenhauer at web.de
Sat Oct 23 08:01:04 EDT 2010
Hi,
I think I found a bug in cmake, but since I am a bloody beginner with cmake
don't hit me when I am wrong.
Cmake Version:
2.8.0
Error:
If I add a library using add_library(.) and the name of the lib contains a
dot cmake will produce some wrong dependencies or use a wrong lib output
name.
How to reproduce:
1. Create a folder "b"
2. Put a file "b.c" in "b"
3. Create a cmakelist with this content in "b"
FILE(GLOB src "*.c")
ADD_LIBRARY(b ${src})
4. Create a folder "e"
5. Put a file "e.c" in "e"
6. Create a cmakelist with this content in "e"
FILE(GLOB src "*.c")
ADD_EXECUTABLE(e ${src})
TARGET_LINK_LIBRARIES(e b.b)
7. In the parentfolder of "e" and "b" place a cmaklist with this
content
cmake_minimum_required(VERSION 2.8)
project(Prj)
add_subdirectory(b)
add_subdirectory(e)
Result:
If you do the above and let cmake create the project files (vs2010 and
vs2008 in my case) cmake will create a solution that want work. The reason
is pretty simple. The executable will be dependent on a lib called b.b.lib
which is correct. But the lib will never be created because project b.b will
create a lib which is named "b.lib".
Background:
I came across this when I was using Ogre3D and plugin which consists of 2
libs which are using cmake for the buildmanagement and one of the libs has a
dot in the name. I know that I can rename that lib in the files or rename it
in the solution etc. but what are buildsystems for when we have to mess
around with the files J
Let me know what you guys think J
Regards
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20101023/7e2cfe15/attachment.htm>
More information about the CMake
mailing list