Fixed mingw compilation

This commit is contained in:
deve 2015-01-19 10:52:11 +01:00
parent a0fc3c98e8
commit b2f918455b

View File

@ -51,6 +51,14 @@ set(STK_INSTALL_BINARY_DIR "bin" CACHE
set(STK_INSTALL_DATA_DIR "share/supertuxkart" CACHE set(STK_INSTALL_DATA_DIR "share/supertuxkart" CACHE
STRING "Install data folder to this directory, absolute or relative to CMAKE_INSTALL_PREFIX") STRING "Install data folder to this directory, absolute or relative to CMAKE_INSTALL_PREFIX")
# These variables enable MSVC to find libraries located in "dependencies"
if(WIN32)
set(ENV{PATH} "$ENV{PATH};${PROJECT_SOURCE_DIR}/dependencies/include")
set(ENV{LIB} ${PROJECT_SOURCE_DIR}/dependencies/lib)
set(ENV{OPENALDIR} ${PROJECT_SOURCE_DIR}/dependencies)
add_definitions(-D_IRR_STATIC_LIB_)
endif()
# Build the Bullet physics library # Build the Bullet physics library
add_subdirectory("${PROJECT_SOURCE_DIR}/lib/bullet") add_subdirectory("${PROJECT_SOURCE_DIR}/lib/bullet")
include_directories("${PROJECT_SOURCE_DIR}/lib/bullet/src") include_directories("${PROJECT_SOURCE_DIR}/lib/bullet/src")
@ -63,30 +71,30 @@ include_directories("${PROJECT_SOURCE_DIR}/lib/enet/include")
add_subdirectory("${PROJECT_SOURCE_DIR}/lib/glew") add_subdirectory("${PROJECT_SOURCE_DIR}/lib/glew")
include_directories("${PROJECT_SOURCE_DIR}/lib/glew/include") include_directories("${PROJECT_SOURCE_DIR}/lib/glew/include")
if(WIN32) if(WIN32 AND NOT MINGW)
# Build zlib library # Build zlib library
add_subdirectory("${PROJECT_SOURCE_DIR}/lib/zlib") add_subdirectory("${PROJECT_SOURCE_DIR}/lib/zlib")
include_directories("${PROJECT_SOURCE_DIR}/lib/zlib") include_directories("${PROJECT_SOURCE_DIR}/lib/zlib")
set(ZLIB_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/lib/zlib" "${PROJECT_BINARY_DIR}/lib/zlib/") set(ZLIB_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/lib/zlib" "${PROJECT_BINARY_DIR}/lib/zlib/")
set(ZLIB_LIBRARY zlibstatic) set(ZLIB_LIBRARY zlibstatic)
# Build png library # Build png library
set (SKIP_INSTALL_ALL TRUE) set (SKIP_INSTALL_ALL TRUE)
set (PNG_STATIC TRUE) set (PNG_STATIC TRUE)
set (PNG_TESTS FALSE) set (PNG_TESTS FALSE)
set (PNG_SHARED FALSE) set (PNG_SHARED FALSE)
add_subdirectory("${PROJECT_SOURCE_DIR}/lib/libpng") add_subdirectory("${PROJECT_SOURCE_DIR}/lib/libpng")
include_directories("${PROJECT_SOURCE_DIR}/lib/libpng") include_directories("${PROJECT_SOURCE_DIR}/lib/libpng")
#build jpeg library #build jpeg library
add_subdirectory("${PROJECT_SOURCE_DIR}/lib/jpeglib") add_subdirectory("${PROJECT_SOURCE_DIR}/lib/jpeglib")
include_directories("${PROJECT_SOURCE_DIR}/lib/jpeglib") include_directories("${PROJECT_SOURCE_DIR}/lib/jpeglib")
set(PNG_PNG_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/lib/libpng/") set(PNG_PNG_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/lib/libpng/")
set(PNG_LIBRARY png15_static) set(PNG_LIBRARY png15_static)
set(JPEG_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/lib/jpeglib/") set(JPEG_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/lib/jpeglib/")
set(JPEG_LIBRARY jpeglib) set(JPEG_LIBRARY jpeglib)
endif() endif()
# Build the irrlicht library # Build the irrlicht library
add_subdirectory("${PROJECT_SOURCE_DIR}/lib/irrlicht") add_subdirectory("${PROJECT_SOURCE_DIR}/lib/irrlicht")
@ -106,15 +114,6 @@ endif()
# Set include paths # Set include paths
include_directories(${STK_SOURCE_DIR}) include_directories(${STK_SOURCE_DIR})
# These variables enable MSVC to find libraries located in "dependencies"
if(WIN32)
set(ENV{PATH} "$ENV{PATH};${PROJECT_SOURCE_DIR}/dependencies/include")
set(ENV{LIB} ${PROJECT_SOURCE_DIR}/dependencies/lib)
set(ENV{OPENALDIR} ${PROJECT_SOURCE_DIR}/dependencies)
add_definitions(-D_IRR_STATIC_LIB_)
endif()
if(APPLE) if(APPLE)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -arch i386") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -arch i386")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -arch i386 -F/Library/Frameworks") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -arch i386 -F/Library/Frameworks")