[CMake] Question on pathes/names of generated lib (CMake 3.5.1, Visual Studio 2015 - x64)

Martin Maurer meinemailingliste2 at online.de
Thu Apr 14 00:28:51 EDT 2016


Hi,

I am trying to use CMake on a open source project called cryptominisat
( https://github.com/msoos/cryptominisat )
which is initially developed under Linux, but is meanwhile partly ported to Windows.
Source can already compiled (with a batch file) and run, but not yet completely with cmake.

It is also executed via AppVeyor, steps and log output see here:

https://ci.appveyor.com/project/msoos/cryptominisat

Mainly it is doing the following steps, also tried it on my local machine with downloaded and locally installed
cmake 3.5.1 and Visual Studio 2015 in a x64 native tools command prompt:
(replaced the %P% with c:\abc and I don't used logger DLL)

cmake -G "Visual Studio 14 2015 Win64" -DCMAKE_INSTALL_PREFIX=c:\abc
msbuild "INSTALL.vcxproj"

(I work in C:\projects\cryptominisat like AppVeyor)

cmake seems to run, generating the *.vcxproj.
During run these libs are generated: temp_lib_norm.lib and temp_lib_ipasir.lib
Then there is a exe, but it always tell me it can't find

..\lib\Release\cryptominisat4.lib

(using a different name then previous generated libs)

It is doing

Lib:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64\Lib.exe /OUT:"temp_lib_norm.dir\Release\temp_lib_norm.lib" /NOLOGO /MACHINE:X64 /machine:x64 temp_lib_norm.dir\Release\cnf.obj

-> This lib going to "temp_lib_norm.dir"

Link:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64\link.exe /ERRORREPORT:QUEUE /OUT:"C:\projects\cryptominisat\cmsat4-src\Release\cryptominisat4.dll" /INCREMENTAL:NO /NOLOGO kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /PDB:"C:/projects/cryptominisat/cmsat4-src/Release/cryptominisat4.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"C:/projects/cryptominisat/lib/Release/cryptominisat4.lib" /MACHINE:X64 /machine:x64 /DLL "C:\projects\cryptominisat\cmsat4-src\temp_lib_norm.dir\Release\cnf.obj"

-> This DLL going to "C:\projects\cryptominisat\cmsat4-src\Release\cryptominisat4.dll"

Link:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64\link.exe /ERRORREPORT:QUEUE /OUT:"C:\projects\cryptominisat\cmsat4-src\Release\cryptominisat4ipasir.dll" /INCREMENTAL:NO /NOLOGO kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib ..\lib\Release\cryptominisat4.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /PDB:"C:/projects/cryptominisat/cmsat4-src/Release/cryptominisat4ipasir.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"C:/projects/cryptominisat/lib/Release/cryptominisat4ipasir.lib" /MACHINE:X64 /machine:x64 /DLL "C:\projects\cryptominisat\cmsat4-src\temp_lib_ipasir.dir\Release\ipasir.obj"
LINK : fatal error LNK1181: cannot open input file '..\lib\Release\cryptominisat4.lib' [C:\projects\cryptominisat\cmsat4-src\libcryptominisat4ipasir.vcxproj]

-> This time "..\lib\Release\cryptominisat4.lib"

There seems to be a mixture of lib pathes and names, but interesting thing is, it seems to be working under Linux.

I see that temp_lib_norm.lib is built in "cmsat4-src\temp_lib_norm.dir",
but there seems to be no cryptominisat4.lib at all in these directories.

      I think this is the code for copying one lib to another:
      ( complete file see https://github.com/msoos/cryptominisat/blob/master/src/CMakeLists.txt line 151 )

      add_library(libcryptominisat4 SHARED ${cms_lib_objects_norm}) 



      target_link_libraries(libcryptominisat4 


      LINK_PUBLIC ${cryptoms_lib_link_libs} 


      ) 


whereas

list(APPEND cms_lib_objects_norm $<TARGET_OBJECTS:temp_lib_norm>)

and 

      add_library(temp_lib_norm OBJECT 


      ${cryptoms_lib_files} 


      cryptominisat.cpp 

      ) 


and 

      set(cryptoms_lib_files 


      cnf.cpp 


      propengine.cpp 

      varreplacer.cpp 

...
)

I am fairly new to cmake, just bought "mastering cmake" a few days ago and reading and trying a lot, 
but still don't know how to debug this and where to start at all. 

Can someone give me a hint? Where is the correct place to store this *.lib and/or *.dll?
Are there some which fail under Windows (with Visual Studio 2015) but work on Linux?

Many thanks for helping!

Best regards,

Martin




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20160414/166fcc62/attachment.html>


More information about the CMake mailing list