I'm new to CMake. Therefore, I have several questions which I don't want to split into separate threads, because they are fairly small and related. Long story short, let's look at this linking invocation:
/D/Software/MinGW/bin/g++.exe -fmessage-length=0 -mfpmath=sse -msse2 -msse3 -mssse3 -msse4 -fopenmp -g -Wl,--whole-archive CMakeFiles/go.dir/objects.a -Wl,--no-whole-archive -o go.exe -Wl,--out-implib,libgo.dll.a -Wl,--major-image-version,0,--minor-image-version,0 /D/Software/Qt/4.8.0/lib/libQtOpenGLd4.a /D/Software/Qt/4.8.0/lib/libQtGuid4.a /D/Software/Qt/4.8.0/lib/libQtCored4.a -lglu32 -lopengl32 -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32
kernel32, winspool, shell32,
ole32, uuid, comdlg32, advapi32
? When I was building the same
project with QMake - there were none of these libraries. Moreover, I
don't even know the purpose of these ones. So, it looks like these
libraries are redundant, or am I wrong?-Wl,--whole-archive CMakeFiles/go.dir/objects.a
-Wl,--no-whole-archive -o go.exe -Wl,--out-implib,libgo.dll.a
part which is unknown to me. But, I guess that all object files are
somehow archived into objects.a, and therefore this part of linking
essentially is the same as the explicit list of object files, isn't it?Is it intended behavior of CMake to produce so many by-products of build process? Also I'm completely confused about a.exe
- what's that? Why should it ever reside in my build directory?
wrt 4)
The a.exe files (or more specifically the folders the reside in) look like binaries CMake used to determine the existence of certain compiler features.
In any case the amount of files you have there looks perfectly fine for CMake. Some of them are really useful for advanced debugging if something in the configuration and build process failed and I think its hence a good practice of CMake to keep them alive.