From a991fe8e4db5104133ff3cefd7ec8c38339dfeae Mon Sep 17 00:00:00 2001 From: LaurentGom Date: Thu, 19 Aug 2010 15:59:24 +0000 Subject: [PATCH] Added support for the CMake build system git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1550 4e206d99-4929-0410-ac5d-dfc041789085 --- CMakeLists.txt | 64 + build/codeblocks/SFML.workspace | 20 +- build/codeblocks/sfml-audio.cbp | 1 + build/make/Makefile | 32 +- build/vc2005/SFML.sln | 22 +- build/vc2005/sfml-audio.vcproj | 16 +- build/vc2005/sfml-graphics.vcproj | 8 +- build/vc2008/SFML.sln | 22 +- build/vc2008/sfml-audio.vcproj | 16 +- build/vc2008/sfml-graphics.vcproj | 8 +- cmake/Config.cmake | 48 + cmake/Macros.cmake | 191 ++ cmake/Modules/FindGLEW.cmake | 62 + cmake/Modules/FindSndfile.cmake | 29 + doc/CMakeLists.txt | 50 + doc/SFML.htm | 10 - doc/build/doxygen.css | 384 --- doc/{build/Doxyfile => doxyfile.in} | 18 +- doc/doxygen.css | 681 +++++ doc/{build => }/footer.htm | 0 doc/{build => }/header.htm | 0 doc/{html => }/logo-bg.jpg | Bin doc/{html => }/logo.jpg | Bin doc/{build/Doxygen.hpp => mainpage.hpp} | 0 examples/CMakeLists.txt | 16 + examples/X11/CMakeLists.txt | 14 + {samples => examples}/X11/X11.cpp | 0 .../build/codeblocks/ftp.cbp | 8 +- .../build/codeblocks/opengl.cbp | 8 +- .../build/codeblocks/pong.cbp | 8 +- .../build/codeblocks/shader.cbp | 8 +- .../build/codeblocks/sockets.cbp | 8 +- .../build/codeblocks/sound-capture.cbp | 18 +- .../build/codeblocks/sound.cbp | 8 +- .../build/codeblocks/voip.cbp | 8 +- .../build/codeblocks/win32.cbp | 8 +- .../build/codeblocks/window.cbp | 8 +- examples/build/make/Makefile | 15 + {samples => examples}/build/make/Makefile.X11 | 32 +- {samples => examples}/build/make/Makefile.ftp | 32 +- .../build/make/Makefile.opengl | 34 +- .../build/make/Makefile.pong | 32 +- .../build/make/Makefile.shader | 32 +- .../build/make/Makefile.sockets | 32 +- .../build/make/Makefile.sound | 32 +- .../build/make/Makefile.sound_capture | 32 +- .../build/make/Makefile.voip | 32 +- .../build/make/Makefile.window | 32 +- {samples => examples}/build/vc2005/ftp.vcproj | 8 +- .../build/vc2005/opengl.vcproj | 8 +- .../build/vc2005/pong.vcproj | 8 +- .../build/vc2005/shader.vcproj | 8 +- .../build/vc2005/sockets.vcproj | 8 +- .../build/vc2005/sound-capture.vcproj | 10 +- .../build/vc2005/sound.vcproj | 8 +- .../build/vc2005/voip.vcproj | 8 +- .../build/vc2005/win32.vcproj | 8 +- .../build/vc2005/window.vcproj | 8 +- {samples => examples}/build/vc2008/ftp.vcproj | 8 +- .../build/vc2008/opengl.vcproj | 10 +- .../build/vc2008/pong.vcproj | 8 +- .../build/vc2008/shader.vcproj | 8 +- .../build/vc2008/sockets.vcproj | 8 +- .../build/vc2008/sound-capture.vcproj | 10 +- .../build/vc2008/sound.vcproj | 8 +- .../build/vc2008/voip.vcproj | 8 +- .../build/vc2008/win32.vcproj | 8 +- .../build/vc2008/window.vcproj | 8 +- .../build/xcode/opengl-Info.plist | 0 .../build/xcode/pong-Info.plist | 0 .../build/xcode/post-fx-Info.plist | 0 .../xcode/samples.xcodeproj/project.pbxproj | 0 .../build/xcode/window-Info.plist | 0 examples/ftp/CMakeLists.txt | 10 + {samples => examples}/ftp/Ftp.cpp | 0 examples/opengl/CMakeLists.txt | 13 + {samples => examples}/opengl/OpenGL.cpp | 5 +- .../opengl/resources}/background.jpg | Bin .../opengl/resources}/texture.jpg | Bin examples/pong/CMakeLists.txt | 10 + {samples => examples}/pong/Pong.cpp | 12 +- .../pong/resources}/background.jpg | Bin .../pong => examples/pong/resources}/ball.png | Bin .../pong => examples/pong/resources}/ball.wav | Bin .../pong/resources}/paddle_left.png | Bin .../pong/resources}/paddle_right.png | Bin .../pong/resources}/sansation.ttf | Bin examples/shader/CMakeLists.txt | 10 + {samples => examples}/shader/Shader.cpp | 22 +- .../shader/resources}/background.jpg | Bin .../shader/resources}/blur.sfx | 0 .../shader/resources}/colorize.sfx | 0 .../shader/resources}/edge.sfx | 0 .../shader/resources}/fisheye.sfx | 0 .../shader/resources}/nothing.sfx | 0 .../shader/resources}/pixelate.sfx | 0 .../shader/resources}/sansation.ttf | Bin .../shader/resources}/sprite.png | Bin .../shader/resources}/wave.jpg | Bin .../shader/resources}/wave.sfx | 0 examples/sockets/CMakeLists.txt | 12 + {samples => examples}/sockets/Sockets.cpp | 0 {samples => examples}/sockets/TCP.cpp | 0 {samples => examples}/sockets/UDP.cpp | 0 examples/sound/CMakeLists.txt | 10 + {samples => examples}/sound/Sound.cpp | 4 +- .../sound/resources}/canary.wav | Bin .../sound/resources}/orchestral.ogg | Bin examples/sound_capture/CMakeLists.txt | 10 + .../sound_capture/SoundCapture.cpp | 0 examples/voip/CMakeLists.txt | 12 + {samples => examples}/voip/Client.cpp | 0 {samples => examples}/voip/Server.cpp | 0 {samples => examples}/voip/VoIP.cpp | 0 examples/win32/CMakeLists.txt | 10 + {samples => examples}/win32/Win32.cpp | 2 +- .../win32/resources}/image1.jpg | Bin .../win32/resources}/image2.jpg | Bin examples/window/CMakeLists.txt | 13 + {samples => examples}/window/Window.cpp | 0 extlibs/headers/png/png.h | 2686 ----------------- extlibs/headers/png/pngconf.h | 1510 --------- extlibs/headers/png/zconf.h | 416 --- extlibs/headers/png/zlib.h | 1605 ---------- extlibs/libs-mingw/libpng.a | Bin 303820 -> 0 bytes .../{libs-vc2005 => libs-msvc}/OpenAL32.lib | Bin .../{libs-vc2005 => libs-msvc}/freetype.lib | Bin extlibs/{libs-vc2005 => libs-msvc}/glew.lib | Bin extlibs/{libs-vc2005 => libs-msvc}/jpeg.lib | Bin .../{libs-vc2005 => libs-msvc}/sndfile.lib | Bin extlibs/libs-vc2005/png.lib | Bin 387504 -> 0 bytes license.txt | 4 +- samples/bin/libsndfile-1.dll | Bin 1743360 -> 0 bytes samples/bin/openal32.dll | Bin 294774 -> 0 bytes samples/build/make/Makefile | 17 - src/SFML/Audio/ALCheck.hpp | 10 +- src/SFML/Audio/CMakeLists.txt | 47 + src/SFML/CMakeLists.txt | 35 + src/SFML/Graphics/CMakeLists.txt | 104 + src/SFML/Main/CMakeLists.txt | 9 + src/SFML/Network/CMakeLists.txt | 54 + src/SFML/Network/Ftp.cpp | 2 +- src/SFML/System/CMakeLists.txt | 77 + src/SFML/Window/CMakeLists.txt | 83 + 144 files changed, 2086 insertions(+), 7033 deletions(-) create mode 100644 CMakeLists.txt create mode 100644 cmake/Config.cmake create mode 100644 cmake/Macros.cmake create mode 100644 cmake/Modules/FindGLEW.cmake create mode 100644 cmake/Modules/FindSndfile.cmake create mode 100644 doc/CMakeLists.txt delete mode 100644 doc/SFML.htm delete mode 100644 doc/build/doxygen.css rename doc/{build/Doxyfile => doxyfile.in} (99%) create mode 100644 doc/doxygen.css rename doc/{build => }/footer.htm (100%) rename doc/{build => }/header.htm (100%) rename doc/{html => }/logo-bg.jpg (100%) rename doc/{html => }/logo.jpg (100%) rename doc/{build/Doxygen.hpp => mainpage.hpp} (100%) create mode 100644 examples/CMakeLists.txt create mode 100644 examples/X11/CMakeLists.txt rename {samples => examples}/X11/X11.cpp (100%) rename {samples => examples}/build/codeblocks/ftp.cbp (92%) rename {samples => examples}/build/codeblocks/opengl.cbp (92%) rename {samples => examples}/build/codeblocks/pong.cbp (93%) rename {samples => examples}/build/codeblocks/shader.cbp (92%) rename {samples => examples}/build/codeblocks/sockets.cbp (90%) rename {samples => examples}/build/codeblocks/sound-capture.cbp (81%) rename {samples => examples}/build/codeblocks/sound.cbp (91%) rename {samples => examples}/build/codeblocks/voip.cbp (92%) rename {samples => examples}/build/codeblocks/win32.cbp (92%) rename {samples => examples}/build/codeblocks/window.cbp (91%) create mode 100644 examples/build/make/Makefile rename {samples => examples}/build/make/Makefile.X11 (75%) rename {samples => examples}/build/make/Makefile.ftp (74%) rename {samples => examples}/build/make/Makefile.opengl (77%) rename {samples => examples}/build/make/Makefile.pong (76%) rename {samples => examples}/build/make/Makefile.shader (76%) rename {samples => examples}/build/make/Makefile.sockets (75%) rename {samples => examples}/build/make/Makefile.sound (74%) rename {samples => examples}/build/make/Makefile.sound_capture (75%) rename {samples => examples}/build/make/Makefile.voip (75%) rename {samples => examples}/build/make/Makefile.window (75%) rename {samples => examples}/build/vc2005/ftp.vcproj (91%) rename {samples => examples}/build/vc2005/opengl.vcproj (92%) rename {samples => examples}/build/vc2005/pong.vcproj (91%) rename {samples => examples}/build/vc2005/shader.vcproj (91%) rename {samples => examples}/build/vc2005/sockets.vcproj (91%) rename {samples => examples}/build/vc2005/sound-capture.vcproj (91%) rename {samples => examples}/build/vc2005/sound.vcproj (91%) rename {samples => examples}/build/vc2005/voip.vcproj (91%) rename {samples => examples}/build/vc2005/win32.vcproj (92%) rename {samples => examples}/build/vc2005/window.vcproj (92%) rename {samples => examples}/build/vc2008/ftp.vcproj (92%) rename {samples => examples}/build/vc2008/opengl.vcproj (91%) rename {samples => examples}/build/vc2008/pong.vcproj (91%) rename {samples => examples}/build/vc2008/shader.vcproj (92%) rename {samples => examples}/build/vc2008/sockets.vcproj (92%) rename {samples => examples}/build/vc2008/sound-capture.vcproj (91%) rename {samples => examples}/build/vc2008/sound.vcproj (92%) rename {samples => examples}/build/vc2008/voip.vcproj (92%) rename {samples => examples}/build/vc2008/win32.vcproj (92%) rename {samples => examples}/build/vc2008/window.vcproj (92%) rename {samples => examples}/build/xcode/opengl-Info.plist (100%) rename {samples => examples}/build/xcode/pong-Info.plist (100%) rename {samples => examples}/build/xcode/post-fx-Info.plist (100%) rename {samples => examples}/build/xcode/samples.xcodeproj/project.pbxproj (100%) rename {samples => examples}/build/xcode/window-Info.plist (100%) create mode 100644 examples/ftp/CMakeLists.txt rename {samples => examples}/ftp/Ftp.cpp (100%) create mode 100644 examples/opengl/CMakeLists.txt rename {samples => examples}/opengl/OpenGL.cpp (95%) rename {samples/bin/datas/opengl => examples/opengl/resources}/background.jpg (100%) rename {samples/bin/datas/opengl => examples/opengl/resources}/texture.jpg (100%) create mode 100644 examples/pong/CMakeLists.txt rename {samples => examples}/pong/Pong.cpp (92%) rename {samples/bin/datas/pong => examples/pong/resources}/background.jpg (100%) rename {samples/bin/datas/pong => examples/pong/resources}/ball.png (100%) rename {samples/bin/datas/pong => examples/pong/resources}/ball.wav (100%) rename {samples/bin/datas/pong => examples/pong/resources}/paddle_left.png (100%) rename {samples/bin/datas/pong => examples/pong/resources}/paddle_right.png (100%) rename {samples/bin/datas/pong => examples/pong/resources}/sansation.ttf (100%) create mode 100644 examples/shader/CMakeLists.txt rename {samples => examples}/shader/Shader.cpp (88%) rename {samples/bin/datas/shader => examples/shader/resources}/background.jpg (100%) rename {samples/bin/datas/shader => examples/shader/resources}/blur.sfx (100%) rename {samples/bin/datas/shader => examples/shader/resources}/colorize.sfx (100%) rename {samples/bin/datas/shader => examples/shader/resources}/edge.sfx (100%) rename {samples/bin/datas/shader => examples/shader/resources}/fisheye.sfx (100%) rename {samples/bin/datas/shader => examples/shader/resources}/nothing.sfx (100%) rename {samples/bin/datas/shader => examples/shader/resources}/pixelate.sfx (100%) rename {samples/bin/datas/shader => examples/shader/resources}/sansation.ttf (100%) rename {samples/bin/datas/shader => examples/shader/resources}/sprite.png (100%) rename {samples/bin/datas/shader => examples/shader/resources}/wave.jpg (100%) rename {samples/bin/datas/shader => examples/shader/resources}/wave.sfx (100%) create mode 100644 examples/sockets/CMakeLists.txt rename {samples => examples}/sockets/Sockets.cpp (100%) rename {samples => examples}/sockets/TCP.cpp (100%) rename {samples => examples}/sockets/UDP.cpp (100%) create mode 100644 examples/sound/CMakeLists.txt rename {samples => examples}/sound/Sound.cpp (92%) rename {samples/bin/datas/sound => examples/sound/resources}/canary.wav (100%) rename {samples/bin/datas/sound => examples/sound/resources}/orchestral.ogg (100%) create mode 100644 examples/sound_capture/CMakeLists.txt rename {samples => examples}/sound_capture/SoundCapture.cpp (100%) create mode 100644 examples/voip/CMakeLists.txt rename {samples => examples}/voip/Client.cpp (100%) rename {samples => examples}/voip/Server.cpp (100%) rename {samples => examples}/voip/VoIP.cpp (100%) create mode 100644 examples/win32/CMakeLists.txt rename {samples => examples}/win32/Win32.cpp (94%) rename {samples/bin/datas/win32 => examples/win32/resources}/image1.jpg (100%) rename {samples/bin/datas/win32 => examples/win32/resources}/image2.jpg (100%) create mode 100644 examples/window/CMakeLists.txt rename {samples => examples}/window/Window.cpp (100%) delete mode 100644 extlibs/headers/png/png.h delete mode 100644 extlibs/headers/png/pngconf.h delete mode 100644 extlibs/headers/png/zconf.h delete mode 100644 extlibs/headers/png/zlib.h delete mode 100644 extlibs/libs-mingw/libpng.a rename extlibs/{libs-vc2005 => libs-msvc}/OpenAL32.lib (100%) rename extlibs/{libs-vc2005 => libs-msvc}/freetype.lib (100%) rename extlibs/{libs-vc2005 => libs-msvc}/glew.lib (100%) rename extlibs/{libs-vc2005 => libs-msvc}/jpeg.lib (100%) rename extlibs/{libs-vc2005 => libs-msvc}/sndfile.lib (100%) delete mode 100644 extlibs/libs-vc2005/png.lib delete mode 100644 samples/bin/libsndfile-1.dll delete mode 100644 samples/bin/openal32.dll delete mode 100644 samples/build/make/Makefile create mode 100644 src/SFML/Audio/CMakeLists.txt create mode 100644 src/SFML/CMakeLists.txt create mode 100644 src/SFML/Graphics/CMakeLists.txt create mode 100644 src/SFML/Main/CMakeLists.txt create mode 100644 src/SFML/Network/CMakeLists.txt create mode 100644 src/SFML/System/CMakeLists.txt create mode 100644 src/SFML/Window/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 000000000..2c3570cc7 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,64 @@ + +cmake_minimum_required(VERSION 2.8) + +# set a default build type if none was provided +# this has to be done before the project() instruction! +if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build (Debug or Release)" FORCE) +endif() + +# project name +project(SFML) + +# include the configuration file +include(${CMAKE_SOURCE_DIR}/cmake/Config.cmake) + +# setup version numbers +set(VERSION_MAJOR 2) +set(VERSION_MINOR 0) +set(VERSION_PATCH 0) + +# add the SFML header path +include_directories(${CMAKE_SOURCE_DIR}/include) + +# add an option for choosing the build type (shared or static) +set(BUILD_SHARED_LIBS TRUE CACHE BOOL "TRUE to build SFML as shared libraries, FALSE to build it as static libraries") + +# add an option for building the examples +set(BUILD_EXAMPLES FALSE CACHE BOOL "TRUE to build the SFML examples, FALSE to ignore them") + +# add an option for building the API documentation +set(BUILD_DOC FALSE CACHE BOOL "TRUE to generate the API documentation, FALSE to ignore it") + +# define SFML_DYNAMIC if the build type is set to 'shared' +if(BUILD_SHARED_LIBS) + add_definitions(-DSFML_DYNAMIC) +endif() + +# remove SL security warnings with Visual C++ +if(MSVC) + add_definitions(-D_CRT_SECURE_NO_DEPRECATE) +endif() + +# disable the rpath stuff +set(CMAKE_SKIP_BUILD_RPATH TRUE) + +# add the subdirectories +add_subdirectory(src/SFML) +if(BUILD_EXAMPLES) + add_subdirectory(examples) +endif() +if(BUILD_DOC) + add_subdirectory(doc) +endif() + +# setup the install rules +install(DIRECTORY include + DESTINATION . + COMPONENT devel + PATTERN ".svn" EXCLUDE) +install(FILES license.txt DESTINATION ${INSTALL_MISC_DIR}) +if(WINDOWS) + install(FILES extlibs/bin/libsndfile-1.dll DESTINATION bin) + install(FILES extlibs/bin/openal32.dll DESTINATION bin) +endif() diff --git a/build/codeblocks/SFML.workspace b/build/codeblocks/SFML.workspace index e60f353aa..2d9059715 100644 --- a/build/codeblocks/SFML.workspace +++ b/build/codeblocks/SFML.workspace @@ -7,15 +7,15 @@ - - - - - - - - - - + + + + + + + + + + diff --git a/build/codeblocks/sfml-audio.cbp b/build/codeblocks/sfml-audio.cbp index 7f92df093..208dc8dde 100644 --- a/build/codeblocks/sfml-audio.cbp +++ b/build/codeblocks/sfml-audio.cbp @@ -109,6 +109,7 @@ + diff --git a/build/make/Makefile b/build/make/Makefile index ec29440d2..19f809fb0 100644 --- a/build/make/Makefile +++ b/build/make/Makefile @@ -1,34 +1,34 @@ export SRCROOT = ../../src/SFML -export DESTDIR = /usr/local -export DESTLIBDIR = $(DESTDIR)/lib +export DESTDIR = /usr/local +export DESTLIBDIR = $(DESTDIR)/lib export DESTINCDIR = $(DESTDIR)/include export DESTDBGDIR = $(DESTLIBDIR)/debug/$(DESTLIBDIR) -export CC = gcc -export CPP = g++ -export CFLAGS = -W -Wall -pedantic -g -O2 -DNDEBUG -I../../include -I../../src -fPIC -export CFLAGSEXT = -I../../include -I../../src -g -O2 -DNDEBUG -fPIC -export LDFLAGS = -shared -export LIBPATH = ../../lib +export CC = gcc +export CPP = g++ +export CFLAGS = -W -Wall -pedantic -g -O2 -DNDEBUG -I../../include -I../../src -fPIC +export CFLAGSEXT = -I../../include -I../../src -g -O2 -DNDEBUG -fPIC +export LDFLAGS = -shared +export LIBPATH = ../../lib export VERSION = 2.0 -export CP = cp -export LN = ln -export LNFLAGS = -s -f +export CP = cp +export LN = ln +export LNFLAGS = -s -f export LIBS = system window graphics audio network all: sfml sfml: $(LIBS) -samples: - cd ../../samples/build/make && $(MAKE) +examples: + cd ../../examples/build/make && $(MAKE) $(LIBS): mkdir -p $(LIBPATH) $(MAKE) -f Makefile.$@ install: - mkdir -p $(DESTLIBDIR) - mkdir -p $(DESTINCDIR) + mkdir -p $(DESTLIBDIR) + mkdir -p $(DESTINCDIR) mkdir -p $(DESTDBGDIR) $(CP) -r ../../include/SFML/ $(DESTINCDIR)/ find $(DESTINCDIR)/SFML -name .svn -type d -print0 | xargs -0 /bin/rm -rf @@ -44,7 +44,7 @@ clean mrproper: $(MAKE) $@ -f Makefile.graphics $(MAKE) $@ -f Makefile.audio $(MAKE) $@ -f Makefile.network - cd ../../samples/build/make && $(MAKE) $@ + cd ../../examples/build/make && $(MAKE) $@ .PHONY: clean mrproper diff --git a/build/vc2005/SFML.sln b/build/vc2005/SFML.sln index c5fd96ed9..1364ac74f 100644 --- a/build/vc2005/SFML.sln +++ b/build/vc2005/SFML.sln @@ -26,7 +26,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sfml-window", "sfml-window. {C061A27D-7CA0-4179-9869-672FA04A86A8} = {C061A27D-7CA0-4179-9869-672FA04A86A8} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "opengl", "..\..\samples\build\vc2005\opengl.vcproj", "{4CD9A872-16EF-4C53-81FC-C7E77E782718}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "opengl", "..\..\examples\build\vc2005\opengl.vcproj", "{4CD9A872-16EF-4C53-81FC-C7E77E782718}" ProjectSection(ProjectDependencies) = postProject {0F9CE5F0-4D89-4314-9147-8AAB1B8842ED} = {0F9CE5F0-4D89-4314-9147-8AAB1B8842ED} {FA4620B1-393A-4719-9BB4-3BC8CAA70C4B} = {FA4620B1-393A-4719-9BB4-3BC8CAA70C4B} @@ -34,45 +34,45 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "opengl", "..\..\samples\bui {2BD26A09-E1B6-42E2-A0D0-63987B76BB97} = {2BD26A09-E1B6-42E2-A0D0-63987B76BB97} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sockets", "..\..\samples\build\vc2005\sockets.vcproj", "{E6ED898F-218E-4467-8B1D-92E393283E1B}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sockets", "..\..\examples\build\vc2005\sockets.vcproj", "{E6ED898F-218E-4467-8B1D-92E393283E1B}" ProjectSection(ProjectDependencies) = postProject {823DDC98-42D5-4A38-88CF-9DC06C788AE4} = {823DDC98-42D5-4A38-88CF-9DC06C788AE4} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sound", "..\..\samples\build\vc2005\sound.vcproj", "{11E3764D-850E-4EDA-9823-F66383A11042}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sound", "..\..\examples\build\vc2005\sound.vcproj", "{11E3764D-850E-4EDA-9823-F66383A11042}" ProjectSection(ProjectDependencies) = postProject {C061A27D-7CA0-4179-9869-672FA04A86A8} = {C061A27D-7CA0-4179-9869-672FA04A86A8} {B1BDA469-E6A7-4AF7-BDF9-EDDD7AD979A2} = {B1BDA469-E6A7-4AF7-BDF9-EDDD7AD979A2} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sound-capture", "..\..\samples\build\vc2005\sound-capture.vcproj", "{34EBDA13-AFA3-4AD9-AB64-2B2D40E09573}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sound-capture", "..\..\examples\build\vc2005\sound-capture.vcproj", "{34EBDA13-AFA3-4AD9-AB64-2B2D40E09573}" ProjectSection(ProjectDependencies) = postProject {B1BDA469-E6A7-4AF7-BDF9-EDDD7AD979A2} = {B1BDA469-E6A7-4AF7-BDF9-EDDD7AD979A2} {C061A27D-7CA0-4179-9869-672FA04A86A8} = {C061A27D-7CA0-4179-9869-672FA04A86A8} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "voip", "..\..\samples\build\vc2005\voip.vcproj", "{4B169017-FFDD-4588-9658-6F1C9ABC6495}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "voip", "..\..\examples\build\vc2005\voip.vcproj", "{4B169017-FFDD-4588-9658-6F1C9ABC6495}" ProjectSection(ProjectDependencies) = postProject {823DDC98-42D5-4A38-88CF-9DC06C788AE4} = {823DDC98-42D5-4A38-88CF-9DC06C788AE4} {C061A27D-7CA0-4179-9869-672FA04A86A8} = {C061A27D-7CA0-4179-9869-672FA04A86A8} {B1BDA469-E6A7-4AF7-BDF9-EDDD7AD979A2} = {B1BDA469-E6A7-4AF7-BDF9-EDDD7AD979A2} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "win32", "..\..\samples\build\vc2005\win32.vcproj", "{303EC049-639D-4F9C-9F33-D4B7F702275B}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "win32", "..\..\examples\build\vc2005\win32.vcproj", "{303EC049-639D-4F9C-9F33-D4B7F702275B}" ProjectSection(ProjectDependencies) = postProject {C061A27D-7CA0-4179-9869-672FA04A86A8} = {C061A27D-7CA0-4179-9869-672FA04A86A8} {FA4620B1-393A-4719-9BB4-3BC8CAA70C4B} = {FA4620B1-393A-4719-9BB4-3BC8CAA70C4B} {0F9CE5F0-4D89-4314-9147-8AAB1B8842ED} = {0F9CE5F0-4D89-4314-9147-8AAB1B8842ED} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "window", "..\..\samples\build\vc2005\window.vcproj", "{11E9ABEF-17A5-4FF7-91E5-994F34172F68}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "window", "..\..\examples\build\vc2005\window.vcproj", "{11E9ABEF-17A5-4FF7-91E5-994F34172F68}" ProjectSection(ProjectDependencies) = postProject {2BD26A09-E1B6-42E2-A0D0-63987B76BB97} = {2BD26A09-E1B6-42E2-A0D0-63987B76BB97} {0F9CE5F0-4D89-4314-9147-8AAB1B8842ED} = {0F9CE5F0-4D89-4314-9147-8AAB1B8842ED} {C061A27D-7CA0-4179-9869-672FA04A86A8} = {C061A27D-7CA0-4179-9869-672FA04A86A8} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pong", "..\..\samples\build\vc2005\pong.vcproj", "{DDDE27DC-5568-43EE-BD0E-57C581F73EDE}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pong", "..\..\examples\build\vc2005\pong.vcproj", "{DDDE27DC-5568-43EE-BD0E-57C581F73EDE}" ProjectSection(ProjectDependencies) = postProject {C061A27D-7CA0-4179-9869-672FA04A86A8} = {C061A27D-7CA0-4179-9869-672FA04A86A8} {FA4620B1-393A-4719-9BB4-3BC8CAA70C4B} = {FA4620B1-393A-4719-9BB4-3BC8CAA70C4B} @@ -83,15 +83,15 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pong", "..\..\samples\build EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SFML", "SFML", "{C6D36691-1669-4189-AAB8-06C9932C2A45}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{3EE136A0-C638-4989-BE5A-E4007221CA28}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Examples", "Examples", "{3EE136A0-C638-4989-BE5A-E4007221CA28}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ftp", "..\..\samples\build\vc2005\ftp.vcproj", "{7236920B-254C-43A3-9DC1-778B477226DF}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ftp", "..\..\examples\build\vc2005\ftp.vcproj", "{7236920B-254C-43A3-9DC1-778B477226DF}" ProjectSection(ProjectDependencies) = postProject {C061A27D-7CA0-4179-9869-672FA04A86A8} = {C061A27D-7CA0-4179-9869-672FA04A86A8} {823DDC98-42D5-4A38-88CF-9DC06C788AE4} = {823DDC98-42D5-4A38-88CF-9DC06C788AE4} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shader", "..\..\samples\build\vc2005\shader.vcproj", "{E8B7727D-2308-4ADC-90AE-D3F46798447D}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shader", "..\..\examples\build\vc2005\shader.vcproj", "{E8B7727D-2308-4ADC-90AE-D3F46798447D}" ProjectSection(ProjectDependencies) = postProject {0F9CE5F0-4D89-4314-9147-8AAB1B8842ED} = {0F9CE5F0-4D89-4314-9147-8AAB1B8842ED} {FA4620B1-393A-4719-9BB4-3BC8CAA70C4B} = {FA4620B1-393A-4719-9BB4-3BC8CAA70C4B} diff --git a/build/vc2005/sfml-audio.vcproj b/build/vc2005/sfml-audio.vcproj index 07d7953e4..732d0863c 100644 --- a/build/vc2005/sfml-audio.vcproj +++ b/build/vc2005/sfml-audio.vcproj @@ -43,7 +43,7 @@ @@ -340,7 +340,7 @@ /> diff --git a/build/vc2008/SFML.sln b/build/vc2008/SFML.sln index d57a945a5..5fdfc96c2 100644 --- a/build/vc2008/SFML.sln +++ b/build/vc2008/SFML.sln @@ -25,13 +25,13 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sfml-window", "sfml-window. {C061A27D-7CA0-4179-9869-672FA04A86A8} = {C061A27D-7CA0-4179-9869-672FA04A86A8} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ftp", "..\..\samples\build\vc2008\ftp.vcproj", "{7236920B-254C-43A3-9DC1-778B477226DF}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ftp", "..\..\examples\build\vc2008\ftp.vcproj", "{7236920B-254C-43A3-9DC1-778B477226DF}" ProjectSection(ProjectDependencies) = postProject {C061A27D-7CA0-4179-9869-672FA04A86A8} = {C061A27D-7CA0-4179-9869-672FA04A86A8} {823DDC98-42D5-4A38-88CF-9DC06C788AE4} = {823DDC98-42D5-4A38-88CF-9DC06C788AE4} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "opengl", "..\..\samples\build\vc2008\opengl.vcproj", "{4CD9A872-16EF-4C53-81FC-C7E77E782718}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "opengl", "..\..\examples\build\vc2008\opengl.vcproj", "{4CD9A872-16EF-4C53-81FC-C7E77E782718}" ProjectSection(ProjectDependencies) = postProject {2BD26A09-E1B6-42E2-A0D0-63987B76BB97} = {2BD26A09-E1B6-42E2-A0D0-63987B76BB97} {C061A27D-7CA0-4179-9869-672FA04A86A8} = {C061A27D-7CA0-4179-9869-672FA04A86A8} @@ -39,7 +39,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "opengl", "..\..\samples\bui {0F9CE5F0-4D89-4314-9147-8AAB1B8842ED} = {0F9CE5F0-4D89-4314-9147-8AAB1B8842ED} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pong", "..\..\samples\build\vc2008\pong.vcproj", "{DDDE27DC-5568-43EE-BD0E-57C581F73EDE}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pong", "..\..\examples\build\vc2008\pong.vcproj", "{DDDE27DC-5568-43EE-BD0E-57C581F73EDE}" ProjectSection(ProjectDependencies) = postProject {2BD26A09-E1B6-42E2-A0D0-63987B76BB97} = {2BD26A09-E1B6-42E2-A0D0-63987B76BB97} {B1BDA469-E6A7-4AF7-BDF9-EDDD7AD979A2} = {B1BDA469-E6A7-4AF7-BDF9-EDDD7AD979A2} @@ -48,32 +48,32 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pong", "..\..\samples\build {0F9CE5F0-4D89-4314-9147-8AAB1B8842ED} = {0F9CE5F0-4D89-4314-9147-8AAB1B8842ED} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sockets", "..\..\samples\build\vc2008\sockets.vcproj", "{E6ED898F-218E-4467-8B1D-92E393283E1B}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sockets", "..\..\examples\build\vc2008\sockets.vcproj", "{E6ED898F-218E-4467-8B1D-92E393283E1B}" ProjectSection(ProjectDependencies) = postProject {C061A27D-7CA0-4179-9869-672FA04A86A8} = {C061A27D-7CA0-4179-9869-672FA04A86A8} {823DDC98-42D5-4A38-88CF-9DC06C788AE4} = {823DDC98-42D5-4A38-88CF-9DC06C788AE4} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sound", "..\..\samples\build\vc2008\sound.vcproj", "{11E3764D-850E-4EDA-9823-F66383A11042}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sound", "..\..\examples\build\vc2008\sound.vcproj", "{11E3764D-850E-4EDA-9823-F66383A11042}" ProjectSection(ProjectDependencies) = postProject {B1BDA469-E6A7-4AF7-BDF9-EDDD7AD979A2} = {B1BDA469-E6A7-4AF7-BDF9-EDDD7AD979A2} {C061A27D-7CA0-4179-9869-672FA04A86A8} = {C061A27D-7CA0-4179-9869-672FA04A86A8} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sound-capture", "..\..\samples\build\vc2008\sound-capture.vcproj", "{34EBDA13-AFA3-4AD9-AB64-2B2D40E09573}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sound-capture", "..\..\examples\build\vc2008\sound-capture.vcproj", "{34EBDA13-AFA3-4AD9-AB64-2B2D40E09573}" ProjectSection(ProjectDependencies) = postProject {B1BDA469-E6A7-4AF7-BDF9-EDDD7AD979A2} = {B1BDA469-E6A7-4AF7-BDF9-EDDD7AD979A2} {C061A27D-7CA0-4179-9869-672FA04A86A8} = {C061A27D-7CA0-4179-9869-672FA04A86A8} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "voip", "..\..\samples\build\vc2008\voip.vcproj", "{4B169017-FFDD-4588-9658-6F1C9ABC6495}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "voip", "..\..\examples\build\vc2008\voip.vcproj", "{4B169017-FFDD-4588-9658-6F1C9ABC6495}" ProjectSection(ProjectDependencies) = postProject {B1BDA469-E6A7-4AF7-BDF9-EDDD7AD979A2} = {B1BDA469-E6A7-4AF7-BDF9-EDDD7AD979A2} {C061A27D-7CA0-4179-9869-672FA04A86A8} = {C061A27D-7CA0-4179-9869-672FA04A86A8} {823DDC98-42D5-4A38-88CF-9DC06C788AE4} = {823DDC98-42D5-4A38-88CF-9DC06C788AE4} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "win32", "..\..\samples\build\vc2008\win32.vcproj", "{303EC049-639D-4F9C-9F33-D4B7F702275B}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "win32", "..\..\examples\build\vc2008\win32.vcproj", "{303EC049-639D-4F9C-9F33-D4B7F702275B}" ProjectSection(ProjectDependencies) = postProject {2BD26A09-E1B6-42E2-A0D0-63987B76BB97} = {2BD26A09-E1B6-42E2-A0D0-63987B76BB97} {C061A27D-7CA0-4179-9869-672FA04A86A8} = {C061A27D-7CA0-4179-9869-672FA04A86A8} @@ -81,7 +81,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "win32", "..\..\samples\buil {0F9CE5F0-4D89-4314-9147-8AAB1B8842ED} = {0F9CE5F0-4D89-4314-9147-8AAB1B8842ED} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "window", "..\..\samples\build\vc2008\window.vcproj", "{11E9ABEF-17A5-4FF7-91E5-994F34172F68}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "window", "..\..\examples\build\vc2008\window.vcproj", "{11E9ABEF-17A5-4FF7-91E5-994F34172F68}" ProjectSection(ProjectDependencies) = postProject {2BD26A09-E1B6-42E2-A0D0-63987B76BB97} = {2BD26A09-E1B6-42E2-A0D0-63987B76BB97} {C061A27D-7CA0-4179-9869-672FA04A86A8} = {C061A27D-7CA0-4179-9869-672FA04A86A8} @@ -90,9 +90,9 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "window", "..\..\samples\bui EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SFML", "SFML", "{8A8AFD7B-453B-40BE-9C46-A5748C1ABA45}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{BF8295B9-DE13-4CF5-A71F-A345BCA50D68}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Examples", "Examples", "{BF8295B9-DE13-4CF5-A71F-A345BCA50D68}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shader", "..\..\samples\build\vc2008\shader.vcproj", "{E8B7727D-2308-4ADC-90AE-D3F46798447D}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shader", "..\..\examples\build\vc2008\shader.vcproj", "{E8B7727D-2308-4ADC-90AE-D3F46798447D}" ProjectSection(ProjectDependencies) = postProject {2BD26A09-E1B6-42E2-A0D0-63987B76BB97} = {2BD26A09-E1B6-42E2-A0D0-63987B76BB97} {C061A27D-7CA0-4179-9869-672FA04A86A8} = {C061A27D-7CA0-4179-9869-672FA04A86A8} diff --git a/build/vc2008/sfml-audio.vcproj b/build/vc2008/sfml-audio.vcproj index f36e3465c..d60b3e788 100644 --- a/build/vc2008/sfml-audio.vcproj +++ b/build/vc2008/sfml-audio.vcproj @@ -45,7 +45,7 @@ Name="VCCLCompilerTool" AdditionalOptions="/MP" Optimization="0" - AdditionalIncludeDirectories=""$(SolutionDir)..\..\src";"$(SolutionDir)..\..\include";"$(SolutionDir)..\..\extlibs\headers"" + AdditionalIncludeDirectories=""$(SolutionDir)..\..\src";"$(SolutionDir)..\..\include";"$(SolutionDir)..\..\extlibs\headers";"$(SolutionDir)..\..\extlibs\headers\AL"" PreprocessorDefinitions="WIN32;_DEBUG;_LIB;SFML_EXPORTS;SFML_DYNAMIC" MinimalRebuild="false" BasicRuntimeChecks="3" @@ -66,7 +66,7 @@ /> @@ -340,7 +340,7 @@ /> diff --git a/cmake/Config.cmake b/cmake/Config.cmake new file mode 100644 index 000000000..b96e85ac4 --- /dev/null +++ b/cmake/Config.cmake @@ -0,0 +1,48 @@ + +# detect the OS +if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") + set(WINDOWS 1) +elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux") + set(LINUX 1) +elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") + set(MACOSX 1) +else() + message(WARNING "Unsupported operating system") + return() +endif() + +# detect the architecture +# note: this test won't work for cross-compilation +include(CheckTypeSize) +check_type_size(void* SIZEOF_VOID_PTR) +if(${SIZEOF_VOID_PTR} MATCHES "^8$") + set(ARCH_BITS 64) +else() + set(ARCH_BITS 32) +endif() + +# detect the compiler and its version +if(CMAKE_COMPILER_IS_GNUCXX) + set(COMPILER_GCC 1) + execute_process(COMMAND "${CMAKE_CXX_COMPILER}" "-dumpversion" OUTPUT_VARIABLE GCC_VERSION_OUTPUT) + string(REGEX REPLACE "([0-9]+\\.[0-9]+).*" "\\1" GCC_VERSION "${GCC_VERSION_OUTPUT}") +elseif(MSVC_VERSION EQUAL 1400) + set(COMPILER_MSVC 1) + set(MSVC_VERSION 2005) +elseif(MSVC_VERSION EQUAL 1500) + set(COMPILER_MSVC 1) + set(MSVC_VERSION 2008) +elseif(MSVC_VERSION EQUAL 1600) + set(COMPILER_MSVC 1) + set(MSVC_VERSION 2010) +else() + message(WARNING "Unsupported compiler") + return() +endif() + +# define the install directory for miscellaneous files +if(WINDOWS) + set(INSTALL_MISC_DIR .) +elseif(UNIX) + set(INSTALL_MISC_DIR share/SFML) +endif() diff --git a/cmake/Macros.cmake b/cmake/Macros.cmake new file mode 100644 index 000000000..063a7e4a5 --- /dev/null +++ b/cmake/Macros.cmake @@ -0,0 +1,191 @@ + +# some of these macros are inspired from the boost/cmake macros + +# this macro adds external dependencies to a static target, +# compensating for the lack of a link step when building a static library. +# every compiler has its own way of doing it: +# - VC++ supports it directly through the static library flags +# - MinGW/gcc doesn't support it, but as a static library is nothing more than an archive, +# we can simply merge the external dependencies to our generated target as a post-build step +# - we don't do anything for other compilers and OSes; static build is not encouraged on Unix (Linux, Mac OS X) +# where shared libraries are properly managed and have many advantages over static libraries +macro(sfml_static_add_libraries target) + if(WINDOWS AND COMPILER_GCC) + # Windows - gcc + foreach(lib ${ARGN}) + if(NOT ${lib} MATCHES ".*/.*") + string(REGEX REPLACE "(.*)/bin/.*\\.exe" "\\1" STANDARD_LIBS_PATH "${CMAKE_CXX_COMPILER}") + set(lib "${STANDARD_LIBS_PATH}/lib/lib${lib}.a") + endif() + string(TOUPPER ${CMAKE_BUILD_TYPE} BUILD_TYPE) + get_target_property(TARGET_FILENAME ${target} ${BUILD_TYPE}_LOCATION) + add_custom_command(TARGET ${target} + POST_BUILD + COMMAND ${CMAKE_AR} x ${lib} + COMMAND ${CMAKE_AR} rcs ${TARGET_FILENAME} *.o + COMMAND del *.o /f /q + VERBATIM) + endforeach() + elseif(MSVC) + # Visual C++ + set(LIBRARIES "") + foreach(lib ${ARGN}) + if(NOT ${lib} MATCHES ".*\\.lib") + set(lib ${lib}.lib) + endif() + set(LIBRARIES "${LIBRARIES} ${lib}") + endforeach() + set_target_properties(${target} PROPERTIES STATIC_LIBRARY_FLAGS ${LIBRARIES}) + endif() +endmacro() + +# check if a value is contained in a list +# sets ${var} to TRUE if the value is found +macro(sfml_list_contains var value) + set(${var}) + foreach(value2 ${ARGN}) + if(${value} STREQUAL ${value2}) + set(${var} TRUE) + endif() + endforeach() +endmacro() + +# parse a list of arguments and options +# ex: sfml_parse_arguments(THIS "SOURCES;DEPENDS" "FLAG" FLAG SOURCES s1 s2 s3 DEPENDS d1 d2) +# will define the following variables: +# - THIS_SOURCES (s1 s2 s3) +# - THIS_DEPENDS (d1 d2) +# - THIS_FLAG TRUE +macro(sfml_parse_arguments prefix arg_names option_names) + foreach(arg_name ${arg_names}) + set(${prefix}_${arg_name}) + endforeach() + foreach(option_name ${option_names}) + set(${prefix}_${option_name} FALSE) + endforeach() + set(current_arg_name) + set(current_arg_list) + foreach(arg ${ARGN}) + sfml_list_contains(is_arg_name ${arg} ${arg_names}) + if(is_arg_name) + set(${prefix}_${current_arg_name} ${current_arg_list}) + set(current_arg_name ${arg}) + set(current_arg_list) + else() + sfml_list_contains(is_option ${arg} ${option_names}) + if(is_option) + set(${prefix}_${arg} TRUE) + else() + set(current_arg_list ${current_arg_list} ${arg}) + endif() + endif() + endforeach() + set(${prefix}_${current_arg_name} ${current_arg_list}) +endmacro() + +# add a new target which is a SFML library +# ex: sfml_add_library(sfml-graphics +# SOURCES sprite.cpp image.cpp ... +# DEPENDS sfml-window sfml-system +# EXTERNAL_LIBS opengl freetype ...) +macro(sfml_add_library target) + + # parse the arguments + sfml_parse_arguments(THIS "SOURCES;DEPENDS;EXTERNAL_LIBS" "" ${ARGN}) + + # create the target + add_library(${target} ${THIS_SOURCES}) + + # adjust the output file prefix/suffix to match our conventions + if(BUILD_SHARED_LIBS) + set_target_properties(${target} PROPERTIES DEBUG_POSTFIX -d) + if (WINDOWS AND COMPILER_GCC) + set_target_properties(${target} PROPERTIES PREFIX "") + set_target_properties(${target} PROPERTIES IMPORT_SUFFIX ".a") + endif() + else() + set_target_properties(${target} PROPERTIES DEBUG_POSTFIX -s-d) + set_target_properties(${target} PROPERTIES RELEASE_POSTFIX -s) + endif() + + # insert the major version number in the output filename + string(REGEX REPLACE "sfml(-.*)" "sfml${VERSION_MAJOR}\\1" OUTPUT_NAME ${target}) + set_target_properties(${target} PROPERTIES OUTPUT_NAME ${OUTPUT_NAME}) + + # for gcc 4.x on Windows, we add the -static-libgcc linker flag to get rid of an extra gcc DLL + if(WINDOWS AND COMPILER_GCC) + if(${GCC_VERSION} MATCHES "4\\..*") + set_target_properties(${target} PROPERTIES LINK_FLAGS -static-libgcc) + endif() + endif() + + # link the target to its SFML dependencies + if(THIS_DEPENDS) + target_link_libraries(${target} ${THIS_DEPENDS}) + endif() + + # link the target to its external dependencies + if(THIS_EXTERNAL_LIBS) + if(BUILD_SHARED_LIBS) + # in shared build, we use the regular linker commands + target_link_libraries(${target} ${THIS_EXTERNAL_LIBS}) + else() + # in static build there's no link stage, but with some compilers it is possible to force + # the generated static library to directly contain the symbols from its dependencies + sfml_static_add_libraries(${target} ${THIS_EXTERNAL_LIBS}) + endif() + endif() + + # add the install rule + install(TARGETS ${target} + RUNTIME DESTINATION bin COMPONENT bin + LIBRARY DESTINATION lib COMPONENT bin + ARCHIVE DESTINATION lib COMPONENT devel) + +endmacro() + +# add a new target which is a SFML example +# ex: sfml_add_example(ftp +# SOURCES ftp.cpp ... +# DEPENDS sfml-network sfml-system) +macro(sfml_add_example target) + + # parse the arguments + sfml_parse_arguments(THIS "SOURCES;DEPENDS" "GUI_APP" ${ARGN}) + + # create the target + if(THIS_GUI_APP AND WINDOWS) + add_executable(${target} WIN32 ${THIS_SOURCES}) + target_link_libraries(${target} sfml-main) + else() + add_executable(${target} ${THIS_SOURCES}) + endif() + + # set the debug suffix + set_target_properties(${target} PROPERTIES DEBUG_POSTFIX -d) + + # for gcc 4.x on Windows, we add the -static-libgcc linker flag to get rid of an extra gcc DLL + if(WINDOWS AND COMPILER_GCC) + if(${GCC_VERSION} MATCHES "4\\..*") + set_target_properties(${target} PROPERTIES LINK_FLAGS -static-libgcc) + endif() + endif() + + # link the target to its SFML dependencies + if(THIS_DEPENDS) + target_link_libraries(${target} ${THIS_DEPENDS}) + endif() + + # add the install rule + install(TARGETS ${target} + RUNTIME DESTINATION ${INSTALL_MISC_DIR}/examples/${target} COMPONENT examples) + + # install the example's resources as well + set(EXAMPLE_RESOURCES "${CMAKE_SOURCE_DIR}/examples/${target}/resources") + if(EXISTS ${EXAMPLE_RESOURCES}) + install(DIRECTORY ${EXAMPLE_RESOURCES} + DESTINATION ${INSTALL_MISC_DIR}/examples/${target} + COMPONENT examples + PATTERN ".svn" EXCLUDE) + endif() +endmacro() diff --git a/cmake/Modules/FindGLEW.cmake b/cmake/Modules/FindGLEW.cmake new file mode 100644 index 000000000..9626e6121 --- /dev/null +++ b/cmake/Modules/FindGLEW.cmake @@ -0,0 +1,62 @@ +# +# Try to find GLEW library and include path. +# Once done this will define +# +# GLEW_FOUND +# GLEW_INCLUDE_PATH +# GLEW_LIBRARY +# + +IF (WIN32) + FIND_PATH( GLEW_INCLUDE_PATH GL/glew.h + $ENV{PROGRAMFILES}/GLEW/include + ${GLEW_ROOT_DIR}/include + DOC "The directory where GL/glew.h resides") + + IF (NV_SYSTEM_PROCESSOR STREQUAL "AMD64") + FIND_LIBRARY( GLEW_LIBRARY + NAMES glew64 glew64s + PATHS + $ENV{PROGRAMFILES}/GLEW/lib + ${PROJECT_SOURCE_DIR}/src/nvgl/glew/bin + ${PROJECT_SOURCE_DIR}/src/nvgl/glew/lib + DOC "The GLEW library (64-bit)" + ) + ELSE(NV_SYSTEM_PROCESSOR STREQUAL "AMD64") + FIND_LIBRARY( GLEW_LIBRARY + NAMES glew GLEW glew32 glew32s + PATHS + $ENV{PROGRAMFILES}/GLEW/lib + ${PROJECT_SOURCE_DIR}/src/nvgl/glew/bin + ${PROJECT_SOURCE_DIR}/src/nvgl/glew/lib + DOC "The GLEW library" + ) + ENDIF(NV_SYSTEM_PROCESSOR STREQUAL "AMD64") +ELSE (WIN32) + FIND_PATH( GLEW_INCLUDE_PATH GL/glew.h + /usr/include + /usr/local/include + /sw/include + /opt/local/include + ${GLEW_ROOT_DIR}/include + DOC "The directory where GL/glew.h resides") + + FIND_LIBRARY( GLEW_LIBRARY + NAMES GLEW glew + PATHS + /usr/lib64 + /usr/lib + /usr/local/lib64 + /usr/local/lib + /sw/lib + /opt/local/lib + ${GLEW_ROOT_DIR}/lib + DOC "The GLEW library") +ENDIF (WIN32) + +SET(GLEW_FOUND "NO") +IF (GLEW_INCLUDE_PATH AND GLEW_LIBRARY) + SET(GLEW_LIBRARIES ${GLEW_LIBRARY}) + SET(GLEW_FOUND "YES") +ENDIF (GLEW_INCLUDE_PATH AND GLEW_LIBRARY) + diff --git a/cmake/Modules/FindSndfile.cmake b/cmake/Modules/FindSndfile.cmake new file mode 100644 index 000000000..ece231d08 --- /dev/null +++ b/cmake/Modules/FindSndfile.cmake @@ -0,0 +1,29 @@ +# - Find sndfile +# Find the native sndfile includes and libraries +# +# SNDFILE_INCLUDE_DIR - where to find sndfile.h, etc. +# SNDFILE_LIBRARIES - List of libraries when using libsndfile. +# SNDFILE_FOUND - True if libsndfile found. + +if(SNDFILE_INCLUDE_DIR) + # Already in cache, be silent + set(SNDFILE_FIND_QUIETLY TRUE) +endif(SNDFILE_INCLUDE_DIR) + +find_path(SNDFILE_INCLUDE_DIR sndfile.h) + +find_library(SNDFILE_LIBRARY NAMES sndfile sndfile-1) + +# Handle the QUIETLY and REQUIRED arguments and set SNDFILE_FOUND to TRUE if +# all listed variables are TRUE. +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(SNDFILE DEFAULT_MSG + SNDFILE_INCLUDE_DIR SNDFILE_LIBRARY) + +if(SNDFILE_FOUND) + set(SNDFILE_LIBRARIES ${SNDFILE_LIBRARY}) +else(SNDFILE_FOUND) + set(SNDFILE_LIBRARIES) +endif(SNDFILE_FOUND) + +mark_as_advanced(SNDFILE_INCLUDE_DIR SNDFILE_LIBRARY) diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt new file mode 100644 index 000000000..13e1e8396 --- /dev/null +++ b/doc/CMakeLists.txt @@ -0,0 +1,50 @@ + +# find doxygen +find_package(Doxygen REQUIRED) + +# set the input and output documentation paths +set(DOXYGEN_INPUT_DIR ${CMAKE_SOURCE_DIR}) +set(DOXYGEN_OUTPUT_DIR ${CMAKE_BINARY_DIR}/doc) + +# see if we can generate the CHM documentation +if(WINDOWS) + # if HHC is found, we can generate the CHM (compressed HTML) output + find_program(DOXYGEN_HHC_PROGRAM + NAMES hhc.exe + PATHS "c:/Program Files/HTML Help Workshop" + DOC "HTML Help Compiler program") + if(DOXYGEN_HHC_PROGRAM) + set(DOXYGEN_GENERATE_HTMLHELP YES) + else() + set(DOXYGEN_GENERATE_HTMLHELP NO) + endif() +else() + set(DOXYGEN_HHC_PROGRAM) + set(DOXYGEN_GENERATE_HTMLHELP NO) +endif() + +# configure the source Doxyfile by copying it and replacing all @variables@ +set(DOXYGEN_CONFIGURED_INPUT ${DOXYGEN_OUTPUT_DIR}/doxyfile) +configure_file(${DOXYGEN_INPUT_DIR}/doc/doxyfile.in ${DOXYGEN_CONFIGURED_INPUT} @ONLY) + +# copy the files needed by the documentation +configure_file(${DOXYGEN_INPUT_DIR}/doc/doxygen.css ${DOXYGEN_OUTPUT_DIR}/html/doxygen.css COPYONLY) +configure_file(${DOXYGEN_INPUT_DIR}/doc/logo.jpg ${DOXYGEN_OUTPUT_DIR}/html/logo.jpg COPYONLY) +configure_file(${DOXYGEN_INPUT_DIR}/doc/logo-bg.jpg ${DOXYGEN_OUTPUT_DIR}/html/logo-bg.jpg COPYONLY) + +# target setup +add_custom_target(doc + COMMAND ${CMAKE_COMMAND} -E echo_append "Building API Documentation..." + COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_CONFIGURED_INPUT} + COMMAND ${CMAKE_COMMAND} -E echo "Done." + WORKING_DIRECTORY ${DOXYGEN_INPUT_DIR}) + +# setup install rules +install(DIRECTORY ${DOXYGEN_OUTPUT_DIR}/html + DESTINATION ${INSTALL_MISC_DIR}/doc + COMPONENT doc) +if(DOXYGEN_HHC_PROGRAM) + install(FILES ${DOXYGEN_OUTPUT_DIR}/sfml.chm + DESTINATION ${INSTALL_MISC_DIR}/doc + COMPONENT doc) +endif() diff --git a/doc/SFML.htm b/doc/SFML.htm deleted file mode 100644 index 631d42ab7..000000000 --- a/doc/SFML.htm +++ /dev/null @@ -1,10 +0,0 @@ - - - - - SFML reference documentation - - - - - diff --git a/doc/build/doxygen.css b/doc/build/doxygen.css deleted file mode 100644 index de219acfc..000000000 --- a/doc/build/doxygen.css +++ /dev/null @@ -1,384 +0,0 @@ -div#logo -{ - margin-bottom : 1em; - background : url("./logo-bg.jpg") repeat-x; -} - -div#logo a -{ - display : block; -} - -p#footer -{ - text-decoration : overline; - color : #606060; - padding-top : 1em; - text-align : center; - font-size : smaller; -} - -p#footer a -{ - color : #007298; - text-decoration : none; -} - -BODY,H1,H2,H3,H4,H5,H6,P,CENTER,TD,TH,UL,DL,DIV { - font-family: Geneva, Arial, Helvetica, sans-serif; -} -BODY,TD { - font-size: 90%; -} -H1 { - text-align : center; - margin-top : 0px; - color : #2090B0; - font-size : 160%; -} -H2 { - font-size: 120%; -} -H3 { - font-size: 100%; -} -CAPTION { font-weight: bold } -DIV.qindex { - width: 100%; - background-color: #E0FFE0; - border: 1px dotted #808080; - text-align: center; - margin: 2px; - padding: 2px; - line-height: 140%; -} -DIV.nav { - width: 100%; - background-color: #e8eef2; - border: 1px solid #84b0c7; - text-align: center; - margin: 2px; - padding: 2px; - line-height: 140%; -} -DIV.navtab { - background-color: #e8eef2; - border: 1px solid #84b0c7; - text-align: center; - margin: 2px; - margin-right: 15px; - padding: 2px; -} -TD.navtab { - font-size: 70%; -} -A.qindex { - text-decoration: none; - font-weight: bold; -} -A.qindex:visited { - text-decoration: none; - font-weight: bold; -} -A.qindex:hover { - text-decoration: none; - background-color: #ddddff; -} -A.qindexHL { - text-decoration: none; - font-weight: bold; - background-color: #6666cc; - color: #ffffff; - border: 1px double #9295C2; -} -A.qindexHL:hover { - text-decoration: none; - background-color: #6666cc; - color: #ffffff; -} -A.qindexHL:visited { text-decoration: none; background-color: #6666cc; color: #ffffff } -A.el { text-decoration: none; font-weight: bold } -A.elRef { font-weight: bold } -A.code:link { text-decoration: none; font-weight: normal; border-bottom : 1px dotted #808080; color: black;} -A.code:visited { text-decoration: none; font-weight: normal; border-bottom : 1px dotted #808080; color: black;} -A.codeRef:link { font-weight: normal; color: #0000FF} -A.codeRef:visited { font-weight: normal; color: #0000FF} -/*A:hover { text-decoration: none; background-color: #f2f2ff }*/ -DL.el { margin-left: -1cm } -.fragment { - font-family: monospace, fixed; - font-size: 95%; -} -PRE.fragment { - border: 1px solid #CCCCCC; - background-color: #f5f5f5; - margin-top: 4px; - margin-bottom: 4px; - margin-left: 2px; - margin-right: 8px; - padding-left: 6px; - padding-right: 6px; - padding-top: 4px; - padding-bottom: 4px; -} -DIV.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px } - -DIV.groupHeader { - margin-left: 16px; - margin-top: 12px; - margin-bottom: 6px; - font-weight: bold; -} -DIV.groupText { margin-left: 16px; font-style: italic; font-size: 90% } -BODY { - background: white; - color: black; - margin-right: 20px; - margin-left: 20px; -} -TD.indexkey { - background-color: #e8eef2; - font-weight: bold; - padding-right : 10px; - padding-top : 2px; - padding-left : 10px; - padding-bottom : 2px; - margin-left : 0px; - margin-right : 0px; - margin-top : 2px; - margin-bottom : 2px; - border: 1px solid #CCCCCC; -} -TD.indexvalue { - background-color: #e8eef2; - font-style: italic; - padding-right : 10px; - padding-top : 2px; - padding-left : 10px; - padding-bottom : 2px; - margin-left : 0px; - margin-right : 0px; - margin-top : 2px; - margin-bottom : 2px; - border: 1px solid #CCCCCC; -} -TR.memlist { - background-color: #f0f0f0; -} -P.formulaDsp { text-align: center; } -IMG.formulaDsp { } -IMG.formulaInl { vertical-align: middle; } -SPAN.keyword { color: #0000FF } -SPAN.keywordtype { color: #0000FF } -SPAN.keywordflow { color: #0000FF } -SPAN.comment { color: #008000 } -SPAN.preprocessor { color: #008080 } -SPAN.stringliteral { color: #008080 } -SPAN.charliteral { color: #008080 } -.mdescLeft { - padding: 0px 8px 4px 8px; - font-size: 80%; - font-style: italic; - background-color: #FAFAFA; - border-top: 1px none #E0E0E0; - border-right: 1px none #E0E0E0; - border-bottom: 1px none #E0E0E0; - border-left: 1px none #E0E0E0; - margin: 0px; -} -.mdescRight { - padding: 0px 8px 4px 8px; - font-size: 80%; - font-style: italic; - background-color: #FAFAFA; - border-top: 1px none #E0E0E0; - border-right: 1px none #E0E0E0; - border-bottom: 1px none #E0E0E0; - border-left: 1px none #E0E0E0; - margin: 0px; -} -.memItemLeft { - padding: 1px 0px 0px 8px; - margin: 4px; - border-top-width: 1px; - border-right-width: 1px; - border-bottom-width: 1px; - border-left-width: 1px; - border-top-color: #E0E0E0; - border-right-color: #E0E0E0; - border-bottom-color: #E0E0E0; - border-left-color: #E0E0E0; - border-top-style: solid; - border-right-style: none; - border-bottom-style: none; - border-left-style: none; - background-color: #FAFAFA; - font-size: 80%; -} -.memItemRight { - padding: 1px 8px 0px 8px; - margin: 4px; - border-top-width: 1px; - border-right-width: 1px; - border-bottom-width: 1px; - border-left-width: 1px; - border-top-color: #E0E0E0; - border-right-color: #E0E0E0; - border-bottom-color: #E0E0E0; - border-left-color: #E0E0E0; - border-top-style: solid; - border-right-style: none; - border-bottom-style: none; - border-left-style: none; - background-color: #FAFAFA; - font-size: 80%; -} -.memTemplItemLeft { - padding: 1px 0px 0px 8px; - margin: 4px; - border-top-width: 1px; - border-right-width: 1px; - border-bottom-width: 1px; - border-left-width: 1px; - border-top-color: #E0E0E0; - border-right-color: #E0E0E0; - border-bottom-color: #E0E0E0; - border-left-color: #E0E0E0; - border-top-style: none; - border-right-style: none; - border-bottom-style: none; - border-left-style: none; - background-color: #FAFAFA; - font-size: 80%; -} -.memTemplItemRight { - padding: 1px 8px 0px 8px; - margin: 4px; - border-top-width: 1px; - border-right-width: 1px; - border-bottom-width: 1px; - border-left-width: 1px; - border-top-color: #E0E0E0; - border-right-color: #E0E0E0; - border-bottom-color: #E0E0E0; - border-left-color: #E0E0E0; - border-top-style: none; - border-right-style: none; - border-bottom-style: none; - border-left-style: none; - background-color: #FAFAFA; - font-size: 80%; -} -.memTemplParams { - padding: 1px 0px 0px 8px; - margin: 4px; - border-top-width: 1px; - border-right-width: 1px; - border-bottom-width: 1px; - border-left-width: 1px; - border-top-color: #E0E0E0; - border-right-color: #E0E0E0; - border-bottom-color: #E0E0E0; - border-left-color: #E0E0E0; - border-top-style: solid; - border-right-style: none; - border-bottom-style: none; - border-left-style: none; - color: #606060; - background-color: #FAFAFA; - font-size: 80%; -} -.search { color: #003399; - font-weight: bold; -} -FORM.search { - margin-bottom: 0px; - margin-top: 0px; -} -INPUT.search { font-size: 75%; - color: #000080; - font-weight: normal; - background-color: #e8eef2; -} -TD.tiny { font-size: 75%; -} -a { - color: #2090B0; -} -a:visited { - color: #2090B0; -} -.dirtab { padding: 4px; - border-collapse: collapse; - border: 1px solid #84b0c7; -} -TH.dirtab { background: #e8eef2; - font-weight: bold; -} -HR { height: 1px; - border: none; - border-top: 1px solid black; -} - -/* Style for detailed member documentation */ -.memtemplate { - font-size: 80%; - color: #606060; - font-weight: normal; -} -.memnav { - background-color: #e8eef2; - border: 1px solid #84b0c7; - text-align: center; - margin: 2px; - margin-right: 15px; - padding: 2px; -} -.memitem { - /*padding: 4px;*/ - background-color: #F0FFF0; - border-width: 1px; - border-style: solid; - border-color: #808080; - /*-moz-border-radius: 8px 8px 8px 8px;*/ -} -.memname { - white-space: nowrap; - font-weight: bold; -} -.memdoc{ - padding-left: 10px; -} -.memproto { - background-color: #D0FFD0; - width: 100%; - border-bottom-width: 1px; - border-bottom-style: dotted; - border-bottom-color: #808080; - font-weight: bold; - /*-moz-border-radius: 8px 8px 8px 8px;*/ -} -.paramkey { - text-align: right; -} -.paramtype { - white-space: nowrap; -} -.paramname { - color: #602020; - font-style: italic; - white-space: nowrap; -} -/* End Styling for detailed member documentation */ - -/* for the tree view */ -.ftvtree { - font-family: sans-serif; - margin:0.5em; -} -.directory { font-size: 9pt; font-weight: bold; } -.directory h3 { margin: 0px; margin-top: 1em; font-size: 11pt; } -.directory > h3 { margin-top: 0; } -.directory p { margin: 0px; white-space: nowrap; } -.directory div { display: none; margin: 0px; } -.directory img { vertical-align: -30%; } diff --git a/doc/build/Doxyfile b/doc/doxyfile.in similarity index 99% rename from doc/build/Doxyfile rename to doc/doxyfile.in index 16e32c13b..32dfaf5e0 100644 --- a/doc/build/Doxyfile +++ b/doc/doxyfile.in @@ -31,14 +31,14 @@ PROJECT_NAME = SFML # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = +PROJECT_NUMBER = @VERSION_MAJOR@.@VERSION_MINOR@ # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. # If a relative path is entered, it will be relative to the location # where doxygen was started. If left blank the current directory will be used. -OUTPUT_DIRECTORY = .. +OUTPUT_DIRECTORY = "@DOXYGEN_OUTPUT_DIR@" # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create # 4096 sub-directories (in 2 levels) under the output directory of each output @@ -573,8 +573,8 @@ WARN_LOGFILE = # directories like "/usr/src/myproject". Separate the files or directories # with spaces. -INPUT = ../../include/SFML/ \ - Doxygen.hpp +INPUT = "@DOXYGEN_INPUT_DIR@/include/SFML" \ + "@DOXYGEN_INPUT_DIR@/doc/mainpage.hpp" # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is @@ -807,13 +807,13 @@ HTML_FILE_EXTENSION = .htm # each generated HTML page. If it is left blank doxygen will generate a # standard header. -HTML_HEADER = header.htm +HTML_HEADER = "@DOXYGEN_INPUT_DIR@/doc/header.htm" # The HTML_FOOTER tag can be used to specify a personal HTML footer for # each generated HTML page. If it is left blank doxygen will generate a # standard footer. -HTML_FOOTER = footer.htm +HTML_FOOTER = "@DOXYGEN_INPUT_DIR@/doc/footer.htm" # The HTML_STYLESHEET tag can be used to specify a user-defined cascading # style sheet that is used by each HTML page. It can be used to @@ -822,7 +822,7 @@ HTML_FOOTER = footer.htm # the style sheet file to the HTML output directory, so don't put your own # stylesheet in the HTML output directory as well, or it will be erased! -HTML_STYLESHEET = doxygen.css +HTML_STYLESHEET = "@DOXYGEN_INPUT_DIR@/doc/doxygen.css" # If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, # files or namespaces will be aligned in HTML using tables. If set to @@ -869,7 +869,7 @@ DOCSET_BUNDLE_ID = org.doxygen.Project # Microsoft HTML help workshop to generate a compiled HTML help file (.chm) # of the generated HTML documentation. -GENERATE_HTMLHELP = YES +GENERATE_HTMLHELP = @DOXYGEN_GENERATE_HTMLHELP@ # If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can # be used to specify the file name of the resulting .chm file. You @@ -883,7 +883,7 @@ CHM_FILE = ../SFML.chm # the HTML help compiler (hhc.exe). If non-empty doxygen will try to run # the HTML help compiler on the generated index.hhp. -HHC_LOCATION = "C:/Program Files/HTML Help Workshop/hhc.exe" +HHC_LOCATION = "@DOXYGEN_HHC_PROGRAM@" # If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag # controls if a separate .chi index file is generated (YES) or that diff --git a/doc/doxygen.css b/doc/doxygen.css new file mode 100644 index 000000000..b4dc5a0ca --- /dev/null +++ b/doc/doxygen.css @@ -0,0 +1,681 @@ +div#logo +{ + margin-bottom : 1em; + background : url("./logo-bg.jpg") repeat-x; +} + +div#logo a +{ + display : block; +} + +p#footer +{ + text-decoration : overline; + color : #606060; + padding-top : 1em; + text-align : center; + font-size : smaller; +} + +p#footer a +{ + color : #007298; + text-decoration : none; +} + +/* The standard CSS for doxygen */ + +body, table, div, p, dl { + font-family: Lucida Grande, Verdana, Geneva, Arial, sans-serif; + font-size: 12px; +} + +/* @group Heading Levels */ + +h1 { + font-size: 150%; +} + +h2 { + font-size: 120%; +} + +h3 { + font-size: 100%; +} + +dt { + font-weight: bold; +} + +div.multicol { + -moz-column-gap: 1em; + -webkit-column-gap: 1em; + -moz-column-count: 3; + -webkit-column-count: 3; +} + +p.startli, p.startdd, p.starttd { + margin-top: 2px; +} + +p.endli { + margin-bottom: 0px; +} + +p.enddd { + margin-bottom: 4px; +} + +p.endtd { + margin-bottom: 2px; +} + +/* @end */ + +caption { + font-weight: bold; +} + +span.legend { + font-size: 70%; + text-align: center; +} + +h3.version { + font-size: 90%; + text-align: center; +} + +div.qindex, div.navtab{ + background-color: #EBEFF6; + border: 1px solid #A3B4D7; + text-align: center; + margin: 2px; + padding: 2px; +} + +div.qindex, div.navpath { + width: 100%; + line-height: 140%; +} + +div.navtab { + margin-right: 15px; +} + +/* @group Link Styling */ + +a { + color: #3D578C; + font-weight: normal; + text-decoration: none; +} + +.contents a:visited { + color: #4665A2; +} + +a:hover { + text-decoration: underline; +} + +a.qindex { + font-weight: bold; +} + +a.qindexHL { + font-weight: bold; + background-color: #9CAFD4; + color: #ffffff; + border: 1px double #869DCA; +} + +.contents a.qindexHL:visited { + color: #ffffff; +} + +a.el { + font-weight: bold; +} + +a.elRef { +} + +a.code { + color: #4665A2; +} + +a.codeRef { + color: #4665A2; +} + +/* @end */ + +dl.el { + margin-left: -1cm; +} + +.fragment { + font-family: monospace, fixed; + font-size: 105%; +} + +pre.fragment { + border: 1px solid #C4CFE5; + background-color: #FBFCFD; + padding: 4px 6px; + margin: 4px 8px 4px 2px; + overflow: auto; + word-wrap: break-word; + font-size: 9pt; + line-height: 125%; +} + +div.ah { + background-color: black; + font-weight: bold; + color: #ffffff; + margin-bottom: 3px; + margin-top: 3px; + padding: 0.2em; + border: solid thin #333; + border-radius: 0.5em; + -webkit-border-radius: .5em; + -moz-border-radius: .5em; + -webkit-box-shadow: 2px 2px 3px #999; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px; + background-image: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#000),color-stop(0.3, #444)); + background-image: -moz-linear-gradient(center top, #eee 0%, #444 40%, #000); +} + +div.groupHeader { + margin-left: 16px; + margin-top: 12px; + margin-bottom: 6px; + font-weight: bold; +} + +div.groupText { + margin-left: 16px; + font-style: italic; +} + +body { + background: white; + color: black; + margin: 0; +} + +div.contents { + margin-top: 10px; + margin-left: 10px; + margin-right: 10px; +} + +td.indexkey { + background-color: #EBEFF6; + font-weight: bold; + border: 1px solid #C4CFE5; + margin: 2px 0px 2px 0; + padding: 2px 10px; +} + +td.indexvalue { + background-color: #EBEFF6; + border: 1px solid #C4CFE5; + padding: 2px 10px; + margin: 2px 0px; +} + +tr.memlist { + background-color: #EEF1F7; +} + +p.formulaDsp { + text-align: center; +} + +img.formulaDsp { + +} + +img.formulaInl { + vertical-align: middle; +} + +div.center { + text-align: center; + margin-top: 0px; + margin-bottom: 0px; + padding: 0px; +} + +div.center img { + border: 0px; +} + +address.footer { + text-align: right; + padding-right: 12px; +} + +img.footer { + border: 0px; + vertical-align: middle; +} + +/* @group Code Colorization */ + +span.keyword { + color: #008000 +} + +span.keywordtype { + color: #604020 +} + +span.keywordflow { + color: #e08000 +} + +span.comment { + color: #800000 +} + +span.preprocessor { + color: #806020 +} + +span.stringliteral { + color: #002080 +} + +span.charliteral { + color: #008080 +} + +span.vhdldigit { + color: #ff00ff +} + +span.vhdlchar { + color: #000000 +} + +span.vhdlkeyword { + color: #700070 +} + +span.vhdllogic { + color: #ff0000 +} + +/* @end */ + +/* +.search { + color: #003399; + font-weight: bold; +} + +form.search { + margin-bottom: 0px; + margin-top: 0px; +} + +input.search { + font-size: 75%; + color: #000080; + font-weight: normal; + background-color: #e8eef2; +} +*/ + +td.tiny { + font-size: 75%; +} + +.dirtab { + padding: 4px; + border-collapse: collapse; + border: 1px solid #A3B4D7; +} + +th.dirtab { + background: #EBEFF6; + font-weight: bold; +} + +hr { + height: 0px; + border: none; + border-top: 1px solid #4A6AAA; +} + +hr.footer { + height: 1px; +} + +/* @group Member Descriptions */ + +table.memberdecls { + border-spacing: 0px; + padding: 0px; +} + +.mdescLeft, .mdescRight, +.memItemLeft, .memItemRight, +.memTemplItemLeft, .memTemplItemRight, .memTemplParams { + background-color: #F9FAFC; + border: none; + margin: 4px; + padding: 1px 0 0 8px; +} + +.mdescLeft, .mdescRight { + padding: 0px 8px 4px 8px; + color: #555; +} + +.memItemLeft, .memItemRight, .memTemplParams { + border-top: 1px solid #C4CFE5; +} + +.memItemLeft, .memTemplItemLeft { + white-space: nowrap; +} + +.memTemplParams { + color: #4665A2; + white-space: nowrap; +} + +/* @end */ + +/* @group Member Details */ + +/* Styles for detailed member documentation */ + +.memtemplate { + font-size: 80%; + color: #4665A2; + font-weight: normal; + margin-left: 3px; +} + +.memnav { + background-color: #EBEFF6; + border: 1px solid #A3B4D7; + text-align: center; + margin: 2px; + margin-right: 15px; + padding: 2px; +} + +.memitem { + padding: 0; + margin-bottom: 10px; +} + +.memname { + white-space: nowrap; + font-weight: bold; + margin-left: 6px; +} + +.memproto { + border-top: 1px solid #A8B8D9; + border-left: 1px solid #A8B8D9; + border-right: 1px solid #A8B8D9; + padding: 6px 0px 6px 0px; + color: #253555; + font-weight: bold; + text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); + /* firefox specific markup */ + -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; + -moz-border-radius-topright: 8px; + -moz-border-radius-topleft: 8px; + /* webkit specific markup */ + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + -webkit-border-top-right-radius: 8px; + -webkit-border-top-left-radius: 8px; + background-image:url('nav_f.png'); + background-repeat:repeat-x; + background-color: #E2E8F2; + +} + +.memdoc { + border-bottom: 1px solid #A8B8D9; + border-left: 1px solid #A8B8D9; + border-right: 1px solid #A8B8D9; + padding: 2px 5px; + background-color: #FBFCFD; + border-top-width: 0; + /* firefox specific markup */ + -moz-border-radius-bottomleft: 8px; + -moz-border-radius-bottomright: 8px; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; + background-image: -moz-linear-gradient(center top, #FFFFFF 0%, #FFFFFF 60%, #F7F8FB 95%, #EEF1F7); + /* webkit specific markup */ + -webkit-border-bottom-left-radius: 8px; + -webkit-border-bottom-right-radius: 8px; + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + background-image: -webkit-gradient(linear,center top,center bottom,from(#FFFFFF), color-stop(0.6,#FFFFFF), color-stop(0.60,#FFFFFF), color-stop(0.95,#F7F8FB), to(#EEF1F7)); +} + +.paramkey { + text-align: right; +} + +.paramtype { + white-space: nowrap; +} + +.paramname { + color: #602020; + white-space: nowrap; +} +.paramname em { + font-style: normal; +} + +/* @end */ + +/* @group Directory (tree) */ + +/* for the tree view */ + +.ftvtree { + font-family: sans-serif; + margin: 0px; +} + +/* these are for tree view when used as main index */ + +.directory { + font-size: 9pt; + font-weight: bold; + margin: 5px; +} + +.directory h3 { + margin: 0px; + margin-top: 1em; + font-size: 11pt; +} + +/* +The following two styles can be used to replace the root node title +with an image of your choice. Simply uncomment the next two styles, +specify the name of your image and be sure to set 'height' to the +proper pixel height of your image. +*/ + +/* +.directory h3.swap { + height: 61px; + background-repeat: no-repeat; + background-image: url("yourimage.gif"); +} +.directory h3.swap span { + display: none; +} +*/ + +.directory > h3 { + margin-top: 0; +} + +.directory p { + margin: 0px; + white-space: nowrap; +} + +.directory div { + display: none; + margin: 0px; +} + +.directory img { + vertical-align: -30%; +} + +/* these are for tree view when not used as main index */ + +.directory-alt { + font-size: 100%; + font-weight: bold; +} + +.directory-alt h3 { + margin: 0px; + margin-top: 1em; + font-size: 11pt; +} + +.directory-alt > h3 { + margin-top: 0; +} + +.directory-alt p { + margin: 0px; + white-space: nowrap; +} + +.directory-alt div { + display: none; + margin: 0px; +} + +.directory-alt img { + vertical-align: -30%; +} + +/* @end */ + +div.dynheader { + margin-top: 8px; +} + +address { + font-style: normal; + color: #2A3D61; +} + +table.doxtable { + border-collapse:collapse; +} + +table.doxtable td, table.doxtable th { + border: 1px solid #2D4068; + padding: 3px 7px 2px; +} + +table.doxtable th { + background-color: #374F7F; + color: #FFFFFF; + font-size: 110%; + padding-bottom: 4px; + padding-top: 5px; + text-align:left; +} + +.tabsearch { + top: 0px; + left: 10px; + height: 36px; + background-image: url('tab_b.png'); + z-index: 101; + overflow: hidden; + font-size: 13px; +} + +.navpath ul +{ + font-size: 11px; + background-image:url('tab_b.png'); + background-repeat:repeat-x; + height:30px; + line-height:30px; + color:#8AA0CC; + border:solid 1px #C2CDE4; + overflow:hidden; + margin:0px; + padding:0px; +} + +.navpath li +{ + list-style-type:none; + float:left; + padding-left:10px; + padding-right: 15px; + background-image:url('bc_s.png'); + background-repeat:no-repeat; + background-position:right; + color:#364D7C; +} + +.navpath a +{ + height:32px; + display:block; + text-decoration: none; + outline: none; +} + +.navpath a:hover +{ + color:#6884BD; +} + +div.summary +{ + float: right; + font-size: 8pt; + padding-right: 5px; + width: 50%; + text-align: right; +} + +div.summary a +{ + white-space: nowrap; +} + +div.header +{ + background-image:url('nav_h.png'); + background-repeat:repeat-x; + background-color: #F9FAFC; + margin: 0px; + border-bottom: 1px solid #C4CFE5; +} + +div.headertitle +{ + padding: 5px 5px 5px 10px; +} diff --git a/doc/build/footer.htm b/doc/footer.htm similarity index 100% rename from doc/build/footer.htm rename to doc/footer.htm diff --git a/doc/build/header.htm b/doc/header.htm similarity index 100% rename from doc/build/header.htm rename to doc/header.htm diff --git a/doc/html/logo-bg.jpg b/doc/logo-bg.jpg similarity index 100% rename from doc/html/logo-bg.jpg rename to doc/logo-bg.jpg diff --git a/doc/html/logo.jpg b/doc/logo.jpg similarity index 100% rename from doc/html/logo.jpg rename to doc/logo.jpg diff --git a/doc/build/Doxygen.hpp b/doc/mainpage.hpp similarity index 100% rename from doc/build/Doxygen.hpp rename to doc/mainpage.hpp diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt new file mode 100644 index 000000000..4ab339097 --- /dev/null +++ b/examples/CMakeLists.txt @@ -0,0 +1,16 @@ + +# add the examples subdirectories +add_subdirectory(ftp) +add_subdirectory(opengl) +add_subdirectory(pong) +add_subdirectory(shader) +add_subdirectory(sockets) +add_subdirectory(sound) +add_subdirectory(sound_capture) +add_subdirectory(voip) +add_subdirectory(window) +if(WINDOWS) + add_subdirectory(win32) +elseif(LINUX) + add_subdirectory(X11) +endif() diff --git a/examples/X11/CMakeLists.txt b/examples/X11/CMakeLists.txt new file mode 100644 index 000000000..ace8634ff --- /dev/null +++ b/examples/X11/CMakeLists.txt @@ -0,0 +1,14 @@ + +set(SRCROOT ${CMAKE_SOURCE_DIR}/examples/X11) + +# all source files +set(SRC ${SRCROOT}/X11.cpp) + +# find OpenGL, GLU and X11 +find_package(OpenGL REQUIRED) +find_package(X11 REQUIRED) + +# define the X11 target +sfml_add_example(X11 GUI_APP + SOURCES ${SRC} + DEPENDS sfml-window sfml-system ${OPENGL_LIBRARIES} ${X11_LIBRARIES}) diff --git a/samples/X11/X11.cpp b/examples/X11/X11.cpp similarity index 100% rename from samples/X11/X11.cpp rename to examples/X11/X11.cpp diff --git a/samples/build/codeblocks/ftp.cbp b/examples/build/codeblocks/ftp.cbp similarity index 92% rename from samples/build/codeblocks/ftp.cbp rename to examples/build/codeblocks/ftp.cbp index bebdc991b..71e1440c3 100644 --- a/samples/build/codeblocks/ftp.cbp +++ b/examples/build/codeblocks/ftp.cbp @@ -7,7 +7,7 @@ - - -