Minor modifications to CMake files

git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1753 4e206d99-4929-0410-ac5d-dfc041789085
This commit is contained in:
LaurentGom 2010-12-10 20:44:20 +00:00
parent a1eade38f4
commit 7696438a4a
2 changed files with 17 additions and 31 deletions

View File

@ -2,7 +2,7 @@
# include the SFML specific macros # include the SFML specific macros
include(${CMAKE_SOURCE_DIR}/cmake/Macros.cmake) 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) if (WINDOWS)
set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "${CMAKE_SOURCE_DIR}/extlibs/headers") set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "${CMAKE_SOURCE_DIR}/extlibs/headers")
if(COMPILER_GCC) if(COMPILER_GCC)
@ -10,6 +10,8 @@ if (WINDOWS)
elseif(COMPILER_MSVC) elseif(COMPILER_MSVC)
set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "${CMAKE_SOURCE_DIR}/extlibs/libs-msvc") set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "${CMAKE_SOURCE_DIR}/extlibs/libs-msvc")
endif() endif()
elseif(MACOSX)
set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "${CMAKE_SOURCE_DIR}/extlibs/libs-osx/lib/")
endif() endif()
# add the SFML sources path # add the SFML sources path

View File

@ -72,27 +72,9 @@ elseif(MACOSX)
endif() endif()
# let CMake know about our additional graphics libraries paths (on Windows and OSX) # 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/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") 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/")
endif() endif()
# find external libraries # find external libraries
@ -103,6 +85,9 @@ find_package(JPEG REQUIRED)
if(LINUX) if(LINUX)
find_package(X11 REQUIRED) find_package(X11 REQUIRED)
endif() endif()
if(MACOSX)
find_package(ZLIB REQUIRED)
endif()
# add include paths of external libraries # add include paths of external libraries
include_directories(${FREETYPE_INCLUDE_DIRS} ${GLEW_INCLUDE_PATH} ${JPEG_INCLUDE_DIR}) 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}) set(GRAPHICS_EXT_LIBS ${GRAPHICS_EXT_LIBS} ${OPENGL_gl_LIBRARY})
if(LINUX) if(LINUX)
set(GRAPHICS_EXT_LIBS ${GRAPHICS_EXT_LIBS} ${X11_LIBRARIES}) set(GRAPHICS_EXT_LIBS ${GRAPHICS_EXT_LIBS} ${X11_LIBRARIES})
endif() elseif(MACOSX)
if(MACOSX)
# We use static version of freetype so we need to link against zlib. # We use static version of freetype so we need to link against zlib.
set(GRAPHICS_EXT_LIBS ${GRAPHICS_EXT_LIBS} z "-framework AGL") set(GRAPHICS_EXT_LIBS ${GRAPHICS_EXT_LIBS} ${ZLIB_LIBRARIES} "-framework AGL")
endif() endif()
endif() endif()