- few tweaks to get things compiling under mingw

This commit is contained in:
Mark Vejvoda
2011-12-25 03:09:39 +00:00
parent 7d0cf06fe1
commit 835c886705
13 changed files with 324 additions and 268 deletions

View File

@@ -5,7 +5,8 @@
#
# FTGL_FOUND - system has ftgl
# FTGL_INCLUDE_DIR - path to FTGL/FTGL.h
# FTGL_LIBRARY - the library that must be included
# FTGL_LIBRARY - the library that must be included
# FTGL_LIBRARY_PATH - the library path
#
#
@@ -14,17 +15,34 @@ IF(WANT_STATIC_LIBS)
OPTION(FTGL_STATIC "Set to ON to link your project with static library (instead of DLL)." ON)
ENDIF()
#message(STATUS "!!!!!!!!!!!!!!!!!!!!!!!!!!!!! #1 Searching for FTGL lib in custom path: [${FTGL_LIBRARY_PATH}]")
IF (FTGL_LIBRARY AND FTGL_INCLUDE_DIR)
SET(FTGL_FOUND "YES")
message(STATUS "!!!!!!!!!!!!!!!!!!!!!!!!!!!!! FTGL lib ALREADY FOUND in: [${FTGL_LIBRARY}]")
ELSE (FTGL_LIBRARY AND FTGL_INCLUDE_DIR)
FIND_PATH(FTGL_INCLUDE_DIR FTGL/ftgl.h PATHS /usr/local/include /usr/include)
IF(FTGL_LIBRARY_PATH)
message(STATUS "!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Searching for FTGL lib in custom path: [${FTGL_LIBRARY_PATH}]")
ENDIF()
IF (FTGL_STATIC AND NOT FTGL_LIBRARY)
FIND_LIBRARY(FTGL_LIBRARY NAMES libftgl.a ftgl PATHS /usr/local/lib /usr/lib)
ELSE()
FIND_LIBRARY(FTGL_LIBRARY NAMES ftgl PATHS /usr/local/lib /usr/lib)
ENDIF()
FIND_PATH(FTGL_INCLUDE_DIR FTGL/ftgl.h
PATHS /usr/local/include
/usr/include)
IF (FTGL_STATIC AND NOT FTGL_LIBRARY)
FIND_LIBRARY(FTGL_LIBRARY
NAMES libftgl.a ftgl libftgl libftgl.dll
PATHS /usr/local/lib
/usr/lib
${FTGL_LIBRARY_PATH})
ELSE()
FIND_LIBRARY(FTGL_LIBRARY
NAMES ftgl libftgl libftgl.dll libftgl.a
PATHS /usr/local/lib
/usr/lib
${FTGL_LIBRARY_PATH})
ENDIF()
IF (FTGL_INCLUDE_DIR AND FTGL_LIBRARY)
SET(FTGL_FOUND "YES")

View File

@@ -18,6 +18,8 @@ macro(special_check_for_sse _max_sse_level_desired)
# check for SSE extensions
include(CheckCXXSourceRuns)
include(CheckCSourceRuns)
if( CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX )
set(SSE_FLAGS)
@@ -107,6 +109,8 @@ endmacro(special_check_for_sse)
macro(special_check_for_x87)
# check for X87 support
include(CheckCXXSourceRuns)
include(CheckCSourceRuns)
if( CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX )
check_cxx_source_runs("

View File

@@ -2,12 +2,23 @@
SET(CMAKE_SYSTEM_NAME Windows)
# which compilers to use for C and C++
SET(CMAKE_C_COMPILER i586-mingw32msvc-gcc)
SET(CMAKE_CXX_COMPILER i586-mingw32msvc-g++)
SET(CMAKE_RC_COMPILER i586-mingw32msvc-windres)
#SET(CMAKE_C_COMPILER i586-mingw32msvc-gcc)
#SET(CMAKE_CXX_COMPILER i586-mingw32msvc-g++)
#SET(CMAKE_RC_COMPILER i586-mingw32msvc-windres)
SET(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc)
SET(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++)
SET(CMAKE_RC_COMPILER x86_64-w64-mingw32-windres)
# here is the target environment located
SET(CMAKE_FIND_ROOT_PATH /usr/i586-mingw32msvc ${PROJECT_SOURCE_DIR}/source/win32_deps/lib)
#SET(CMAKE_FIND_ROOT_PATH /usr/i586-mingw32msvc ${PROJECT_SOURCE_DIR}/source/win32_deps/lib)
SET(CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32 ${PROJECT_SOURCE_DIR}/source/win32_deps/lib)
include_directories(${PROJECT_SOURCE_DIR}/source/win32_deps/freetype-2.4.8/include)
include_directories(${PROJECT_SOURCE_DIR}/source/win32_deps/glew-1.7.0/include)
include_directories(${PROJECT_SOURCE_DIR}/source/win32_deps/ftgl-2.1.3~rc5/src)
#add_definitions(-std=c++0x)
add_definitions( -std=gnu++0x )
add_definitions( -DTA3D_PLATFORM_MSVC=1 )
add_definitions( -DTA3D_PLATFORM_WINDOWS=1 )
# adjust the default behaviour of the FIND_XXX() commands:
# search headers and libraries in the target environment, search