Hi,
I have a problem with cmake not to compile but to link my .exe.
I use SDL, OpenGL, FMOD, LibXml2 and a personal library. But when I try to
compile my program LibXml2 and SDLmain are not include into the command line
to link my .exe.
Enclosed my CMakeList.txt and CMakeCache.txt and here the line for the
linker into build.make:
Output/shootspace.exe: C:/MinGW/lib/libSDL.dll.a
Output/shootspace.exe: C:/MinGW/lib/libfmodex.a
Output/shootspace.exe: CMakeFiles/shootspace.dir/build.make
Output/shootspace.exe: CMakeFiles/shootspace.dir/objects1.rsp
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR)
--red --bold Linking CXX executable Output/shootspace.exe
/c/Program Files (x86)/CMake 2.8/bin/cmake.exe -E remove
-f CMakeFiles/shootspace.dir/objects.a
/C/MinGW/bin/ar.exe cr CMakeFiles/shootspace.dir/objects.a
@CMakeFiles/shootspace.dir/objects1.rsp
/C/MinGW/bin/g++.exe -Wl,--whole-archive
CMakeFiles/shootspace.dir/objects.a -Wl,--no-whole-archive -o
Output/shootspace.exe -Wl,--out-implib,Output/libshootspace.dll.a
-Wl,--major-image-version,0,--minor-image-version,0
-Lsource/lib/gtl/lib/mingw -lmingw32 /C/MinGW/lib/libSDL.dll.a -lpthread
-lglu32 -lopengl32 /C/MinGW/lib/libfmodex.a -lgtl -lkernel32 -luser32
-lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32
As you can see, LibXml2 library and SDLmain library are found in
CMakeCache.txt but not include in build.make because lxml2 and lSDLmain
are missing.
Why ? I do something wrong in my CMakeList.txt ?
Thanks in advance for your help.
Cheers.
---
Julien Plu
Etudiant en 2ème année de Master Ingénierie en Intelligence Artificielle à
lUniversité Montpellier 2.
Mes projets Web sémantique : http://data.lirmm.fr
Page personnelle : http://jplu.developpez.com
Responsable de la rubrique Web sémantique
http://web-semantique.developpez.com/ de Developpez.com.
Fichier FOAF (version RDF) : http://jplu.developpez.com/julien
Fichier FOAF (version RDFa) : http://jplu.developpez.com/julien.html
Adresse mail personnelle : julien@redaction-developpez.com
Adresse mail universitaire : julien@etud.univ-montp2.fr
# This is the CMakeCache file.
# For build in directory: c:/Users/snake/workspaceCpp/ShootSpace
# It was generated by CMake: c:/Program Files (x86)/CMake 2.8/bin/cmake.exe
# You can edit this file to change values found and used by cmake.
# If you do not want to change any of the values, simply exit the editor.
# If you do want to change a value, simply edit, save, and exit the editor.
# The syntax for the file is as follows:
# KEY:TYPE=VALUE
# KEY is the name of a variable in the cache.
# TYPE is a hint to GUI's for the type of VALUE, DO NOT EDIT TYPE!.
# VALUE is the current value for the KEY.
# EXTERNAL cache entries
//Path to a program.
CMAKE_AR:FILEPATH=C:/MinGW/bin/ar.exe
//Choose the type of build, options are: None(CMAKE_CXX_FLAGS or
// CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.
CMAKE_BUILD_TYPE:STRING=
//Enable/Disable color output during build.
CMAKE_COLOR_MAKEFILE:BOOL=ON
//CXX compiler.
CMAKE_CXX_COMPILER:FILEPATH=C:/MinGW/bin/g++.exe
//Flags used by the compiler during all build types.
CMAKE_CXX_FLAGS:STRING=
//Flags used by the compiler during debug builds.
CMAKE_CXX_FLAGS_DEBUG:STRING=-g
//Flags used by the compiler during release minsize builds.
CMAKE_CXX_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG
//Flags used by the compiler during release builds (/MD /Ob1 /Oi
// /Ot /Oy /Gs will produce slightly less optimized but smaller
// files).
CMAKE_CXX_FLAGS_RELEASE:STRING=-O3 -DNDEBUG
//Flags used by the compiler during Release with Debug Info builds.
CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=-O2 -g
//Libraries linked by defalut with all C++ applications.
CMAKE_CXX_STANDARD_LIBRARIES:STRING=-lkernel32 -luser32 -lgdi32 -lwinspool
-lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32
//C compiler.
CMAKE_C_COMPILER:FILEPATH=C:/MinGW/bin/gcc.exe
//Flags used by the compiler during all build types.
CMAKE_C_FLAGS:STRING=
//Flags used by the compiler during debug builds.
CMAKE_C_FLAGS_DEBUG:STRING=-g
//Flags used by the compiler during release minsize builds.
CMAKE_C_FLAGS_MINSIZEREL:STRING=-Os -DNDEBUG
//Flags used by the compiler during release builds (/MD /Ob1 /Oi
// /Ot /Oy /Gs will produce slightly less optimized but smaller
// files).
CMAKE_C_FLAGS_RELEASE:STRING=-O3 -DNDEBUG
//Flags used by the compiler during Release with Debug Info builds.
CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=-O2 -g
//Libraries linked by defalut with all C applications.
CMAKE_C_STANDARD_LIBRARIES:STRING=-lkernel32 -luser32 -lgdi32 -lwinspool
-lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32
//Flags used by the linker.