Changed: Updated CMake modules for 64bits and STLport

This commit is contained in:
kervala 2010-09-25 15:41:37 +02:00
parent 9be9822b15
commit b301f0d03d
6 changed files with 101 additions and 66 deletions

View file

@ -40,14 +40,6 @@ INCLUDE(${CMAKE_ROOT}/Modules/Documentation.cmake OPTIONAL)
# Force out of source builds. # Force out of source builds.
CHECK_OUT_OF_SOURCE() CHECK_OUT_OF_SOURCE()
IF(WIN32)
FIND_PACKAGE(External REQUIRED)
IF(NOT DEFINED ENV{QTDIR})
SET(ENV{QTDIR} "c:/qt/4.5.0")
ENDIF(NOT DEFINED ENV{QTDIR})
ENDIF(WIN32)
CMAKE_MINIMUM_REQUIRED(VERSION 2.6) CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(RyzomCore CXX C) PROJECT(RyzomCore CXX C)
SET(NL_VERSION_MAJOR 0) SET(NL_VERSION_MAJOR 0)
@ -60,6 +52,14 @@ SET(NL_VERSION "${NL_VERSION_MAJOR}.${NL_VERSION_MINOR}.${NL_VERSION_PATCH}")
SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin) SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)
SET(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib) SET(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib)
IF(WIN32)
FIND_PACKAGE(External REQUIRED)
IF(NOT DEFINED ENV{QTDIR})
SET(ENV{QTDIR} "c:/qt/4.5.0")
ENDIF(NOT DEFINED ENV{QTDIR})
ENDIF(WIN32)
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# Set default config options # Set default config options
# #

View file

@ -24,6 +24,10 @@ IF(EXTERNAL_PATH)
SET(EXTERNAL_FOUND TRUE) SET(EXTERNAL_FOUND TRUE)
SET(EXTERNAL_INCLUDE_PATH "${EXTERNAL_PATH}/include") SET(EXTERNAL_INCLUDE_PATH "${EXTERNAL_PATH}/include")
IF(NOT CMAKE_SIZEOF_VOID_P)
MESSAGE(FATAL_ERROR "Size of void* is not set, you should call PROJECT(...) before")
ENDIF(NOT CMAKE_SIZEOF_VOID_P)
# Using 32 or 64 bits libraries # Using 32 or 64 bits libraries
IF(CMAKE_SIZEOF_VOID_P EQUAL 8) IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
SET(EXTERNAL_LIBRARY_PATH "${EXTERNAL_PATH}/lib64") SET(EXTERNAL_LIBRARY_PATH "${EXTERNAL_PATH}/lib64")
@ -46,3 +50,5 @@ ELSE(EXTERNAL_FOUND)
MESSAGE(STATUS "Warning: Unable to find external!") MESSAGE(STATUS "Warning: Unable to find external!")
ENDIF(NOT EXTERNAL_FIND_QUIETLY) ENDIF(NOT EXTERNAL_FIND_QUIETLY)
ENDIF(EXTERNAL_FOUND) ENDIF(EXTERNAL_FOUND)
MARK_AS_ADVANCED(EXTERNAL_INCLUDE_PATH EXTERNAL_LIBRARY_PATH)

View file

