Re: [CMake] How to link against a static lib under windows/minGW

2008-10-30 Thread Joachim Ziegler
Joachim Ziegler wrote: Now how can I tell CMake to include the (external) file D:\nspr-4.6\lib\libnspr4.dll I've got it: INSTALL(FILES D:/nspr-4.6/lib/libnspr4.dll DESTINATION bin) Thnaks, Joachim ___ CMake mailing list CMake@cmake.org http://w

Re: [CMake] How to link against a static lib under windows/minGW

2008-10-30 Thread Joachim Ziegler
Werner Smekal wrote: > reason why it works in the first case. But your .lib seems to be the import library for the dll, so I don't think you have a static library anyways. OK. Now how can I tell CMake to include the (external) file D:\nspr-4.6\lib\libnspr4.dll (which is not created by the C

Re: [CMake] How to link against a static lib under windows/minGW

2008-10-30 Thread Werner Smekal
Hi, OK, then libnspr4_s.dll must be some other lib, maybe a debug version. Anyway, changing the CMakeLists line TARGET_LINK_LIBRARIES(testPR nspr4 Ws2_32) (with which linking works fine)) just to TARGET_LINK_LIBRARIES(testPR nspr4_s Ws2_32) prevents the linker from finding the library:

Re: [CMake] How to link against a static lib under windows/minGW

2008-10-30 Thread Joachim Ziegler
Hendrik Sattler wrote: Ok, I have the files libnspr4.dll libnspr4.lib libnspr4_s.dll where the last one should be the static library ("_s"). No. A DLL is a "dynamic link library". It may be linked statically itself but that doesn't mean that you can link statically against it. OK, then libn

Re: [CMake] How to link against a static lib under windows/minGW

2008-10-30 Thread Hendrik Sattler
Joachim Ziegler schrieb: > if(CMAKE_HOST_WIN32) > INCLUDE_DIRECTORIES(D:/nspr-4.6/include) > LINK_DIRECTORIES(D:/nspr-4.6/lib) > ADD_EXECUTABLE(testPR PRifdefd.cpp ${BASEFILES}) > TARGET_LINK_LIBRARIES(testPR nspr4 Ws2_32) > ... > > To run the executable, I have to copy the lib files libns

[CMake] How to link against a static lib under windows/minGW

2008-10-30 Thread Joachim Ziegler
Hello! Maybe this has been asked here 100 times before, but I've searched through the archives and could not find a solution to my problem: I have a program that I want to link statically agains tthe NSPR libs, and, if this is possible, against the Winsock2 libs. So far, I have in D:\nspr-