[CMake] CMake keeps on referencing an uninstalled Qt

Laura Médioni laura.medioni at logilab.fr
Fri Oct 9 09:53:08 EDT 2015


Hi,

I am facing a problem with CMake 3.4 under Windows.
My CMake project is using Qt. Recently I uninstalled Qt and reinstalled 
it. Since then, the previous Qt install keeps on appearing in the 
CMakeCache.txt, leading to link edition errors.

Extract of CMakeCache.txt content:
///Dependencies for the target//
//tympan_lib_LIB_DEPENDS:STATIC=general;C:/DevelTools/CGAL-4.3/auxiliary/gmp/lib/libmpfr-4.lib;general;C:/DevelTools/CGAL-4.3/auxiliary/gmp/lib/libgmp-10.lib;optimized;C:/QtSDK/Desktop/Qt/4.8.1/msvc2010/lib/qtmain.lib;debug;C:/QtSDK/Desktop/Qt/4.8.1/msvc2010/lib/qtmaind.lib;optimized;C:/QtSDK/Desktop/Qt/4.8.1/msvc2010/lib/QtOpenGL4.lib;debug;C:/QtSDK/Desktop/Qt/4.8.1/msvc2010/lib/QtOpenGLd4.lib;optimized;C:/QtSDK/Desktop/Qt/4.8.1/msvc2010/lib/QtGui4.lib;debug;C:/QtSDK/Desktop/Qt/4.8.1/msvc2010/lib/QtGuid4.lib;optimized;C:/QtSDK/Desktop/Qt/4.8.1/msvc2010/lib/QtCore4.lib;debug;C:/QtSDK/Desktop/Qt/4.8.1/msvc2010/lib/QtCored4.lib;general;glu32;general;opengl32;optimized;C:/Qt/4.8.4/lib/QtOpenGL4.lib;debug;C:/Qt/4.8.4/lib/QtOpenGLd4.lib;optimized;C:/Qt/4.8.4/lib/QtGui4.lib;debug;C:/Qt/4.8.4/lib/QtGuid4.lib;optimized;C:/Qt/4.8.4/lib/QtTest4.lib;debug;C:/Qt/4.8.4/lib/QtTestd4.lib;optimized;C:/Qt/4.8.4/lib/QtXml4.lib;debug;C:/Qt/4.8.4/lib/QtXmld4.lib;optimized;C:/Qt/4.8.4/lib/QtCore4 
.lib;debug;C:/Qt/4.8.4/lib/QtCored4.lib;general;glu32;general;opengl32;general;glu32;general;opengl32;general;RoadEmissionNMPB;general;tympan_common;general;rply;/

Example of link edition error:
/39>LINK : fatal error LNK1104: cannot open file 
'C:\QtSDK\Desktop\Qt\4.8.1\msvc2010\lib\qtmaind.lib'/

The uninstalled Qt was in C:/QtSDK/ directory, the new one is in C:/Qt/. 
The libraries of the two installs are linked to all the libraries that 
depend on Qt.

However, C:/QtSDK/ directory doesn't exist anymore. QtSDK was properly 
uninstalled, there is no more track of it in the registry, nor in the 
environment variables. When I search for the keyword "QtSDK" at C: root 
(including all the file contents), the only occurence found is this 
CMakeCache.txt.

I tried to remove all the build files, delete CMake cache and re-run the 
configure and generate steps, it doesn't change anything: CMakeCache.txt 
is re-generated with C:/Qt AND C:/QtSDK libs.

When I print the content of variable ${QT_LIBRARIES} from a 
CMakeLists.txt, everything seems alright (no mention of QtSDK):
optimized;C:/Qt/4.8.4/lib/QtOpenGL4.lib;debug;C:/Qt/4.8.4/lib/QtOpenGLd4.lib;optimized;C:/Qt/4.8.4/lib/QtGui4.lib;debug;C:/Qt/4.8.4/lib/QtGuid4.lib;optimized;C:/Qt/4.8.4/lib/QtTest4.lib;debug;C:/Qt/4.8.4/lib/QtTestd4.lib;optimized;C:/Qt/4.8.4/lib/QtXml4.lib;debug;C:/Qt/4.8.4/lib/QtXmld4.lib;optimized;C:/Qt/4.8.4/lib/QtCore4.lib;debug;C:/Qt/4.8.4/lib/QtCored4.lib

I tried re-installing CMake (I was using 2.8 version), but it changed 
nothing.

When I open the .sln with Visual Studio, on each library linked to Qt I 
can see the following list of libraries among others:
C:\QtSDK\Desktop\Qt\4.8.1\msvc2010\lib\qtmaind.lib
C:\QtSDK\Desktop\Qt\4.8.1\msvc2010\lib\QtOpenGLd4.lib
C:\QtSDK\Desktop\Qt\4.8.1\msvc2010\lib\QtGuid4.lib
C:\QtSDK\Desktop\Qt\4.8.1\msvc2010\lib\QtCored4.lib
C:\Qt\4.8.4\lib\QtOpenGLd4.lib
C:\Qt\4.8.4\lib\QtGuid4.lib
C:\Qt\4.8.4\lib\QtTestd4.lib
C:\Qt\4.8.4\lib\QtXmld4.lib
C:\Qt\4.8.4\lib\QtCored4.lib

If I manually remove the 4 first ones (still from Visual Studio) and 
recompile, there is no more link edition error. But each time I update 
the solution with cmake, the problem comes back.

Any ideas?

Regards,

Laura Médioni



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


More information about the CMake mailing list