@ -91,7 +91,7 @@ FIND_WWW_LIBRARY(LIBWWWZIP_LIBRARY wwwzip)
FIND_WWW_LIBRARY(LIBMD5_LIBRARY md5) FIND_WWW_LIBRARY(LIBMD5_LIBRARY md5)
# Windows libwww version needs GNU Regex # Windows libwww version needs GNU Regex
IF(WIN32) IF(WIN32 AND WITH_STATIC)
FIND_PATH(LIBWWW_REGEX_INCLUDE_DIR FIND_PATH(LIBWWW_REGEX_INCLUDE_DIR
regex.h regex.h
PATHS PATHS
@ -108,19 +108,26 @@ IF(WIN32)
SET(LIBWWW_INCLUDE_DIR ${LIBWWW_INCLUDE_DIR} ${LIBWWW_REGEX_INCLUDE_DIR}) SET(LIBWWW_INCLUDE_DIR ${LIBWWW_INCLUDE_DIR} ${LIBWWW_REGEX_INCLUDE_DIR})
FIND_WWW_LIBRARY(LIBREGEX_LIBRARY gnu_regex) FIND_WWW_LIBRARY(LIBREGEX_LIBRARY gnu_regex)
ENDIF(LIBWWW_REGEX_INCLUDE_DIR) ENDIF(LIBWWW_REGEX_INCLUDE_DIR)
ELSE(WIN32) ENDIF(WIN32 AND WITH_STATIC)
FIND_PACKAGE(EXPAT)
SET(LIBWWW_INCLUDE_DIR ${LIBWWW_INCLUDE_DIR} ${EXPAT_INCLUDE_DIRS})
SET(LIBWWW_LIBRARIES ${LIBWWW_LIBRARIES} ${EXPAT_LIBRARIES})
ENDIF(WIN32)
IF(LIBWWW_LIBRARIES AND LIBWWW_INCLUDE_DIR) IF(WITH_STATIC)
SET(LIBWWW_FOUND "YES") # If compiled with expat support
IF(NOT LIBWWW_FIND_QUIETLY) FIND_PACKAGE(EXPAT QUIET)
MESSAGE(STATUS "Found LibWWW: ${LIBWWW_LIBRARIES}") IF(EXPAT_FOUND)
ENDIF(NOT LIBWWW_FIND_QUIETLY) SET(LIBWWW_INCLUDE_DIR ${LIBWWW_INCLUDE_DIR} ${EXPAT_INCLUDE_DIRS})
ELSE(LIBWWW_LIBRARIES AND LIBWWW_INCLUDE_DIR) SET(LIBWWW_LIBRARIES ${LIBWWW_LIBRARIES} ${EXPAT_LIBRARIES})
IF(NOT LIBWWW_FIND_QUIETLY) ENDIF(EXPAT_FOUND)
MESSAGE(STATUS "Warning: Unable to find LibWWW!")
ENDIF(NOT LIBWWW_FIND_QUIETLY) # If compiled with OpenSSL support
ENDIF(LIBWWW_LIBRARIES AND LIBWWW_INCLUDE_DIR) FIND_PACKAGE(OpenSSL QUIET)
IF(OPENSSL_FOUND)
SET(LIBWWW_INCLUDE_DIR ${LIBWWW_INCLUDE_DIR} ${OPENSSL_INCLUDE_DIR})
SET(LIBWWW_LIBRARIES ${LIBWWW_LIBRARIES} ${OPENSSL_LIBRARIES})
ENDIF(OPENSSL_FOUND)
ENDIF(WITH_STATIC)
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibWWW DEFAULT_MSG
LIBWWW_LIBRARIES
LIBWWW_INCLUDE_DIR
)

View file

@ -4,17 +4,13 @@
# LUABIND_FOUND, if false, do not try to link to LUABIND # LUABIND_FOUND, if false, do not try to link to LUABIND
# LUABIND_INCLUDE_DIR, where to find headers. # LUABIND_INCLUDE_DIR, where to find headers.
IF(LUABIND_LIBRARIES AND LUABIND_INCLUDE_DIR) IF(LUABIND_LIBRARIES AND LUABIND_INCLUDE_DIR)
# in cache already # in cache already
SET(LUABIND_FIND_QUIETLY TRUE) SET(LUABIND_FIND_QUIETLY TRUE)
ENDIF(LUABIND_LIBRARIES AND LUABIND_INCLUDE_DIR) ENDIF(LUABIND_LIBRARIES AND LUABIND_INCLUDE_DIR)
FIND_PATH(LUABIND_INCLUDE_DIR FIND_PATH(LUABIND_INCLUDE_DIR
luabind.hpp luabind/luabind.hpp
PATHS PATHS
$ENV{LUABIND_DIR}/include $ENV{LUABIND_DIR}/include
/usr/local/include /usr/local/include
@ -23,45 +19,75 @@ FIND_PATH(LUABIND_INCLUDE_DIR
/opt/local/include /opt/local/include
/opt/csw/include /opt/csw/include
/opt/include /opt/include
PATH_SUFFIXES luabind
) )
IF(WITH_STLPORT)
FIND_LIBRARY(LUABIND_LIBRARY_RELEASE
NAMES libluabind_stlport luabind libluabind
PATHS
$ENV{LUABIND_DIR}/lib
/usr/local/lib
/usr/lib
/usr/local/X11R6/lib
/usr/X11R6/lib
/sw/lib
/opt/local/lib
/opt/csw/lib
/opt/lib
/usr/freeware/lib64
)
FIND_LIBRARY(LUABIND_LIBRARY_RELEASE FIND_LIBRARY(LUABIND_LIBRARY_DEBUG
NAMES luabind libluabind NAMES libluabind_stlportd luabind_d libluabind_d libluabindd
PATHS PATHS
$ENV{LUABIND_DIR}/lib $ENV{LUABIND_DIR}/lib
/usr/local/lib /usr/local/lib
/usr/lib /usr/lib
/usr/local/X11R6/lib /usr/local/X11R6/lib
/usr/X11R6/lib /usr/X11R6/lib
/sw/lib /sw/lib
/opt/local/lib /opt/local/lib
/opt/csw/lib /opt/csw/lib
/opt/lib /opt/lib
/usr/freeware/lib64 /usr/freeware/lib64
) )
ELSE(WITH_STLPORT)
FIND_LIBRARY(LUABIND_LIBRARY_RELEASE
NAMES luabind libluabind
PATHS
$ENV{LUABIND_DIR}/lib
/usr/local/lib
/usr/lib
/usr/local/X11R6/lib
/usr/X11R6/lib
/sw/lib
/opt/local/lib
/opt/csw/lib
/opt/lib
/usr/freeware/lib64
)
FIND_LIBRARY(LUABIND_LIBRARY_DEBUG FIND_LIBRARY(LUABIND_LIBRARY_DEBUG
NAMES luabind_d libluabind_d libluabindd NAMES luabind_d libluabind_d libluabindd
PATHS PATHS
$ENV{LUABIND_DIR}/lib $ENV{LUABIND_DIR}/lib
/usr/local/lib /usr/local/lib
/usr/lib /usr/lib
/usr/local/X11R6/lib /usr/local/X11R6/lib
/usr/X11R6/lib /usr/X11R6/lib
/sw/lib /sw/lib
/opt/local/lib /opt/local/lib
/opt/csw/lib /opt/csw/lib
/opt/lib /opt/lib
/usr/freeware/lib64 /usr/freeware/lib64
) )
ENDIF(WITH_STLPORT)
IF(LUABIND_INCLUDE_DIR) IF(LUABIND_INCLUDE_DIR)
IF(LUABIND_LIBRARY_RELEASE) IF(LUABIND_LIBRARY_RELEASE)
SET(LUABIND_FOUND "YES") SET(LUABIND_FOUND TRUE)
SET(LUABIND_LIBRARIES "optimized;${LUABIND_LIBRARY_RELEASE}") SET(LUABIND_LIBRARIES "optimized;${LUABIND_LIBRARY_RELEASE}")
IF(LUABIND_LIBRARY_DEBUG) IF(LUABIND_LIBRARY_DEBUG)
SET(LUABIND_LIBRARIES "${LUABIND_LIBRARIES};debug;${LUABIND_LIBRARY_DEBUG}") SET(LUABIND_LIBRARIES "${LUABIND_LIBRARIES};debug;${LUABIND_LIBRARY_DEBUG}")
ENDIF(LUABIND_LIBRARY_DEBUG) ENDIF(LUABIND_LIBRARY_DEBUG)

View file

@ -16,7 +16,7 @@ FIND_PATH(WINSDK_INCLUDE_DIR Windows.h
) )
IF(WINSDK_INCLUDE_DIR) IF(WINSDK_INCLUDE_DIR)
SET(WINSDK_FOUND "YES") SET(WINSDK_FOUND TRUE)
IF(NOT WINSDK_FIND_QUIETLY) IF(NOT WINSDK_FIND_QUIETLY)
MESSAGE(STATUS "Found Windows SDK.") MESSAGE(STATUS "Found Windows SDK.")
ENDIF(NOT WINSDK_FIND_QUIETLY) ENDIF(NOT WINSDK_FIND_QUIETLY)

View file

@ -7,7 +7,7 @@ ENDIF(WITH_STATIC_DRIVERS)
# On Windows we need to find DirectInput for NLMISC. # On Windows we need to find DirectInput for NLMISC.
# This is how we get events. # This is how we get events.
IF(WIN32) IF(WIN32)
FIND_PACKAGE(DirectXSDK) FIND_PACKAGE(DirectXSDK REQUIRED)
# On Win32 we can also build the MAX plugins. # On Win32 we can also build the MAX plugins.
IF(WITH_MAXPLUGIN) IF(WITH_MAXPLUGIN)
@ -51,10 +51,6 @@ IF(WITH_SOUND)
ENDIF(WITH_DRIVER_FMOD) ENDIF(WITH_DRIVER_FMOD)
ENDIF(WITH_SOUND) ENDIF(WITH_SOUND)
IF(WITH_MFC)
FIND_PACKAGE(MFC)
ENDIF(WITH_MFC)
IF(WITH_GTK) IF(WITH_GTK)
FIND_PACKAGE(GTK2) FIND_PACKAGE(GTK2)
ENDIF(WITH_GTK) ENDIF(WITH_GTK)