I am unable to use static GnuWin32 libraries using the lib*.a naming
convention with an MSVC 8 2005 target.

FIND_LIBRARY will find my libraries, but CMake 2.6-2 insists on
rewriting libraries ending with ".a" to ".a.lib" when the IDE Project
files are generated, and issues warning CMP0008 about linking to an item
"which is a full-path but not a valid library file name".

The warning is suppressed, but the library filenames are still
rewritten, even if I set the CMP0008 policy to "OLD".

For some reason this error does not effect an nmake target, only Visual
Studio.

I have to manually fix the library names in Visual Studio.

Below is a minimal CMakeLists.txt file which replicates the problem:

CMAKE_MINIMUM_REQUIRED(VERSION 2.4)
SET(CMAKE_LIBRARY_PATH 
   "C:/Program Files/GnuWin32/lib"
   ${CMAKE_LIBRARY_PATH})

SET(CMAKE_FIND_LIBRARY_PREFIXES ${CMAKE_FIND_LIBRARY_PREFIXES} "lib" "")
SET(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES} ".a" ".lib")
FIND_LIBRARY(ZLIB_LIBRARIES NAMES "z") 
ADD_EXECUTABLE(usez usez.c)
TARGET_LINK_LIBRARIES(usez ${ZLIB_LIBRARIES})

Is there a work-around?

Thanks,
Braddock Gaskill

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to