From 7696438a4a8f78b728f99f3e1305d0bc59133e43 Mon Sep 17 00:00:00 2001 From: LaurentGom Date: Fri, 10 Dec 2010 20:44:20 +0000 Subject: [PATCH] Minor modifications to CMake files git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1753 4e206d99-4929-0410-ac5d-dfc041789085 --- src/SFML/CMakeLists.txt | 4 ++- src/SFML/Graphics/CMakeLists.txt | 44 ++++++++++---------------------- 2 files changed, 17 insertions(+), 31 deletions(-) diff --git a/src/SFML/CMakeLists.txt b/src/SFML/CMakeLists.txt index 44a68155..0f8a84d3 100644 --- a/src/SFML/CMakeLists.txt +++ b/src/SFML/CMakeLists.txt @@ -2,7 +2,7 @@ # include the SFML specific macros include(${CMAKE_SOURCE_DIR}/cmake/Macros.cmake) -# let CMake know about our additional libraries paths (on Windows) +# let CMake know about our additional libraries paths (on Windows and OS X) if (WINDOWS) set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "${CMAKE_SOURCE_DIR}/extlibs/headers") if(COMPILER_GCC) @@ -10,6 +10,8 @@ if (WINDOWS) elseif(COMPILER_MSVC) set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "${CMAKE_SOURCE_DIR}/extlibs/libs-msvc") endif() +elseif(MACOSX) + set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "${CMAKE_SOURCE_DIR}/extlibs/libs-osx/lib/") endif() # add the SFML sources path diff --git a/src/SFML/Graphics/CMakeLists.txt b/src/SFML/Graphics/CMakeLists.txt index 96f55e69..f8a6c538 100644 --- a/src/SFML/Graphics/CMakeLists.txt +++ b/src/SFML/Graphics/CMakeLists.txt @@ -62,37 +62,19 @@ elseif(LINUX) ${SRC} ${SRCROOT}/Linux/RenderImageImplPBuffer.cpp ${SRCROOT}/Linux/RenderImageImplPBuffer.hpp - ) -elseif(MACOSX) - set(SRC - ${SRC} - ${SRCROOT}/OSX/RenderImageImplPBuffer.cpp - ${SRCROOT}/OSX/RenderImageImplPBuffer.hpp + ) +elseif(MACOSX) + set(SRC + ${SRC} + ${SRCROOT}/OSX/RenderImageImplPBuffer.cpp + ${SRCROOT}/OSX/RenderImageImplPBuffer.hpp ) endif() # let CMake know about our additional graphics libraries paths (on Windows and OSX) -if (WINDOWS) +if (WINDOWS OR MACOSX) set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "${CMAKE_SOURCE_DIR}/extlibs/headers/freetype") - set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "${CMAKE_SOURCE_DIR}/extlibs/headers/GL") - set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "${CMAKE_SOURCE_DIR}/extlibs/headers/jpeg") - -elseif (MACOSX) - - # Add freetype search path - #set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "${CMAKE_SOURCE_DIR}/extlibs/libs-osx/include/") - set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "${CMAKE_SOURCE_DIR}/extlibs/headers/freetype") - set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "${CMAKE_SOURCE_DIR}/extlibs/libs-osx/lib/") - - # Add GLEW search path - #set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "${CMAKE_SOURCE_DIR}/extlibs/libs-osx/include/") - set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "${CMAKE_SOURCE_DIR}/extlibs/headers/") - set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "${CMAKE_SOURCE_DIR}/extlibs/libs-osx/lib/") - - # Add jpeg search path - #set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "${CMAKE_SOURCE_DIR}/extlibs/libs-osx/include/jpeg") - set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "${CMAKE_SOURCE_DIR}/extlibs/headers/jpeg") - set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "${CMAKE_SOURCE_DIR}/extlibs/libs-osx/lib/") + set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "${CMAKE_SOURCE_DIR}/extlibs/headers/jpeg") endif() # find external libraries @@ -103,6 +85,9 @@ find_package(JPEG REQUIRED) if(LINUX) find_package(X11 REQUIRED) endif() +if(MACOSX) + find_package(ZLIB REQUIRED) +endif() # add include paths of external libraries include_directories(${FREETYPE_INCLUDE_DIRS} ${GLEW_INCLUDE_PATH} ${JPEG_INCLUDE_DIR}) @@ -114,10 +99,9 @@ if(BUILD_SHARED_LIBS) set(GRAPHICS_EXT_LIBS ${GRAPHICS_EXT_LIBS} ${OPENGL_gl_LIBRARY}) if(LINUX) set(GRAPHICS_EXT_LIBS ${GRAPHICS_EXT_LIBS} ${X11_LIBRARIES}) - endif() - if(MACOSX) - # We use static version of freetype so we need to link against zlib. - set(GRAPHICS_EXT_LIBS ${GRAPHICS_EXT_LIBS} z "-framework AGL") + elseif(MACOSX) + # We use static version of freetype so we need to link against zlib. + set(GRAPHICS_EXT_LIBS ${GRAPHICS_EXT_LIBS} ${ZLIB_LIBRARIES} "-framework AGL") endif() endif()