[Cmake] Strange behavior of cmake

David Svoboda xsvobod2 at informatics . muni . cz
Mon, 23 Jun 2003 15:28:19 +0200


Hello,

I tried to link my library (+ its testing examples), but there are some
bugs, which I don't know how to solve.

1. When I set the output as "nmake Makefiles", linking of library failed
with the fact, that cmake cuts the names of libraries, i.e. libtiff.lib
is cut to tiff.lib. If I try to link my library against libtiff.lib, the
cmake cuts the name of libtiff.lib to tiff.lib. The file tiff.lib does not
exits thereforce the linkage fails. How to avoid this? (Without renaming
the library)

2. When I set the output as the project of Visual Studio 7.0 the MSVC
(C++ .NET) linker gives my (after the correct compilation) the warning:

*** LINK: warning LNK4098: defaultlib 'LIBC' conflicts with use of
other libs; use /NODEFAULTLIB:library

I used SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}
/nodefaultlib:libc"), but nothing has changed, because the CMake doesn't
permit using the flags "/nodefaultlib:library" - cmake forgets it and the
linker gives me that warning again.

3. Above facts doesn't appear when choosing the different output. I.e.,
setting the output as nmake makefiles handles the flag "/nodefaultlib" ok
and setting the output as Visual Studio 7.0 project handles the names of
libraries the right way.

I feel quite confused.

-David