Merge with develop

--HG--
branch : experimental-ui-scaling
This commit is contained in:
Nimetu 2018-03-16 11:33:16 +02:00
commit bc5bf44c18
2075 changed files with 87624 additions and 18718 deletions

View file

@ -8,3 +8,7 @@ e3fe4855f22c3e75722e015dc33c091c340b3ad7 ryzomcore/v0.11.1
9e583b717fd63be0be9fd60b99087abf1691ea49 ryzomcore/v0.11.2
bfe5628e14a024ba7ea32e4b326ae433a07856b9 ryzomcore/v0.11.3
9a6120735daa97c96ac5d85ca35c7f21f607bd87 ryzomcore/v0.12.0
3e17907af67e8d66d80e6b714707bbf912607f2a ryzom-patch-3.0.0
153e0b605c9e0c83ba05b6428c62838b49cc84b2 ryzom-patch-3.0.1
4300cc14aad098b1f86ea4c55577b7fa4a4cb5d2 ryzom-patch-3.1.0
043aaeb3d8a2a54177581b57bda87a9deaad510e ryzom-patch-3.1.0-april_patch

View file

@ -9,9 +9,7 @@ os:
matrix:
fast_finish: true
env:
- CMAKE_CONFIGURE_OPTIONS="-DWITH_NEL_TESTS:BOOL=off -DWITH_LUA51:BOOL=on -DWITH_LUA52:BOOL=off -DWITH_LUA53:BOOL=off"
- CMAKE_CONFIGURE_OPTIONS="-DWITH_NEL_TESTS:BOOL=off -DWITH_LUA51:BOOL=off -DWITH_LUA52:BOOL=on -DWITH_LUA53:BOOL=off"
- CMAKE_CONFIGURE_OPTIONS="-DWITH_NEL_TESTS:BOOL=off -DWITH_LUA51:BOOL=off -DWITH_LUA52:BOOL=off -DWITH_LUA53:BOOL=on"
- CMAKE_CONFIGURE_OPTIONS="-DWITH_NEL_TESTS=OFF -DWITH_NEL_SAMPLES=OFF -DWITH_LUA51=ON -DWITH_RYZOM_SERVER=OFF -DWITH_RYZOM_TOOLS=OFF -DWITH_NEL_TOOLS=OFF"
- CMAKE_CONFIGURE_OPTIONS="-DCPPTEST_LIBRARY_DEBUG:STRING=/usr/lib/libcpptest.so"
CMAKE_BUILD_OPTIONS="--target nel_unit_test -- -j 2"
RUN="build/bin/nel_unit_test"
@ -19,10 +17,7 @@ env:
addons:
apt:
packages:
- liblua5.1-0-dev
- liblua5.1-0-dbg
- liblua5.2-0-dev
- liblua5.2-0-dbg
- liblua5.1-dev
- libluabind-dev
- libcpptest-dev
- libogg-dev

View file

@ -28,15 +28,11 @@ IF(COMMAND cmake_policy)
# have absolute paths (e.g. -lpthread)
cmake_policy(SET CMP0003 NEW)
# Works around warnings about escaped quotes in ADD_DEFINITIONS
# statements
cmake_policy(SET CMP0005 OLD)
# allow to link to qtmain automatically under Windows
IF(POLICY CMP0020)
CMAKE_POLICY(SET CMP0020 NEW)
ENDIF()
ENDIF(COMMAND cmake_policy)
ENDIF()
INCLUDE(nel)
INCLUDE(ConfigureChecks)
@ -71,15 +67,15 @@ SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
# DLL should be in the same directory as EXE under Windows
IF(WIN32)
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
ELSE(WIN32)
ELSE()
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
ENDIF(WIN32)
ENDIF()
IF(WIN32)
IF(WITH_MFC)
FIND_PACKAGE(MFC QUIET)
ENDIF(WITH_MFC)
ENDIF(WIN32)
ENDIF()
ENDIF()
#-----------------------------------------------------------------------------
# Set default config options
@ -93,8 +89,6 @@ NL_SETUP_SNOWBALLS_DEFAULT_OPTIONS()
NL_SETUP_PREFIX_PATHS()
RYZOM_SETUP_PREFIX_PATHS()
NL_CONFIGURE_CHECKS()
NL_SETUP_BUILD()
NL_SETUP_BUILD_FLAGS()
@ -108,8 +102,8 @@ IF(WIN32)
IF(WITH_MFC)
FIND_PACKAGE(CustomMFC REQUIRED)
ENDIF(WITH_MFC)
ENDIF(WIN32)
ENDIF()
ENDIF()
FIND_PACKAGE(ZLIB REQUIRED)
FIND_PACKAGE(LibXml2 REQUIRED)
@ -118,15 +112,29 @@ FIND_PACKAGE(OpenSSL REQUIRED)
FIND_PACKAGE(GIF)
FIND_PACKAGE(Jpeg)
IF(WIN32)
SET(OPENSSL_LIBRARIES ${OPENSSL_LIBRARIES} Crypt32.lib)
ENDIF()
IF(WITH_LIBOVR)
FIND_PACKAGE(LibOVR)
ENDIF()
IF(WITH_LIBVR)
FIND_PACKAGE(LibVR)
ENDIF()
NL_CONFIGURE_CHECKS()
IF(WITH_STATIC_LIBXML2)
SET(LIBXML2_DEFINITIONS ${LIBXML2_DEFINITIONS} -DLIBXML_STATIC)
ENDIF(WITH_STATIC_LIBXML2)
ENDIF()
IF(WITH_LIBXML2_ICONV)
FIND_PACKAGE(Iconv REQUIRED)
INCLUDE_DIRECTORIES(${ICONV_INCLUDE_DIR})
SET(LIBXML2_LIBRARIES ${LIBXML2_LIBRARIES} ${ICONV_LIBRARIES})
ENDIF(WITH_LIBXML2_ICONV)
ENDIF()
IF(WITH_STATIC)
# libxml2 could need winsock2 library
@ -141,40 +149,45 @@ IF(WITH_STATIC)
SET(LIBXML2_LIBRARIES ${LIBXML2_LIBRARIES} ${LIBLZMA_LIBRARIES})
ENDIF()
ENDIF()
ENDIF(WITH_STATIC)
ENDIF()
INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/PCHSupport.cmake)
IF(FINAL_VERSION)
ADD_DEFINITIONS(-DFINAL_VERSION=1)
ENDIF(FINAL_VERSION)
ENDIF()
IF(WITH_SSE2)
ADD_DEFINITIONS(-DNL_HAS_SSE2)
IF(WITH_SSE3)
ADD_DEFINITIONS(-DNL_HAS_SSE3)
ENDIF(WITH_SSE3)
ENDIF(WITH_SSE2)
IF(APPLE_CERTIFICATE)
# Find codesign_allocate
# Xcode 7.0 and later versions
SET(CODESIGN_ALLOCATE ${OSX_DEVELOPER_ROOT}/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate)
IF(NOT EXISTS "${CODESIGN_ALLOCATE}")
# Xcode 6.4 and previous versions
SET(CODESIGN_ALLOCATE ${CMAKE_OSX_SYSROOT}/usr/bin/codesign_allocate)
ENDIF()
ENDIF()
IF(NOT EXISTS "${CODESIGN_ALLOCATE}")
# System path
SET(CODESIGN_ALLOCATE /usr/bin/codesign_allocate)
ENDIF()
IF(APPLE)
FIND_LIBRARY(CARBON_FRAMEWORK Carbon)
FIND_LIBRARY(FOUNDATION_FRAMEWORK Foundation)
IF(NOT EXISTS "${CODESIGN_ALLOCATE}")
MESSAGE(WARNING "Unable to find codesign_allocate in standard directories")
SET(CODESIGN_ALLOCATE)
IF(APPLE_CERTIFICATE)
# Find codesign_allocate
# Xcode 7.0 and later versions
SET(CODESIGN_ALLOCATE ${OSX_DEVELOPER_ROOT}/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate)
IF(NOT EXISTS "${CODESIGN_ALLOCATE}")
# Xcode 6.4 and previous versions
SET(CODESIGN_ALLOCATE ${CMAKE_OSX_SYSROOT}/usr/bin/codesign_allocate)
ENDIF()
IF(NOT EXISTS "${CODESIGN_ALLOCATE}")
# System path
SET(CODESIGN_ALLOCATE /usr/bin/codesign_allocate)
ENDIF()
IF(NOT EXISTS "${CODESIGN_ALLOCATE}")
MESSAGE(WARNING "Unable to find codesign_allocate in standard directories")
SET(CODESIGN_ALLOCATE)
ENDIF()
ENDIF()
ENDIF()
@ -300,7 +313,7 @@ IF(WITH_QT5)
ADD_QT_LIBRARY(XcbQpa)
ADD_QT_LIBRARY(PlatformSupport)
SET(QT_LIBRARIES ${QT_LIBRARIES} -lX11-xcb -lXi -lSM -lICE -lxcb -lGL)
SET(QT_LIBRARIES ${QT_LIBRARIES} -lX11-xcb -lXi -lSM -lICE -lxcb -lGL -lxcb-glx)
IF(EXISTS "${QT_LIBRARY_DIR}/libxcb-static.a")
SET(QT_LIBRARIES ${QT_LIBRARIES} "${QT_LIBRARY_DIR}/libxcb-static.a")
ENDIF()
@ -324,7 +337,7 @@ IF(WITH_QT5)
ENDIF()
# freetype is needed since Qt 5.5
FIND_PACKAGE(FreeType)
FIND_PACKAGE(Freetype)
IF(FREETYPE_FOUND)
SET(QT_LIBRARIES ${QT_LIBRARIES} ${FREETYPE_LIBRARIES})
@ -370,8 +383,6 @@ IF(WITH_QT5)
IF(APPLE)
FIND_LIBRARY(PCRE_LIBRARY pcre16 pcre)
FIND_LIBRARY(FOUNDATION_FRAMEWORK Foundation)
FIND_LIBRARY(CARBON_FRAMEWORK Carbon)
FIND_LIBRARY(SECURITY_FRAMEWORK Security)
SET(QT_LIBRARIES ${QT_LIBRARIES}
@ -395,16 +406,16 @@ IF(WITH_QT)
# Use Qt 4
FIND_PACKAGE(Qt4 COMPONENTS QtCore QtGui QtXml QtOpenGL REQUIRED)
ENDIF(WITH_QT)
ENDIF()
IF(WITH_ASSIMP)
FIND_PACKAGE(assimp REQUIRED)
ENDIF(WITH_ASSIMP)
ENDIF()
IF(WITH_NEL)
IF(WITH_NEL_TESTS)
FIND_PACKAGE(CppTest)
ENDIF(WITH_NEL_TESTS)
ENDIF()
IF(WITH_GUI)
FIND_PACKAGE(Luabind REQUIRED)
@ -442,19 +453,19 @@ IF(WITH_NEL)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/nel/include)
ADD_SUBDIRECTORY(nel)
ENDIF(WITH_NEL)
ENDIF()
IF(WITH_RYZOM)
ADD_SUBDIRECTORY(ryzom)
ENDIF(WITH_RYZOM)
ENDIF()
IF(WITH_NELNS)
ADD_SUBDIRECTORY(nelns)
ENDIF(WITH_NELNS)
ENDIF()
IF(WITH_SNOWBALLS)
ADD_SUBDIRECTORY(snowballs2)
ENDIF(WITH_SNOWBALLS)
ENDIF()
IF(WITH_TOOLS)
ADD_SUBDIRECTORY(tool)
@ -462,22 +473,22 @@ ENDIF()
IF(WITH_STUDIO)
ADD_SUBDIRECTORY(studio)
ENDIF(WITH_STUDIO)
ENDIF()
# To build the documention, you will have to enable it
# and then do the equivalent of "make DoxygenDoc".
IF(BUILD_DOCUMENTATION)
IF(DOT)
SET(HAVE_DOT YES)
ELSE(DOT)
ELSE()
SET(HAVE_DOT NO)
ENDIF(DOT)
ENDIF()
# This processes our Doxyfile.in and substitutes paths to generate
# a final Doxyfile
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/doc/Doxyfile.cmake.in ${CMAKE_BINARY_DIR}/doc/Doxyfile)
ADD_CUSTOM_TARGET(DoxygenDoc ${DOXYGEN} ${CMAKE_BINARY_DIR}/doc/Doxyfile)
ENDIF(BUILD_DOCUMENTATION)
ENDIF()
IF(WITH_NEL_TESTS)
ENABLE_TESTING()
@ -487,8 +498,8 @@ IF(WITH_NEL_TESTS)
SET(SVNCOMMAND svn)
SET(SVNSOURCEDIR http://dev.ryzom.com/svn/trunk/nel)
SET(GENERATELOGS svn2cl)
ENDIF(BUILD_DASHBOARD)
ENDIF(WITH_NEL_TESTS)
ENDIF()
ENDIF()
# packaging information
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Ryzom Core MMORPG Framework")
@ -520,10 +531,10 @@ IF(WIN32)
#SET(CPACK_GENERATOR "NSIS")
SET(CPACK_GENERATOR "NSIS;ZIP")
SET(CPACK_SOURCE_GENERATOR "ZIP")
ELSE(WIN32)
ELSE()
SET(CPACK_GENERATOR "TGZ")
SET(CPACK_SOURCE_GENERATOR "TGZ")
ENDIF(WIN32)
ENDIF()
set(CPACK_SOURCE_IGNORE_FILES
"~$"
"\\\\.cvsignore$"
@ -541,8 +552,8 @@ IF(WIN32)
"${QT_LIBRARY_DIR}/../bin/QtXmld4.dll"
"${QT_LIBRARY_DIR}/../bin/QtCored4.dll"
DESTINATION ${NL_BIN_PREFIX})
ENDIF(WITH_QT)
ELSE(NOT CMAKE_BUILD_TYPE STREQUAL "Release")
ENDIF()
ELSE()
IF(WITH_QT)
INCLUDE(${QT_USE_FILE})
INSTALL(FILES
@ -550,8 +561,8 @@ IF(WIN32)
"${QT_LIBRARY_DIR}/../bin/QtXml4.dll"
"${QT_LIBRARY_DIR}/../bin/QtCore4.dll"
DESTINATION ${NL_BIN_PREFIX})
ENDIF(WITH_QT)
ENDIF(NOT CMAKE_BUILD_TYPE STREQUAL "Release")
ENDIF()
ENDIF()
# Install CEGUI and its dependencies.
IF(WITH_NEL_CEGUI)
@ -561,14 +572,14 @@ IF(WIN32)
INSTALL(FILES "${CEGUI_LIB_DIR}/CEGUIFalagardWRBase.dll" DESTINATION ${NL_BIN_PREFIX})
INSTALL(FILES "${CEGUI_LIB_DIR}/Devil.dll" DESTINATION ${NL_BIN_PREFIX})
INSTALL(FILES "${CEGUI_LIB_DIR}/ILU.dll" DESTINATION ${NL_BIN_PREFIX})
ENDIF(WITH_NEL_CEGUI)
ENDIF()
# Only the tools require MFC.
IF(WITH_TOOLS)
SET(CMAKE_INSTALL_MFC_LIBRARIES TRUE)
ENDIF(WITH_TOOLS)
ENDIF()
#INCLUDE(InstallRequiredSystemLibraries)
ENDIF(WIN32)
ENDIF()
INCLUDE(CPack)
@ -578,4 +589,4 @@ INCLUDE(CMakePackaging.txt)
#INCLUDE(UseDebian)
#IF(DEBIAN_FOUND)
# ADD_DEBIAN_TARGETS(nel)
#ENDIF(DEBIAN_FOUND)
#ENDIF()

View file

@ -28,14 +28,14 @@ IF(TARGET_CPU STREQUAL "armv7")
SET(TOOLCHAIN_ARCH "arm")
SET(GCC_TOOLCHAIN_PREFIX "arm-linux-androideabi")
SET(TOOLCHAIN_BIN_PREFIX "arm-linux-androideabi")
SET(MINIMUM_NDK_TARGET 4)
SET(MINIMUM_NDK_TARGET 9)
ELSEIF(TARGET_CPU STREQUAL "armv5")
SET(LIBRARY_ARCHITECTURE "armeabi")
SET(CMAKE_SYSTEM_PROCESSOR "armv5")
SET(TOOLCHAIN_ARCH "arm")
SET(GCC_TOOLCHAIN_PREFIX "arm-linux-androideabi")
SET(TOOLCHAIN_BIN_PREFIX "arm-linux-androideabi")
SET(MINIMUM_NDK_TARGET 4)
SET(MINIMUM_NDK_TARGET 9)
ELSEIF(TARGET_CPU STREQUAL "arm64")
SET(LIBRARY_ARCHITECTURE "arm64-v8a")
SET(CMAKE_SYSTEM_PROCESSOR "arm64")
@ -76,14 +76,9 @@ ELSE()
ENDIF()
SET(CLANG_TOOLCHAIN_PREFIX "llvm")
SET(ANDROID_COMPILER "GCC")
IF(NDK_TOOLCHAIN_VERSION STREQUAL "clang")
SET(ANDROID_COMPILER "clang")
SET(CLANG ON)
ELSE()
SET(GCC_TOOLCHAIN_VERSION ${NDK_TOOLCHAIN_VERSION})
ENDIF()
SET(ANDROID_COMPILER "clang")
SET(ANDROID_COMPILER "clang")
SET(CLANG ON)
IF(NOT NDK_TARGET)
SET(NDK_TARGET ${MINIMUM_NDK_TARGET})
@ -94,88 +89,71 @@ ELSE()
ENDIF()
IF(CMAKE_HOST_WIN32)
SET(TOOLCHAIN_HOST "windows")
SET(TOOLCHAIN_HOST "windows-x86_64")
SET(TOOLCHAIN_BIN_SUFFIX ".exe")
ELSEIF(CMAKE_HOST_APPLE)
SET(TOOLCHAIN_HOST "apple")
SET(TOOLCHAIN_BIN_SUFFIX "")
ELSEIF(CMAKE_HOST_UNIX)
SET(TOOLCHAIN_HOST "linux")
SET(TOOLCHAIN_HOST "linux-x86_64")
SET(TOOLCHAIN_BIN_SUFFIX "")
ENDIF()
MACRO(SEARCH_TOOLCHAIN _COMPILER)
SET(${_COMPILER}_TOOLCHAIN_VERSIONS)
FILE(GLOB _TOOLCHAIN_VERSIONS "${NDK_ROOT}/toolchains/${${_COMPILER}_TOOLCHAIN_PREFIX}-*")
IF(_TOOLCHAIN_VERSIONS)
LIST(SORT _TOOLCHAIN_VERSIONS)
LIST(REVERSE _TOOLCHAIN_VERSIONS)
FOREACH(_TOOLCHAIN_VERSION ${_TOOLCHAIN_VERSIONS})
STRING(REGEX REPLACE ".+${_PREFIX}-([0-9.]+)" "\\1" _TOOLCHAIN_VERSION "${_TOOLCHAIN_VERSION}")
IF(_TOOLCHAIN_VERSION MATCHES "^([0-9.]+)$")
LIST(APPEND ${_COMPILER}_TOOLCHAIN_VERSIONS ${_TOOLCHAIN_VERSION})
ENDIF()
ENDFOREACH()
ENDIF()
# clang
SET(CLANG_TOOLCHAIN_ROOT "${NDK_ROOT}/toolchains/${CLANG_TOOLCHAIN_PREFIX}/prebuilt/${TOOLCHAIN_HOST}")
# try prefixes without version
SET(_TOOLCHAIN_WITHOUT_VERSION "${NDK_ROOT}/toolchains/${${_COMPILER}_TOOLCHAIN_PREFIX}")
IF(EXISTS ${_TOOLCHAIN_WITHOUT_VERSION})
LIST(APPEND ${_COMPILER}_TOOLCHAIN_VERSIONS "default")
ENDIF()
IF(EXISTS ${CLANG_TOOLCHAIN_ROOT})
MESSAGE(STATUS "Found LLVM toolchain in ${CLANG_TOOLCHAIN_ROOT}")
ELSE()
MESSAGE(FATAL_ERROR "No LLVM toolchain found in default search path ${CLANG_TOOLCHAIN_ROOT}")
ENDIF()
IF(NOT ${_COMPILER}_TOOLCHAIN_VERSIONS)
MESSAGE(FATAL_ERROR "No Android ${_COMPILER} toolchain found in default search path ${NDK_ROOT}/toolchains")
ENDIF()
IF(${_COMPILER}_TOOLCHAIN_VERSIONS)
LIST(FIND ${_COMPILER}_TOOLCHAIN_VERSIONS "${${_COMPILER}_TOOLCHAIN_VERSION}" _INDEX)
IF(_INDEX EQUAL -1)
LIST(GET ${_COMPILER}_TOOLCHAIN_VERSIONS 0 ${_COMPILER}_TOOLCHAIN_VERSION)
# gcc
SET(GCC_TOOLCHAIN_VERSIONS)
FILE(GLOB _TOOLCHAIN_VERSIONS "${NDK_ROOT}/toolchains/${GCC_TOOLCHAIN_PREFIX}-*")
IF(_TOOLCHAIN_VERSIONS)
LIST(SORT _TOOLCHAIN_VERSIONS)
LIST(REVERSE _TOOLCHAIN_VERSIONS)
FOREACH(_TOOLCHAIN_VERSION ${_TOOLCHAIN_VERSIONS})
STRING(REGEX REPLACE ".+${_PREFIX}-([0-9.]+)" "\\1" _TOOLCHAIN_VERSION "${_TOOLCHAIN_VERSION}")
IF(_TOOLCHAIN_VERSION MATCHES "^([0-9.]+)$")
LIST(APPEND GCC_TOOLCHAIN_VERSIONS ${_TOOLCHAIN_VERSION})
ENDIF()
ELSE()
LIST(GET ${_COMPILER}_TOOLCHAIN_VERSIONS 0 ${_COMPILER}_TOOLCHAIN_VERSION)
ENDIF()
MESSAGE(STATUS "TOOLCHAIN_PREFIX = ${${_COMPILER}_TOOLCHAIN_VERSION}")
IF("${${_COMPILER}_TOOLCHAIN_VERSION}" STREQUAL "default")
MESSAGE(STATUS "default")
SET(${_COMPILER}_TOOLCHAIN_ROOT "${NDK_ROOT}/toolchains/${${_COMPILER}_TOOLCHAIN_PREFIX}/prebuilt/${TOOLCHAIN_HOST}")
ELSE()
MESSAGE(STATUS "not default")
SET(${_COMPILER}_TOOLCHAIN_ROOT "${NDK_ROOT}/toolchains/${${_COMPILER}_TOOLCHAIN_PREFIX}-${${_COMPILER}_TOOLCHAIN_VERSION}/prebuilt/${TOOLCHAIN_HOST}")
ENDIF()
IF(NOT EXISTS "${${_COMPILER}_TOOLCHAIN_ROOT}")
FILE(GLOB _TOOLCHAIN_PREFIXES "${${_COMPILER}_TOOLCHAIN_ROOT}*")
IF(_TOOLCHAIN_PREFIXES)
LIST(GET _TOOLCHAIN_PREFIXES 0 ${_COMPILER}_TOOLCHAIN_ROOT)
ENDIF()
ENDIF()
ENDMACRO()
IF(CLANG)
SEARCH_TOOLCHAIN(CLANG)
MESSAGE(STATUS "Target Android NDK ${NDK_TARGET} and use clang ${CLANG_TOOLCHAIN_VERSION}")
ENDFOREACH()
ENDIF()
SEARCH_TOOLCHAIN(GCC)
MESSAGE(STATUS "Target Android NDK ${NDK_TARGET} and use GCC ${GCC_TOOLCHAIN_VERSION}")
IF(CLANG_TOOLCHAIN_ROOT)
MESSAGE(STATUS "Found Android LLVM toolchain in ${CLANG_TOOLCHAIN_ROOT}")
IF(NOT GCC_TOOLCHAIN_VERSIONS)
MESSAGE(FATAL_ERROR "No GCC version found in default search path ${NDK_ROOT}/toolchains")
ENDIF()
IF(GCC_TOOLCHAIN_ROOT)
MESSAGE(STATUS "Found Android GCC toolchain in ${GCC_TOOLCHAIN_ROOT}")
IF(GCC_TOOLCHAIN_VERSIONS)
LIST(FIND GCC_TOOLCHAIN_VERSIONS "${GCC_TOOLCHAIN_VERSION}" _INDEX)
IF(_INDEX EQUAL -1)
LIST(GET GCC_TOOLCHAIN_VERSIONS 0 GCC_TOOLCHAIN_VERSION)
ENDIF()
ELSE()
LIST(GET GCC_TOOLCHAIN_VERSIONS 0 GCC_TOOLCHAIN_VERSION)
ENDIF()
SET(GCC_TOOLCHAIN_ROOT "${NDK_ROOT}/toolchains/${GCC_TOOLCHAIN_PREFIX}-${GCC_TOOLCHAIN_VERSION}/prebuilt/${TOOLCHAIN_HOST}")
IF(NOT EXISTS "${GCC_TOOLCHAIN_ROOT}")
FILE(GLOB _TOOLCHAIN_PREFIXES "${GCC_TOOLCHAIN_ROOT}*")
IF(_TOOLCHAIN_PREFIXES)
LIST(GET _TOOLCHAIN_PREFIXES 0 GCC_TOOLCHAIN_ROOT)
ENDIF()
ENDIF()
IF(EXISTS "${GCC_TOOLCHAIN_ROOT}")
MESSAGE(STATUS "Found GCC toolchain in ${GCC_TOOLCHAIN_ROOT}")
ELSE()
MESSAGE(FATAL_ERROR "No GCC toolchain found in default search path ${GCC_TOOLCHAIN_ROOT}")
ENDIF()
# NDK
SET(PLATFORM_ROOT "${NDK_ROOT}/platforms/android-${NDK_TARGET}/arch-${TOOLCHAIN_ARCH}")
MESSAGE(STATUS "Found Android platform in ${PLATFORM_ROOT}")
MESSAGE(STATUS "Target Android NDK ${NDK_TARGET} found in ${PLATFORM_ROOT}")
# include dirs
SET(PLATFORM_INCLUDE_DIR "${PLATFORM_ROOT}/usr/include")
@ -208,41 +186,29 @@ MACRO(SET_TOOLCHAIN_BINARY_GCC _NAME _BINARY)
SET(${_NAME} ${GCC_TOOLCHAIN_ROOT}/bin/${TOOLCHAIN_BIN_PREFIX}-${_BINARY}${TOOLCHAIN_BIN_SUFFIX} CACHE PATH "" FORCE)
ENDMACRO()
# Force the compilers to GCC for Android
include (CMakeForceCompiler)
SET(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
IF(CLANG)
MESSAGE(STATUS "Using clang compiler")
SET_TOOLCHAIN_BINARY_LLVM(CMAKE_C_COMPILER clang)
SET_TOOLCHAIN_BINARY_LLVM(CMAKE_CXX_COMPILER clang++)
SET_TOOLCHAIN_BINARY_LLVM(CMAKE_C_COMPILER clang)
SET_TOOLCHAIN_BINARY_LLVM(CMAKE_CXX_COMPILER clang++)
SET(CMAKE_C_COMPILER ${CMAKE_C_COMPILER})
SET(CMAKE_C_COMPILER_TARGET ${TOOLCHAIN_BIN_PREFIX})
SET(CMAKE_C_COMPILER_FORCED TRUE)
CMAKE_FORCE_C_COMPILER(${CMAKE_C_COMPILER} clang)
CMAKE_FORCE_CXX_COMPILER(${CMAKE_CXX_COMPILER} clang)
SET(CMAKE_CXX_COMPILER ${CMAKE_CXX_COMPILER})
SET(CMAKE_CXX_COMPILER_TARGET ${TOOLCHAIN_BIN_PREFIX})
SET(CMAKE_CXX_COMPILER_FORCED TRUE)
SET_TOOLCHAIN_BINARY_LLVM(CMAKE_ASM_COMPILER llvm-as)
SET_TOOLCHAIN_BINARY_LLVM(CMAKE_AR llvm-ar)
SET_TOOLCHAIN_BINARY_LLVM(CMAKE_LINKER clang++)
IF(NOT EXISTS "${CMAKE_ASM_COMPILER}")
SET_TOOLCHAIN_BINARY_GCC(CMAKE_ASM_COMPILER as)
ENDIF()
IF(NOT EXISTS "${CMAKE_AR}")
SET_TOOLCHAIN_BINARY_GCC(CMAKE_AR ar)
ENDIF()
ELSE()
MESSAGE(STATUS "Using GCC compiler")
SET_TOOLCHAIN_BINARY_GCC(CMAKE_C_COMPILER gcc)
SET_TOOLCHAIN_BINARY_GCC(CMAKE_CXX_COMPILER g++)
CMAKE_FORCE_C_COMPILER(${CMAKE_C_COMPILER} GNU)
CMAKE_FORCE_CXX_COMPILER(${CMAKE_CXX_COMPILER} GNU)
SET_TOOLCHAIN_BINARY_LLVM(CMAKE_ASM_COMPILER llvm-as)
SET_TOOLCHAIN_BINARY_LLVM(CMAKE_AR llvm-ar)
SET_TOOLCHAIN_BINARY_LLVM(CMAKE_LINKER clang++)
IF(NOT EXISTS "${CMAKE_ASM_COMPILER}")
SET_TOOLCHAIN_BINARY_GCC(CMAKE_ASM_COMPILER as)
ENDIF()
IF(NOT EXISTS "${CMAKE_AR}")
SET_TOOLCHAIN_BINARY_GCC(CMAKE_AR ar)
SET_TOOLCHAIN_BINARY_GCC(CMAKE_LINKER ld)
ENDIF()
SET_TOOLCHAIN_BINARY_GCC(CMAKE_STRIP strip)

View file

@ -24,8 +24,8 @@ MACRO(CHECK_UNDEFINED_SYMBOL MYLIBRARY SYMBOL SYMBOL_FOUND)
IF(NOT NM_SYMBOL MATCHES ${SYMBOL})
SET(${SYMBOL_FOUND} FALSE)
# MESSAGE(STATUS "Defined symbol ${SYMBOL} detected in ${${MYLIBRARY}}")
ENDIF(NOT NM_SYMBOL MATCHES ${SYMBOL})
ENDIF(CMAKE_NM)
ENDIF()
ENDIF()
ELSEIF(UNIX)
SET(CMAKE_OBJDUMP objdump)
IF(CMAKE_OBJDUMP)
@ -35,11 +35,11 @@ MACRO(CHECK_UNDEFINED_SYMBOL MYLIBRARY SYMBOL SYMBOL_FOUND)
IF(NOT OBJDUMP_SYMBOL MATCHES "UND")
#MESSAGE(STATUS "${${MYLIBRARY}} does not use symbol ${SYMBOL}")
SET(${SYMBOL_FOUND} FALSE)
ELSE(NOT OBJDUMP_SYMBOL MATCHES "UND")
ELSE()
#MESSAGE(STATUS "${${MYLIBRARY}} uses symbol ${SYMBOL}")
ENDIF(NOT OBJDUMP_SYMBOL MATCHES "UND")
ENDIF(CMAKE_OBJDUMP)
ENDIF(WIN32)
ENDIF()
ENDIF()
ENDIF()
ENDMACRO(CHECK_UNDEFINED_SYMBOL)
# CHECK_LINKED_LIBRARY
@ -66,8 +66,8 @@ MACRO(CHECK_LINKED_LIBRARY MYLIBRARY OTHERLIBRARY LIBRARY_FOUND)
IF(OTOOL_LIBRARY MATCHES "${LIBNAME}")
SET(${LIBRARY_FOUND} TRUE)
# MESSAGE(STATUS "Library ${LIBNAME} already linked to ${${MYLIBRARY}}")
ENDIF(OTOOL_LIBRARY MATCHES "${LIBNAME}")
ENDIF(CMAKE_OTOOL)
ENDIF()
ENDIF()
ELSEIF(UNIX)
SET(CMAKE_OBJDUMP objdump)
IF(CMAKE_OBJDUMP)
@ -79,11 +79,11 @@ MACRO(CHECK_LINKED_LIBRARY MYLIBRARY OTHERLIBRARY LIBRARY_FOUND)
IF(OBJDUMP_LIBRARY MATCHES "NEEDED")
#MESSAGE(STATUS "${${MYLIBRARY}} references to ${LIBNAME}.")
SET(${LIBRARY_FOUND} TRUE)
ELSE(OBJDUMP_LIBRARY MATCHES "NEEDED")
ELSE()
#MESSAGE(STATUS "${${MYLIBRARY}} does not reference to ${LIBNAME}!")
ENDIF(OBJDUMP_LIBRARY MATCHES "NEEDED")
ENDIF(CMAKE_OBJDUMP)
ENDIF(WIN32)
ENDIF()
ENDIF()
ENDIF()
ENDMACRO(CHECK_LINKED_LIBRARY)
MACRO(CHECK_DEPENDS MYLIBRARY OTHERLIBRARY SYMBOL MUSTLINK)
@ -91,13 +91,13 @@ MACRO(CHECK_DEPENDS MYLIBRARY OTHERLIBRARY SYMBOL MUSTLINK)
IF(SYMBOL_FOUND)
CHECK_LINKED_LIBRARY(MYLIBRARY OTHERLIBRARY LIBRARY_FOUND)
ENDIF(SYMBOL_FOUND)
ENDIF()
IF(SYMBOL_FOUND AND NOT LIBRARY_FOUND)
SET(${MUSTLINK} YES)
ELSE(SYMBOL_FOUND AND NOT LIBRARY_FOUND)
ELSE()
SET(${MUSTLINK} NO)
ENDIF(SYMBOL_FOUND AND NOT LIBRARY_FOUND)
ENDIF()
ENDMACRO(CHECK_DEPENDS)
# LINK_DEPENDS
@ -116,23 +116,23 @@ MACRO(LINK_DEPENDS LIBRARIES MYLIBRARY OTHERLIBRARY SYMBOL)
IF(WIN32 OR WITH_STATIC)
# In static, we link all libraries because it will keep only used symbols
SET(MUST_LINK TRUE)
ELSE(WIN32 OR WITH_STATIC)
ELSE()
CHECK_UNDEFINED_SYMBOL(${MYLIBRARY} ${SYMBOL} SYMBOL_FOUND)
IF(SYMBOL_FOUND)
CHECK_LINKED_LIBRARY(${MYLIBRARY} ${OTHERLIBRARY} LIBRARY_FOUND)
ENDIF(SYMBOL_FOUND)
ENDIF()
IF(SYMBOL_FOUND AND NOT LIBRARY_FOUND)
MESSAGE(STATUS "Underlinking found: ${${MYLIBRARY}} needs ${${OTHERLIBRARY}} but is not linked to, manually linking...")
SET(MUST_LINK TRUE)
ENDIF(SYMBOL_FOUND AND NOT LIBRARY_FOUND)
ENDIF(WIN32 OR WITH_STATIC)
ENDIF(${MYLIBRARY} AND ${OTHERLIBRARY} AND NOT ${OTHERLIBRARY}_LINKED)
ENDIF()
ENDIF()
ENDIF()
IF(MUST_LINK)
MESSAGE(STATUS "Linking with ${${OTHERLIBRARY}}")
SET(${LIBRARIES} ${${LIBRARIES}} ${${OTHERLIBRARY}})
SET(${OTHERLIBRARY}_LINKED TRUE)
ENDIF(MUST_LINK)
ENDIF()
ENDMACRO(LINK_DEPENDS)

View file

@ -40,7 +40,8 @@ MACRO(NL_CONFIGURE_CHECKS)
SET(NL_VERSION "${NL_VERSION_MAJOR}.${NL_VERSION_MINOR}.${NL_VERSION_PATCH}.${REVISION}")
SET(NL_VERSION_RC "${NL_VERSION_MAJOR},${NL_VERSION_MINOR},${NL_VERSION_PATCH},${REVISION}")
SET(RYZOM_VERSION "${RYZOM_VERSION_MAJOR}.${RYZOM_VERSION_MINOR}.${RYZOM_VERSION_PATCH}.${REVISION}")
SET(RYZOM_VERSION_SHORT "${RYZOM_VERSION_MAJOR}.${RYZOM_VERSION_MINOR}.${RYZOM_VERSION_PATCH}")
SET(RYZOM_VERSION "${RYZOM_VERSION_SHORT}.${REVISION}")
SET(RYZOM_VERSION_RC "${RYZOM_VERSION_MAJOR},${RYZOM_VERSION_MINOR},${RYZOM_VERSION_PATCH},${REVISION}")
NOW(BUILD_DATE)

View file

@ -18,6 +18,7 @@ FIND_PATH(MAXSDK_DIR
PATHS
"$ENV{ADSK_3DSMAX_SDK_2012}/maxsdk"
"$ENV{3DSMAX_2011_SDK_PATH}/maxsdk"
"$ENV{PROGRAMFILES}/Autodesk/3ds Max 2017 SDK/maxsdk"
"$ENV{PROGRAMFILES}/Autodesk/3ds Max 2010 SDK/maxsdk"
"$ENV{PROGRAMFILES}/Autodesk/3ds Max 2009 SDK/maxsdk"
"$ENV{PROGRAMFILES}/Autodesk/3ds Max 2008 SDK/maxsdk"
@ -36,12 +37,12 @@ FIND_PATH(MAXSDK_CS_INCLUDE_DIR bipexp.h
)
IF(TARGET_X64)
SET(MAXSDK_LIBRARY_DIRS ${MAXSDK_DIR}/x64/lib)
SET(MAXSDK_LIBRARY_DIRS ${MAXSDK_DIR}/x64/lib ${MAXSDK_DIR}/lib/x64/Release)
ELSE()
SET(MAXSDK_LIBRARY_DIRS ${MAXSDK_DIR}/lib)
ENDIF()
MACRO(FIND_3DS_LIBRARY MYLIBRARY MYLIBRARYNAME)
MACRO(FIND_3DS_LIBRARY MYLIBRARY MYLIBRARYNAME)
FIND_LIBRARY(${MYLIBRARY}
NAMES ${MYLIBRARYNAME}
HINTS
@ -73,10 +74,28 @@ if(MAXSDK_FOUND)
${MAXSDK_MAXUTIL_LIBRARY}
${MAXSDK_MAXSCRIPT_LIBRARY}
${MAXSDK_PARAMBLK2_LIBRARY}
${MAXSDK_BMM_LIBRARY} )
${MAXSDK_BMM_LIBRARY})
else(MAXSDK_FOUND)
# parse maxversion.h to determine SDK version
IF(EXISTS "${MAXSDK_DIR}/include/maxversion.h")
FILE(STRINGS "${MAXSDK_DIR}/include/maxversion.h" LINES REGEX "#define MAX_PRODUCT_YEAR_NUMBER ([0-9]+)")
STRING(REGEX REPLACE ".+MAX_PRODUCT_YEAR_NUMBER ([0-9]+)" "\\1" MAXSDK_VERSION "${LINES}")
UNSET(LINES)
ELSE()
SET(MAXSDK_VERSION "Unknown")
ENDIF()
MESSAGE(STATUS "Found 3dsmax version ${MAXSDK_VERSION} in ${MAXSDK_DIR}")
# 3ds Max 2013 and later are always Unicode
IF(MAXSDK_VERSION VERSION_GREATER 2012)
SET(MAXSDK_DEFINITIONS -DUNICODE -D_UNICODE)
ELSE()
SET(MAXSDK_DEFINITIONS)
ENDIF()
ELSE()
set(MAXSDK_LIBRARIES)
endif(MAXSDK_FOUND)
ENDIF()
mark_as_advanced(MAXSDK_INCLUDE_DIR MAXSDK_LIBRARY)

View file

@ -7,7 +7,7 @@
IF(CEGUI_LIBRARY AND CEGUI_INCLUDE_DIRS)
# in cache already
SET(CEGUI_FIND_QUIETLY TRUE)
ENDIF(CEGUI_LIBRARY AND CEGUI_INCLUDE_DIRS)
ENDIF()
FIND_PATH(CEGUI_INCLUDE_DIRS
@ -45,9 +45,9 @@ IF(CEGUI_LIBRARY AND CEGUI_INCLUDE_DIRS)
SET(CEGUI_INCLUDE_DIRS "${CEGUI_INCLUDE_DIRS}/CEGUI")
IF(NOT CEGUI_FIND_QUIETLY)
MESSAGE(STATUS "Found CEGUI: ${CEGUI_LIBRARY}")
ENDIF(NOT CEGUI_FIND_QUIETLY)
ELSE(CEGUI_LIBRARY AND CEGUI_INCLUDE_DIRS)
ENDIF()
ELSE()
IF(NOT CEGUI_FIND_QUIETLY)
MESSAGE(STATUS "Warning: Unable to find CEGUI!")
ENDIF(NOT CEGUI_FIND_QUIETLY)
ENDIF(CEGUI_LIBRARY AND CEGUI_INCLUDE_DIRS)
ENDIF()
ENDIF()

View file

@ -10,7 +10,7 @@
IF(CPPTEST_LIBRARIES AND CPPTEST_INCLUDE_DIR)
# in cache already
SET(CPPTEST_FIND_QUIETLY TRUE)
ENDIF(CPPTEST_LIBRARIES AND CPPTEST_INCLUDE_DIR)
ENDIF()
FIND_PATH(CPPTEST_INCLUDE_DIR
cpptest.h
@ -30,7 +30,7 @@ SET(LIBRARY_NAME_DEBUG cpptestd)
IF(WITH_STLPORT)
SET(LIBRARY_NAME_RELEASE cpptest_stlport ${LIBRARY_NAME_RELEASE})
SET(LIBRARY_NAME_DEBUG cpptest_stlportd ${LIBRARY_NAME_DEBUG})
ENDIF(WITH_STLPORT)
ENDIF()
FIND_LIBRARY(CPPTEST_LIBRARY_RELEASE
${LIBRARY_NAME_RELEASE}
@ -67,18 +67,18 @@ IF(CPPTEST_INCLUDE_DIR)
SET(CPPTEST_LIBRARIES "optimized;${CPPTEST_LIBRARY_RELEASE}")
IF(CPPTEST_LIBRARY_DEBUG)
SET(CPPTEST_LIBRARIES "${CPPTEST_LIBRARIES};debug;${CPPTEST_LIBRARY_DEBUG}")
ENDIF(CPPTEST_LIBRARY_DEBUG)
ENDIF(CPPTEST_LIBRARY_RELEASE)
ENDIF(CPPTEST_INCLUDE_DIR)
ENDIF()
ENDIF()
ENDIF()
IF(CPPTEST_FOUND)
IF(NOT CPPTEST_FIND_QUIETLY)
MESSAGE(STATUS "Found CppTest: ${CPPTEST_LIBRARIES}")
ENDIF(NOT CPPTEST_FIND_QUIETLY)
ELSE(CPPTEST_FOUND)
ENDIF()
ELSE()
IF(NOT CPPTEST_FIND_QUIETLY)
MESSAGE(STATUS "Warning: Unable to find CppTest!")
ENDIF(NOT CPPTEST_FIND_QUIETLY)
ENDIF(CPPTEST_FOUND)
ENDIF()
ENDIF()
MARK_AS_ADVANCED(CPPTEST_LIBRARY_RELEASE CPPTEST_LIBRARY_DEBUG)

View file

@ -6,20 +6,20 @@
IF(CustomMFC_FIND_REQUIRED)
SET(MFC_FIND_REQUIRED TRUE)
ENDIF(CustomMFC_FIND_REQUIRED)
ENDIF()
IF(NOT MFC_DIR)
# If MFC have been found, remember their directory
IF(VC_DIR)
SET(MFC_STANDARD_DIR "${VC_DIR}/atlmfc")
ENDIF(VC_DIR)
ENDIF()
FIND_PATH(MFC_DIR
include/afxwin.h
HINTS
${MFC_STANDARD_DIR}
)
ENDIF(NOT MFC_DIR)
ENDIF()
# Display an error message if MFC are not found, MFC_FOUND is updated
# User will be able to update MFC_DIR to the correct directory
@ -33,15 +33,15 @@ IF(MFC_FOUND)
# Using 32 or 64 bits libraries
IF(TARGET_X64)
SET(MFC_LIBRARY_DIR "${MFC_DIR}/lib/amd64")
ELSE(TARGET_X64)
ELSE()
SET(MFC_LIBRARY_DIR "${MFC_DIR}/lib")
ENDIF(TARGET_X64)
ENDIF()
# Add MFC libraries directory to default library path
LINK_DIRECTORIES(${MFC_LIBRARY_DIR})
# Set definitions for using MFC in DLL
SET(MFC_DEFINITIONS -D_AFXDLL)
SET(MFC_DEFINITIONS -D_AFXDLL -DUNICODE -D_UNICODE)
# Set CMake flag to use MFC DLL
SET(CMAKE_MFC_FLAG 2)

View file

@ -8,7 +8,7 @@
if(DSOUND_INCLUDE_DIR)
# Already in cache, be silent
set(DSOUND_FIND_QUIETLY TRUE)
endif(DSOUND_INCLUDE_DIR)
ENDIF()
find_path(DSOUND_INCLUDE_DIR dsound.h
"$ENV{DXSDK_DIR}"
@ -29,8 +29,8 @@ find_package_handle_standard_args(DSOUND DEFAULT_MSG
if(DSOUND_FOUND)
set(DSOUND_LIBRARIES ${DSOUND_LIBRARY})
else(DSOUND_FOUND)
ELSE()
set(DSOUND_LIBRARIES)
endif(DSOUND_FOUND)
ENDIF()
mark_as_advanced(DSOUND_INCLUDE_DIR DSOUND_LIBRARY)

View file

@ -8,7 +8,7 @@
IF(DXSDK_DIR)
# Already in cache, be silent
SET(DXSDK_FIND_QUIETLY TRUE)
ENDIF(DXSDK_DIR)
ENDIF()
FIND_PATH(DXSDK_DIR
"Include/dxsdkver.h"

View file

@ -7,7 +7,7 @@
IF(EFXUTIL_LIBRARY AND EFXUTIL_INCLUDE_DIR)
# in cache already
SET(EFXUTIL_FIND_QUIETLY TRUE)
ENDIF(EFXUTIL_LIBRARY AND EFXUTIL_INCLUDE_DIR)
ENDIF()
FIND_PATH(EFXUTIL_INCLUDE_DIR
@ -42,9 +42,9 @@ IF(EFXUTIL_LIBRARY AND EFXUTIL_INCLUDE_DIR)
SET(EFXUTIL_FOUND "YES")
IF(NOT EFXUTIL_FIND_QUIETLY)
MESSAGE(STATUS "Found EFX-Util: ${EFXUTIL_LIBRARY}")
ENDIF(NOT EFXUTIL_FIND_QUIETLY)
ELSE(EFXUTIL_LIBRARY AND EFXUTIL_INCLUDE_DIR)
ENDIF()
ELSE()
IF(NOT EFXUTIL_FIND_QUIETLY)
MESSAGE(STATUS "Warning: Unable to find EFX-Util!")
ENDIF(NOT EFXUTIL_FIND_QUIETLY)
ENDIF(EFXUTIL_LIBRARY AND EFXUTIL_INCLUDE_DIR)
ENDIF()
ENDIF()

View file

@ -16,7 +16,7 @@ IF(WITH_STLPORT)
SET(EXTERNAL_TEMP_PATH ${CMAKE_CURRENT_SOURCE_DIR}/external_stlport ${CMAKE_CURRENT_SOURCE_DIR}/../external_stlport ${EXTERNAL_TEMP_PATH})
SET(EXTERNAL_TEMP_FILE "include/stlport/string")
SET(EXTERNAL_NAME "external with STLport")
ENDIF(WITH_STLPORT)
ENDIF()
FIND_PATH(EXTERNAL_PATH
${EXTERNAL_TEMP_FILE}

View file

@ -7,7 +7,7 @@
IF(FMOD_LIBRARY AND FMOD_INCLUDE_DIR)
# in cache already
SET(FMOD_FIND_QUIETLY TRUE)
ENDIF(FMOD_LIBRARY AND FMOD_INCLUDE_DIR)
ENDIF()
FIND_PATH(FMOD_INCLUDE_DIR
@ -25,9 +25,9 @@ FIND_PATH(FMOD_INCLUDE_DIR
IF(TARGET_X64)
SET(FMOD_LIBRARY_NAMES fmod64 fmod)
ELSE(TARGET_X64)
ELSE()
SET(FMOD_LIBRARY_NAMES fmodvc fmod)
ENDIF(TARGET_X64)
ENDIF()
FIND_LIBRARY(FMOD_LIBRARY
NAMES
@ -49,9 +49,9 @@ IF(FMOD_LIBRARY AND FMOD_INCLUDE_DIR)
SET(FMOD_FOUND "YES")
IF(NOT FMOD_FIND_QUIETLY)
MESSAGE(STATUS "Found FMOD: ${FMOD_LIBRARY}")
ENDIF(NOT FMOD_FIND_QUIETLY)
ELSE(FMOD_LIBRARY AND FMOD_INCLUDE_DIR)
ENDIF()
ELSE()
IF(NOT FMOD_FIND_QUIETLY)
MESSAGE(STATUS "Warning: Unable to find FMOD!")
ENDIF(NOT FMOD_FIND_QUIETLY)
ENDIF(FMOD_LIBRARY AND FMOD_INCLUDE_DIR)
ENDIF()
ENDIF()

View file

@ -7,7 +7,7 @@
IF(FREETYPE_LIBRARIES AND FREETYPE_INCLUDE_DIRS)
# in cache already
SET(Freetype_FIND_QUIETLY TRUE)
ENDIF(FREETYPE_LIBRARIES AND FREETYPE_INCLUDE_DIRS)
ENDIF()
FIND_PATH(FREETYPE_INCLUDE_DIRS
freetype
@ -24,7 +24,7 @@ FIND_PATH(FREETYPE_INCLUDE_DIRS
IF(NOT FREETYPE_INCLUDE_DIRS)
SET(FREETYPE_INCLUDE_DIRS "")
ENDIF(NOT FREETYPE_INCLUDE_DIRS)
ENDIF()
# ft2build.h does not reside in the freetype include dir
FIND_PATH(FREETYPE_ADDITIONAL_INCLUDE_DIR
@ -42,7 +42,7 @@ FIND_PATH(FREETYPE_ADDITIONAL_INCLUDE_DIR
# combine both include directories into one variable
IF(FREETYPE_ADDITIONAL_INCLUDE_DIR)
SET(FREETYPE_INCLUDE_DIRS ${FREETYPE_INCLUDE_DIRS} ${FREETYPE_ADDITIONAL_INCLUDE_DIR})
ENDIF(FREETYPE_ADDITIONAL_INCLUDE_DIR)
ENDIF()
FIND_LIBRARY(FREETYPE_LIBRARY_RELEASE
NAMES freetype libfreetype freetype219 freetype246
@ -89,8 +89,8 @@ IF(FREETYPE_INCLUDE_DIRS)
# Case where Freetype is compiled from sources (debug version is compiled by default)
SET(FREETYPE_FOUND ON)
SET(FREETYPE_LIBRARIES ${FREETYPE_LIBRARY_DEBUG})
ENDIF(FREETYPE_LIBRARY_RELEASE AND FREETYPE_LIBRARY_DEBUG)
ENDIF(FREETYPE_INCLUDE_DIRS)
ENDIF()
ENDIF()
IF(FREETYPE_FOUND)
IF(WITH_STATIC_EXTERNAL AND APPLE)
@ -98,13 +98,13 @@ IF(FREETYPE_FOUND)
IF(BZIP2_FOUND)
SET(FREETYPE_INCLUDE_DIRS ${FREETYPE_INCLUDE_DIRS} ${BZIP2_INCLUDE_DIR})
SET(FREETYPE_LIBRARIES ${FREETYPE_LIBRARIES} ${BZIP2_LIBRARIES})
ENDIF(BZIP2_FOUND)
ENDIF(WITH_STATIC_EXTERNAL AND APPLE)
ENDIF()
ENDIF()
IF(NOT Freetype_FIND_QUIETLY)
MESSAGE(STATUS "Found FreeType: ${FREETYPE_LIBRARIES}")
ENDIF(NOT Freetype_FIND_QUIETLY)
ELSE(FREETYPE_LIBRARY AND FREETYPE_INCLUDE_DIRS)
ENDIF()
ELSE()
IF(NOT Freetype_FIND_QUIETLY)
MESSAGE(STATUS "Warning: Unable to find FreeType!")
ENDIF(NOT Freetype_FIND_QUIETLY)
ENDIF(FREETYPE_FOUND)
ENDIF()
ENDIF()

View file

@ -20,7 +20,7 @@ FIND_LIBRARY(ICONV_LIBRARIES NAMES iconv libiconv c PATHS /opt/local)
IF(ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
SET(ICONV_FOUND TRUE)
ENDIF(ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
ENDIF()
set(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_DIR})
set(CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARIES})
@ -29,7 +29,7 @@ IF(ICONV_FOUND)
set (CMAKE_C_FLAGS_BACKUP "${CMAKE_C_FLAGS}")
if(ICONV_HAVE_WERROR)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")
endif(ICONV_HAVE_WERROR)
ENDIF()
check_c_source_compiles("
#include <iconv.h>
int main(){
@ -43,19 +43,19 @@ IF(ICONV_FOUND)
}
" ICONV_SECOND_ARGUMENT_IS_CONST )
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS_BACKUP}")
ENDIF(ICONV_FOUND)
ENDIF()
set(CMAKE_REQUIRED_INCLUDES)
set(CMAKE_REQUIRED_LIBRARIES)
IF(ICONV_FOUND)
IF(NOT ICONV_FIND_QUIETLY)
MESSAGE(STATUS "Found Iconv: ${ICONV_LIBRARIES}")
ENDIF(NOT ICONV_FIND_QUIETLY)
ELSE(ICONV_FOUND)
ENDIF()
ELSE()
IF(Iconv_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find Iconv")
ENDIF(Iconv_FIND_REQUIRED)
ENDIF(ICONV_FOUND)
ENDIF()
ENDIF()
MARK_AS_ADVANCED(
ICONV_INCLUDE_DIR

View file

@ -7,7 +7,7 @@
IF(JPEG_LIBRARY AND JPEG_INCLUDE_DIR)
# in cache already
SET(JPEG_FIND_QUIETLY TRUE)
ENDIF(JPEG_LIBRARY AND JPEG_INCLUDE_DIR)
ENDIF()
FIND_PATH(JPEG_INCLUDE_DIR
@ -42,9 +42,9 @@ IF(JPEG_LIBRARY AND JPEG_INCLUDE_DIR)
SET(JPEG_FOUND "YES")
IF(NOT JPEG_FIND_QUIETLY)
MESSAGE(STATUS "Found Jpeg: ${JPEG_LIBRARY}")
ENDIF(NOT JPEG_FIND_QUIETLY)
ELSE(JPEG_LIBRARY AND JPEG_INCLUDE_DIR)
ENDIF()
ELSE()
IF(NOT JPEG_FIND_QUIETLY)
MESSAGE(STATUS "Warning: Unable to find Jpeg!")
ENDIF(NOT JPEG_FIND_QUIETLY)
ENDIF(JPEG_LIBRARY AND JPEG_INCLUDE_DIR)
ENDIF()
ENDIF()

View file

@ -7,10 +7,11 @@
IF(LIBOVR_LIBRARIES AND LIBOVR_INCLUDE_DIR)
# in cache already
SET(LIBOVR_FIND_QUIETLY TRUE)
ENDIF(LIBOVR_LIBRARIES AND LIBOVR_INCLUDE_DIR)
ENDIF()
FIND_PATH(LIBOVR_INCLUDE_DIR
OVR.h
NAMES
OVR.h OVR_CAPI.h
PATHS
$ENV{LIBOVR_DIR}/Include
/usr/local/include
@ -24,18 +25,18 @@ FIND_PATH(LIBOVR_INCLUDE_DIR
IF(UNIX)
IF(TARGET_X64)
SET(LIBOVR_LIBRARY_BUILD_PATH "Lib/Linux/Release/x86_64")
ELSE(TARGET_X64)
ELSE()
SET(LIBOVR_LIBRARY_BUILD_PATH "Lib/Linux/Release/i386")
ENDIF(TARGET_X64)
ENDIF()
ELSEIF(APPLE)
SET(LIBOVR_LIBRARY_BUILD_PATH "Lib/MacOS/Release")
ELSEIF(WIN32)
IF(TARGET_X64)
SET(LIBOVR_LIBRARY_BUILD_PATH "Lib/x64")
ELSE(TARGET_X64)
ELSE()
SET(LIBOVR_LIBRARY_BUILD_PATH "Lib/Win32")
ENDIF(TARGET_X64)
ENDIF(UNIX)
ENDIF()
ENDIF()
FIND_LIBRARY(LIBOVR_LIBRARY
NAMES ovr libovr
@ -55,17 +56,17 @@ FIND_LIBRARY(LIBOVR_LIBRARY
IF(LIBOVR_LIBRARY AND LIBOVR_INCLUDE_DIR)
IF(NOT LIBOVR_FIND_QUIETLY)
MESSAGE(STATUS "Found LibOVR: ${LIBOVR_LIBRARY}")
ENDIF(NOT LIBOVR_FIND_QUIETLY)
ENDIF()
SET(LIBOVR_FOUND "YES")
SET(LIBOVR_DEFINITIONS "-DHAVE_LIBOVR")
SET(NL_STEREO_AVAILABLE ON)
IF(UNIX)
SET(LIBOVR_LIBRARIES ${LIBOVR_LIBRARY} X11 Xinerama udev pthread)
ELSE(UNIX)
ELSE()
SET(LIBOVR_LIBRARIES ${LIBOVR_LIBRARY})
ENDIF(UNIX)
ELSE(LIBOVR_LIBRARY AND LIBOVR_INCLUDE_DIR)
ENDIF()
ELSE()
IF(NOT LIBOVR_FIND_QUIETLY)
MESSAGE(STATUS "Warning: Unable to find LibOVR!")
ENDIF(NOT LIBOVR_FIND_QUIETLY)
ENDIF(LIBOVR_LIBRARY AND LIBOVR_INCLUDE_DIR)
ENDIF()
ENDIF()

View file

@ -7,7 +7,7 @@
IF(LIBVR_LIBRARIES AND LIBVR_INCLUDE_DIR)
# in cache already
SET(LIBVR_FIND_QUIETLY TRUE)
ENDIF(LIBVR_LIBRARIES AND LIBVR_INCLUDE_DIR)
ENDIF()
FIND_PATH(LIBVR_INCLUDE_DIR hmd.h
PATH_SUFFIXES include/LibVR
@ -22,12 +22,12 @@ FIND_LIBRARY(LIBVR_LIBRARY
IF(LIBVR_LIBRARY AND LIBVR_INCLUDE_DIR)
IF(NOT LIBVR_FIND_QUIETLY)
MESSAGE(STATUS "Found LibVR: ${LIBVR_LIBRARY}")
ENDIF(NOT LIBVR_FIND_QUIETLY)
ENDIF()
SET(LIBVR_FOUND "YES")
SET(LIBVR_DEFINITIONS "-DHAVE_LIBVR")
SET(NL_STEREO_AVAILABLE ON)
ELSE(LIBVR_LIBRARY AND LIBVR_INCLUDE_DIR)
ELSE()
IF(NOT LIBVR_FIND_QUIETLY)
MESSAGE(STATUS "Warning: Unable to find LibVR!")
ENDIF(NOT LIBVR_FIND_QUIETLY)
ENDIF(LIBVR_LIBRARY AND LIBVR_INCLUDE_DIR)
ENDIF()
ENDIF()

View file

@ -143,7 +143,7 @@ ENDIF()
IF(WITH_STLPORT)
LIST(APPEND LIBRARY_NAME_RELEASE luabind_stlport)
LIST(APPEND LIBRARY_NAME_DEBUG luabind_stlportd)
ENDIF(WITH_STLPORT)
ENDIF()
# generic libraries names
LIST(APPEND LIBRARY_NAME_RELEASE luabind libluabind)
@ -194,7 +194,7 @@ IF(LUABIND_INCLUDE_DIR AND Boost_INCLUDE_DIR)
# Case where Luabind is compiled from sources (debug version is compiled by default)
SET(LUABIND_FOUND TRUE)
SET(LUABIND_LIBRARIES ${LUABIND_LIBRARY_DEBUG})
ENDIF(LUABIND_LIBRARY_RELEASE AND LUABIND_LIBRARY_DEBUG)
ENDIF()
ENDIF()
IF(LUABIND_FOUND)
@ -209,11 +209,11 @@ IF(LUABIND_FOUND)
IF(NOT Luabind_FIND_QUIETLY)
MESSAGE(STATUS "Found Luabind: ${LUABIND_LIBRARIES}")
ENDIF(NOT Luabind_FIND_QUIETLY)
ENDIF()
ELSE()
IF(NOT Luabind_FIND_QUIETLY)
MESSAGE(STATUS "Warning: Unable to find Luabind!")
ENDIF()
ENDIF(LUABIND_FOUND)
ENDIF()
MARK_AS_ADVANCED(LUABIND_LIBRARY_RELEASE LUABIND_LIBRARY_DEBUG Boost_LIB_DIAGNOSTIC_DEFINITIONS)

View file

@ -5,6 +5,24 @@
# VC_LIBRARY_DIR - where to find libraries
# VC_FOUND - True if MSVC found.
MACRO(ADD_TRAILING_SLASH _FILENAME_VAR)
# put content in a new variable
SET(_FILENAME ${${_FILENAME_VAR}})
# get length of the string
STRING(LENGTH ${_FILENAME} _LEN)
# convert length to last pos
MATH(EXPR _POS "${_LEN}-1")
# get last character of the string
STRING(SUBSTRING ${_FILENAME} ${_POS} 1 _FILENAME_END)
# compare it with a slash
IF(NOT _FILENAME_END STREQUAL "/")
# not a slash, append it
SET(${_FILENAME_VAR} "${_FILENAME}/")
ELSE()
# already a slash
ENDIF()
ENDMACRO()
MACRO(DETECT_VC_VERSION_HELPER _ROOT _VERSION)
# Software/Wow6432Node/...
GET_FILENAME_COMPONENT(VC${_VERSION}_DIR "[${_ROOT}\\SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VC7;${_VERSION}]" ABSOLUTE)
@ -12,7 +30,11 @@ MACRO(DETECT_VC_VERSION_HELPER _ROOT _VERSION)
IF(VC${_VERSION}_DIR AND VC${_VERSION}_DIR STREQUAL "/registry")
SET(VC${_VERSION}_DIR)
GET_FILENAME_COMPONENT(VC${_VERSION}_DIR "[${_ROOT}\\SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VS7;${_VERSION}]" ABSOLUTE)
IF(VC${_VERSION}_DIR AND NOT VC${_VERSION}_DIR STREQUAL "/registry")
# be sure it's finishing by a /
ADD_TRAILING_SLASH(VC${_VERSION}_DIR)
SET(VC${_VERSION}_DIR "${VC${_VERSION}_DIR}VC/")
ENDIF()
ENDIF()
@ -34,16 +56,18 @@ MACRO(DETECT_VC_VERSION_HELPER _ROOT _VERSION)
ENDMACRO()
MACRO(DETECT_VC_VERSION _VERSION)
SET(VC${_VERSION}_FOUND OFF)
DETECT_VC_VERSION_HELPER("HKEY_CURRENT_USER" ${_VERSION})
IF(NOT VC_FOUND)
SET(VC${_VERSION}_FOUND OFF)
DETECT_VC_VERSION_HELPER("HKEY_CURRENT_USER" ${_VERSION})
IF(NOT VC${_VERSION}_FOUND)
DETECT_VC_VERSION_HELPER("HKEY_LOCAL_MACHINE" ${_VERSION})
ENDIF()
IF(NOT VC${_VERSION}_FOUND)
DETECT_VC_VERSION_HELPER("HKEY_LOCAL_MACHINE" ${_VERSION})
ENDIF()
IF(VC${_VERSION}_FOUND)
SET(VC_FOUND ON)
SET(VC_DIR "${VC${_VERSION}_DIR}")
IF(VC${_VERSION}_FOUND)
SET(VC_FOUND ON)
SET(VC_DIR "${VC${_VERSION}_DIR}")
ENDIF()
ENDIF()
ENDMACRO()
@ -55,30 +79,39 @@ MACRO(DETECT_EXPRESS_VERSION _VERSION)
ENDIF()
ENDMACRO()
IF(MSVC12)
IF(MSVC_VERSION GREATER 1909)
DETECT_VC_VERSION("15.0")
SET(MSVC_TOOLSET "140")
SET(VC_DIR "${VC_DIR}Tools/MSVC")
FILE(GLOB MSVC_TOOLCHAIN_VERSIONS RELATIVE ${VC_DIR} "${VC_DIR}/*")
IF(MSVC_TOOLCHAIN_VERSIONS)
LIST(SORT MSVC_TOOLCHAIN_VERSIONS)
LIST(REVERSE MSVC_TOOLCHAIN_VERSIONS)
ENDIF()
IF(NOT MSVC_TOOLCHAIN_VERSIONS)
MESSAGE(FATAL_ERROR "No MSVC version found in default search path ${VC_DIR}")
ENDIF()
LIST(GET MSVC_TOOLCHAIN_VERSIONS 0 MSVC_TOOLCHAIN_VERSION)
SET(VC_DIR "${VC_DIR}/${MSVC_TOOLCHAIN_VERSION}")
SET(VC_INCLUDE_DIR "${VC_DIR}/include")
ELSEIF(MSVC14)
DETECT_VC_VERSION("14.0")
SET(MSVC_TOOLSET "140")
ELSEIF(MSVC12)
DETECT_VC_VERSION("12.0")
SET(MSVC_TOOLSET "120")
IF(NOT MSVC12_REDIST_DIR)
# If you have VC++ 2013 Express, put x64/Microsoft.VC120.CRT/*.dll in ${EXTERNAL_PATH}/redist
SET(MSVC12_REDIST_DIR "${EXTERNAL_PATH}/redist")
ENDIF()
ELSEIF(MSVC11)
DETECT_VC_VERSION("11.0")
SET(MSVC_TOOLSET "110")
IF(NOT MSVC11_REDIST_DIR)
# If you have VC++ 2012 Express, put x64/Microsoft.VC110.CRT/*.dll in ${EXTERNAL_PATH}/redist
SET(MSVC11_REDIST_DIR "${EXTERNAL_PATH}/redist")
ENDIF()
ELSEIF(MSVC10)
DETECT_VC_VERSION("10.0")
SET(MSVC_TOOLSET "100")
IF(NOT MSVC10_REDIST_DIR)
# If you have VC++ 2010 Express, put x64/Microsoft.VC100.CRT/*.dll in ${EXTERNAL_PATH}/redist
SET(MSVC10_REDIST_DIR "${EXTERNAL_PATH}/redist")
ENDIF()
ELSEIF(MSVC90)
DETECT_VC_VERSION("9.0")
SET(MSVC_TOOLSET "90")
@ -90,6 +123,8 @@ ENDIF()
# If you plan to use VC++ compilers with WINE, set VC_DIR environment variable
IF(NOT VC_DIR)
SET(VC_DIR $ENV{VC_DIR})
# Fix path
FILE(TO_CMAKE_PATH ${VC_DIR} VC_DIR)
ENDIF()
IF(NOT VC_DIR)
@ -98,9 +133,50 @@ IF(NOT VC_DIR)
ELSE()
SET(_COMPILER ${CMAKE_C_COMPILER})
ENDIF()
STRING(REGEX REPLACE "/bin/.+" "" VC_DIR ${_COMPILER})
STRING(REGEX REPLACE "/(bin|BIN|Bin)/.+" "" VC_DIR ${_COMPILER})
ENDIF()
SET(VC_INCLUDE_DIR "${VC_DIR}/include")
IF(NOT VC_INCLUDE_DIR AND VC_DIR AND EXISTS "${VC_DIR}")
SET(VC_INCLUDE_DIR "${VC_DIR}/include")
IF(EXISTS "${VC_INCLUDE_DIR}")
SET(VC_FOUND ON)
ENDIF()
ENDIF()
SET(MSVC_REDIST_DIR "${EXTERNAL_PATH}/redist")
IF(NOT EXISTS "${MSVC_REDIST_DIR}")
SET(MSVC_REDIST_DIR "${VC_DIR}/redist")
IF(NOT EXISTS "${MSVC_REDIST_DIR}")
SET(MSVC_REDIST_DIR)
ENDIF()
ENDIF()
IF(MSVC_REDIST_DIR)
IF(MSVC1411 OR MSVC1410)
# If you have VC++ 2017 Express, put x64/Microsoft.VC141.CRT/*.dll in ${EXTERNAL_PATH}/redist
# original files whould be in ${VC_DIR}/Redist/MSVC/14.11.25325/x64/Microsoft.VC141.CRT
SET(MSVC14_REDIST_DIR "${MSVC_REDIST_DIR}")
ELSEIF(MSVC14)
SET(MSVC14_REDIST_DIR "${MSVC_REDIST_DIR}")
ELSEIF(MSVC12)
# If you have VC++ 2013 Express, put x64/Microsoft.VC120.CRT/*.dll in ${EXTERNAL_PATH}/redist
SET(MSVC12_REDIST_DIR "${MSVC_REDIST_DIR}")
ELSEIF(MSVC11)
# If you have VC++ 2012 Express, put x64/Microsoft.VC110.CRT/*.dll in ${EXTERNAL_PATH}/redist
SET(MSVC11_REDIST_DIR "${MSVC_REDIST_DIR}")
ELSEIF(MSVC10)
# If you have VC++ 2010 Express, put x64/Microsoft.VC100.CRT/*.dll in ${EXTERNAL_PATH}/redist
SET(MSVC10_REDIST_DIR "${MSVC_REDIST_DIR}")
ELSEIF(MSVC90)
SET(MSVC90_REDIST_DIR "${MSVC_REDIST_DIR}")
ELSEIF(MSVC80)
SET(MSVC80_REDIST_DIR "${MSVC_REDIST_DIR}")
ENDIF()
ENDIF()
MESSAGE(STATUS "Using headers from ${VC_INCLUDE_DIR}")
SET(VC_INCLUDE_DIRS ${VC_INCLUDE_DIR})
INCLUDE_DIRECTORIES(${VC_INCLUDE_DIR})

View file

@ -60,12 +60,12 @@ IF(Mercurial_HG_EXECUTABLE)
EXECUTE_PROCESS(COMMAND ${Mercurial_HG_EXECUTABLE} --version
OUTPUT_VARIABLE Mercurial_VERSION_HG
OUTPUT_STRIP_TRAILING_WHITESPACE)
STRING(REGEX REPLACE ".*version ([\\.0-9]+).*"
"\\1" Mercurial_VERSION_HG "${Mercurial_VERSION_HG}")
MACRO(Mercurial_WC_INFO dir prefix)
EXECUTE_PROCESS(COMMAND ${Mercurial_HG_EXECUTABLE} tip --template "{rev};{node};{tags};{author}"
EXECUTE_PROCESS(COMMAND ${Mercurial_HG_EXECUTABLE} log -r . --template "{rev};{node};{tags};{author}"
WORKING_DIRECTORY ${dir}
OUTPUT_VARIABLE ${prefix}_WC_INFO
ERROR_VARIABLE Mercurial_hg_info_error
@ -73,7 +73,7 @@ IF(Mercurial_HG_EXECUTABLE)
OUTPUT_STRIP_TRAILING_WHITESPACE)
IF(NOT ${Mercurial_hg_info_result} EQUAL 0)
MESSAGE(SEND_ERROR "Command \"${Mercurial_HG_EXECUTABLE} tip\" failed with output:\n${Mercurial_hg_info_error}")
MESSAGE(SEND_ERROR "Command \"${Mercurial_HG_EXECUTABLE} log\" failed with output:\n${Mercurial_hg_info_error}")
ELSE()
LIST(LENGTH ${prefix}_WC_INFO _COUNT)
IF(_COUNT EQUAL 4)

View file

@ -69,6 +69,9 @@ ELSE()
ENDIF()
FIND_PACKAGE(OpenSSL)
IF(OPENSSL_FOUND)
IF(WIN32)
SET(OPENSSL_LIBRARIES ${OPENSSL_LIBRARIES} Crypt32.lib)
ENDIF()
SET(MYSQL_LIBRARIES ${MYSQL_LIBRARIES} ${OPENSSL_LIBRARIES})
ENDIF()
ENDIF()

View file

@ -7,7 +7,7 @@
IF(OGG_LIBRARY AND OGG_INCLUDE_DIR)
# in cache already
SET(OGG_FIND_QUIETLY TRUE)
ENDIF(OGG_LIBRARY AND OGG_INCLUDE_DIR)
ENDIF()
FIND_PATH(OGG_INCLUDE_DIR
@ -41,9 +41,9 @@ IF(OGG_LIBRARY AND OGG_INCLUDE_DIR)
SET(OGG_FOUND "YES")
IF(NOT OGG_FIND_QUIETLY)
MESSAGE(STATUS "Found Ogg: ${OGG_LIBRARY}")
ENDIF(NOT OGG_FIND_QUIETLY)
ELSE(OGG_LIBRARY AND OGG_INCLUDE_DIR)
ENDIF()
ELSE()
IF(NOT OGG_FIND_QUIETLY)
MESSAGE(STATUS "Warning: Unable to find Ogg!")
ENDIF(NOT OGG_FIND_QUIETLY)
ENDIF(OGG_LIBRARY AND OGG_INCLUDE_DIR)
ENDIF()
ENDIF()

View file

@ -43,7 +43,7 @@ IF(OPENGLES_GLES_LIBRARY)
IF(OPENGLES_EGL_LIBRARY)
SET(OPENGLES_EGL_FOUND "YES")
SET(OPENGLES_LIBRARIES ${OPENGLES_EGL_LIBRARY} ${OPENGLES_LIBRARIES})
ELSE(OPENGLES_EGL_LIBRARY)
ELSE()
SET(OPENGLES_EGL_FOUND "NO")
ENDIF(OPENGLES_EGL_LIBRARY)
ENDIF(OPENGLES_GLES_LIBRARY)
ENDIF()
ENDIF()

View file

@ -9,7 +9,7 @@
IF(STLPORT_LIBRARIES AND STLPORT_INCLUDE_DIR)
# in cache already
SET(STLPORT_FIND_QUIETLY TRUE)
ENDIF(STLPORT_LIBRARIES AND STLPORT_INCLUDE_DIR)
ENDIF()
FIND_PATH(STLPORT_INCLUDE_DIR
iostream
@ -74,18 +74,18 @@ IF(STLPORT_INCLUDE_DIR)
SET(STLPORT_LIBRARIES ${STLPORT_LIBRARY_RELEASE})
IF(STLPORT_LIBRARY_DEBUG)
SET(STLPORT_LIBRARIES optimized ${STLPORT_LIBRARIES} debug ${STLPORT_LIBRARY_DEBUG})
ENDIF(STLPORT_LIBRARY_DEBUG)
ENDIF(STLPORT_LIBRARY_RELEASE)
ENDIF(STLPORT_INCLUDE_DIR)
ENDIF()
ENDIF()
ENDIF()
IF(STLPORT_FOUND)
IF(NOT STLPORT_FIND_QUIETLY)
MESSAGE(STATUS "Found STLport: ${STLPORT_LIBRARIES}")
ENDIF(NOT STLPORT_FIND_QUIETLY)
ELSE(STLPORT_FOUND)
ENDIF()
ELSE()
IF(NOT STLPORT_FIND_QUIETLY)
MESSAGE(STATUS "Warning: Unable to find STLport!")
ENDIF(NOT STLPORT_FIND_QUIETLY)
ENDIF(STLPORT_FOUND)
ENDIF()
ENDIF()
MARK_AS_ADVANCED(STLPORT_LIBRARY_RELEASE STLPORT_LIBRARY_DEBUG)

View file

@ -10,7 +10,7 @@
IF(SQUISH_LIBRARIES AND SQUISH_INCLUDE_DIR)
# in cache already
SET(SQUISH_FIND_QUIETLY TRUE)
ENDIF(SQUISH_LIBRARIES AND SQUISH_INCLUDE_DIR)
ENDIF()
FIND_PATH(SQUISH_INCLUDE_DIR
squish.h
@ -58,26 +58,26 @@ IF(SQUISH_INCLUDE_DIR)
SET(SQUISH_LIBRARIES "optimized;${SQUISH_LIBRARY_RELEASE}")
IF(SQUISH_LIBRARY_DEBUG)
SET(SQUISH_LIBRARIES "${SQUISH_LIBRARIES};debug;${SQUISH_LIBRARY_DEBUG}")
ELSE(SQUISH_LIBRARY_DEBUG)
ELSE()
SET(SQUISH_LIBRARIES "${SQUISH_LIBRARIES};debug;${SQUISH_LIBRARY_RELEASE}")
MESSAGE("Debug Squish NOT found, using the release version!")
ENDIF(SQUISH_LIBRARY_DEBUG)
ENDIF(SQUISH_LIBRARY_RELEASE)
ENDIF(SQUISH_INCLUDE_DIR)
ENDIF()
ENDIF()
ENDIF()
IF(SQUISH_FOUND)
IF(NOT SQUISH_FIND_QUIETLY)
MESSAGE(STATUS "Found Squish: ${SQUISH_LIBRARIES}")
ENDIF(NOT SQUISH_FIND_QUIETLY)
ENDIF()
FILE(STRINGS ${SQUISH_INCLUDE_DIR}/squish.h METRIC REGEX "metric = 0")
IF(METRIC)
SET(SQUISH_COMPRESS_HAS_METRIC ON)
SET(SQUISH_DEFINITIONS -DSQUISH_COMPRESS_HAS_METRIC)
ENDIF(METRIC)
ELSE(SQUISH_FOUND)
ENDIF()
ELSE()
IF(NOT SQUISH_FIND_QUIETLY)
MESSAGE(STATUS "Warning: Unable to find Squish!")
ENDIF(NOT SQUISH_FIND_QUIETLY)
ENDIF(SQUISH_FOUND)
ENDIF()
ENDIF()
MARK_AS_ADVANCED(SQUISH_LIBRARY_RELEASE SQUISH_LIBRARY_DEBUG)

View file

@ -7,7 +7,7 @@
IF(VORBIS_LIBRARY AND VORBIS_INCLUDE_DIR)
# in cache already
SET(VORBIS_FIND_QUIETLY TRUE)
ENDIF(VORBIS_LIBRARY AND VORBIS_INCLUDE_DIR)
ENDIF()
FIND_PATH(VORBIS_INCLUDE_DIR
@ -57,9 +57,9 @@ IF(VORBIS_LIBRARY AND VORBISFILE_LIBRARY AND VORBIS_INCLUDE_DIR)
SET(VORBIS_LIBRARIES ${VORBIS_LIBRARY} ${VORBISFILE_LIBRARY})
IF(NOT VORBIS_FIND_QUIETLY)
MESSAGE(STATUS "Found Vorbis: ${VORBIS_LIBRARY}")
ENDIF(NOT VORBIS_FIND_QUIETLY)
ELSE(VORBIS_LIBRARY AND VORBISFILE_LIBRARY AND VORBIS_INCLUDE_DIR)
ENDIF()
ELSE()
IF(NOT VORBIS_FIND_QUIETLY)
MESSAGE(STATUS "Warning: Unable to find Vorbis!")
ENDIF(NOT VORBIS_FIND_QUIETLY)
ENDIF(VORBIS_LIBRARY AND VORBISFILE_LIBRARY AND VORBIS_INCLUDE_DIR)
ENDIF()
ENDIF()

View file

@ -35,7 +35,7 @@ MACRO(DETECT_WINKIT_VERSION _VERSION _SUFFIX)
SET(WINSDK${_VERSION}_FOUND ON)
SET(WINSDK${_VERSION}_VERSION_FULL "${_VERSION}")
IF(NOT WindowsSDK_FIND_QUIETLY)
MESSAGE(STATUS "Found Windows SDK ${_VERSION} in ${WINSDK${_VERSION}_DIR}")
MESSAGE(STATUS "Found Windows Kit ${_VERSION} in ${WINSDK${_VERSION}_DIR}")
ENDIF()
LIST(APPEND WINSDK_DETECTED_VERSIONS ${_VERSION})
ELSE()
@ -240,7 +240,11 @@ MACRO(USE_CURRENT_WINSDK)
IF(NOT WINSDK_DIR)
# Use Windows SDK versions installed with VC++ when possible
IF(MSVC14)
IF(MSVC_VERSION GREATER 1909)
# Special case, use Kits for SDK
SET(WINSDK_VERSION "10.0")
SET(WINSDK_DIR ${WINSDK_UCRT_DIR})
ELSEIF(MSVC14)
SET(WINSDK_VERSION "8.1")
ELSEIF(MSVC12)
SET(WINSDK_VERSION "8.1")
@ -255,8 +259,19 @@ MACRO(USE_CURRENT_WINSDK)
SET(WINSDK_VERSION "6.0A")
ENDIF()
ELSEIF(MSVC80)
IF(NOT MSVC_EXPRESS)
# TODO: fix this version
SET(WINSDK_MSVC80_COMPATIBLES "7.1" "7.1A" "7.0" "7.0A" "6.1" "6.0" "6.0A" "5.2A")
# look for each Windows SDK supported by VC++ 2005 (7.1 is the latest)
FOREACH(_VERSION ${WINSDK_DETECTED_VERSIONS})
# look if this version of Windows SDK is installed
LIST(FIND WINSDK_MSVC80_COMPATIBLES ${_VERSION} _FOUND)
IF(NOT _FOUND EQUAL -1)
SET(WINSDK_VERSION "${_VERSION}")
BREAK()
ENDIF()
ENDFOREACH()
IF(NOT MSVC_EXPRESS AND NOT WINSDK_VERSION)
SET(WINSDK_VERSION "5.2A")
ENDIF()
ELSE()
@ -294,7 +309,7 @@ MACRO(USE_CURRENT_WINSDK)
ENDMACRO()
IF(MSVC14)
# Under VC++ 2015, stdio.h, stdlib.h, etc... are part of UCRT
# Under VC++ 2015 and 2017, stdio.h, stdlib.h, etc... are part of UCRT
SET(WINSDK_UCRT_VERSION "10.0")
ENDIF()
@ -303,6 +318,40 @@ IF(WINSDK_UCRT_VERSION AND WINSDK${WINSDK_UCRT_VERSION}_FOUND)
SET(WINSDK_UCRT_DIR "${WINSDK${WINSDK_UCRT_VERSION}_DIR}")
ENDIF()
IF(WINSDK_UCRT_DIR)
# determine exact UCRT version
SET(WINSDK_UCRT_INCLUDE_ROOT_DIR ${WINSDK_UCRT_DIR}/Include)
SET(WINSDK_UCRT_LIB_ROOT_DIR ${WINSDK_UCRT_DIR}/Lib)
FILE(GLOB UCRT_SUBDIRS RELATIVE ${WINSDK_UCRT_INCLUDE_ROOT_DIR} ${WINSDK_UCRT_INCLUDE_ROOT_DIR}/*)
SET(UCRT_VERSION)
FOREACH(UCRT_SUBDIR ${UCRT_SUBDIRS})
IF(NOT UCRT_VERSION OR UCRT_SUBDIR VERSION_GREATER UCRT_VERSION)
SET(UCRT_VERSION ${UCRT_SUBDIR})
ENDIF()
ENDFOREACH()
IF(UCRT_VERSION)
MESSAGE(STATUS "Using Windows UCRT ${UCRT_VERSION}")
SET(WINSDK10_INCLUDE_DIR ${WINSDK_UCRT_INCLUDE_ROOT_DIR}/${UCRT_VERSION})
SET(WINSDK10_LIBRARY_DIR ${WINSDK_UCRT_LIB_ROOT_DIR}/${UCRT_VERSION})
# directory where UCRT headers are found
FIND_PATH(WINSDK_UCRT_INCLUDE_DIR corecrt.h
HINTS
${WINSDK10_INCLUDE_DIR}/ucrt
)
# directory where UCRT libraries are found
FIND_PATH(WINSDK_UCRT_LIBRARY_DIR ucrt.lib
HINTS
${WINSDK10_LIBRARY_DIR}/ucrt/${WINSDK8_SUFFIX}
)
ENDIF()
ENDIF()
IF(WINSDK_VERSION STREQUAL "CURRENT")
USE_CURRENT_WINSDK()
ELSE()
@ -323,93 +372,87 @@ ENDIF()
# directory where Win32 headers are found
FIND_PATH(WINSDK_INCLUDE_DIR Windows.h
HINTS
${WINSDK_DIR}/Include/${UCRT_VERSION}/um
${WINSDK_DIR}/Include/um
${WINSDK_DIR}/Include
NO_DEFAULT_PATH
)
MESSAGE(STATUS "Found Windows.h in ${WINSDK_INCLUDE_DIR}")
# directory where WinRT headers are found
FIND_PATH(WINSDK_WINRT_INCLUDE_DIR winstring.h
HINTS
${WINSDK_DIR}/Include/${UCRT_VERSION}/winrt
${WINSDK_DIR}/Include/winrt
NO_DEFAULT_PATH
)
MESSAGE(STATUS "Found winstring.h in ${WINSDK_WINRT_INCLUDE_DIR}")
# directory where DirectX headers are found
FIND_PATH(WINSDK_SHARED_INCLUDE_DIR d3d9.h
HINTS
${WINSDK_DIR}/Include/${UCRT_VERSION}/shared
${WINSDK_DIR}/Include/shared
NO_DEFAULT_PATH
)
MESSAGE(STATUS "Found d3d9.h in ${WINSDK_SHARED_INCLUDE_DIR}")
# directory where OpenGL headers are found
FIND_PATH(WINSDK_OPENGL_INCLUDE_DIR GL.h
HINTS
${WINSDK_INCLUDE_DIR}/gl
${WINSDK_DIR}/Include/um/gl
${WINSDK_DIR}/Include/gl
NO_DEFAULT_PATH
)
MESSAGE(STATUS "Found GL.h in ${WINSDK_OPENGL_INCLUDE_DIR}")
SET(WINSDK_LIBRARY_DIRS
${WINSDK_DIR}/Lib/${UCRT_VERSION}/um/${WINSDK8_SUFFIX}
${WINSDK_DIR}/Lib/winv6.3/um/${WINSDK8_SUFFIX}
${WINSDK_DIR}/Lib/win8/um/${WINSDK8_SUFFIX}
)
IF(WINSDK_SUFFIXES)
FOREACH(_SUFFIX ${WINSDK_SUFFIXES})
SET(WINSDK_LIBRARY_DIRS ${WINSDK_LIBRARY_DIRS} ${WINSDK_DIR}/Lib/${_SUFFIX})
LIST(APPEND WINSDK_LIBRARY_DIRS ${WINSDK_DIR}/Lib/${_SUFFIX})
ENDFOREACH()
ELSE()
SET(WINSDK_LIBRARY_DIRS ${WINSDK_LIBRARY_DIRS} ${WINSDK_DIR}/Lib)
LIST(APPEND WINSDK_LIBRARY_DIRS ${WINSDK_DIR}/Lib)
ENDIF()
# directory where all libraries are found
FIND_PATH(WINSDK_LIBRARY_DIR ComCtl32.lib
HINTS
${WINSDK_LIBRARY_DIRS}
NO_DEFAULT_PATH
)
IF(WINSDK_UCRT_DIR)
# determine exact UCRT version
SET(WINSDK_UCRT_INCLUDE_ROOT_DIR ${WINSDK_UCRT_DIR}/Include)
SET(WINSDK_UCRT_LIB_ROOT_DIR ${WINSDK_UCRT_DIR}/Lib)
MESSAGE(STATUS "Found ComCtl32.lib in ${WINSDK_LIBRARY_DIR}")
FILE(GLOB UCRT_SUBDIRS RELATIVE ${WINSDK_UCRT_INCLUDE_ROOT_DIR} ${WINSDK_UCRT_INCLUDE_ROOT_DIR}/*)
SET(UCRT_VERSION)
FOREACH(UCRT_SUBDIR ${UCRT_SUBDIRS})
IF(NOT UCRT_VERSION OR UCRT_SUBDIR VERSION_GREATER UCRT_VERSION)
SET(UCRT_VERSION ${UCRT_SUBDIR})
ENDIF()
ENDFOREACH()
IF(UCRT_VERSION)
MESSAGE(STATUS "Using Windows UCRT ${UCRT_VERSION}")
# directory where UCRT headers are found
FIND_PATH(WINSDK_UCRT_INCLUDE_DIR corecrt.h
HINTS
${WINSDK_UCRT_INCLUDE_ROOT_DIR}/${UCRT_VERSION}/ucrt
)
# directory where UCRT libraries are found
FIND_PATH(WINSDK_UCRT_LIBRARY_DIR ucrt.lib
HINTS
${WINSDK_UCRT_LIB_ROOT_DIR}/${UCRT_VERSION}/ucrt/${WINSDK8_SUFFIX}
)
ENDIF()
ENDIF()
SET(WINSDK_BINARY_DIRS
${WINSDK_DIR}/Bin/${UCRT_VERSION}/${WINSDK8_SUFFIX}
${WINSDK_DIR}/Bin/${WINSDK8_SUFFIX}
${WINSDK_DIR}/Bin/x86
${WINSDK_DIR}/Bin
)
# signtool is used to sign executables
FIND_PROGRAM(WINSDK_SIGNTOOL signtool
HINTS
${WINSDK_DIR}/Bin/${WINSDK8_SUFFIX}
${WINSDK_DIR}/Bin/x86
${WINSDK_DIR}/Bin
${WINSDK_BINARY_DIRS}
NO_DEFAULT_PATH
)
# midl is used to generate IDL interfaces
FIND_PROGRAM(WINSDK_MIDL midl
HINTS
${WINSDK_DIR}/Bin/${WINSDK8_SUFFIX}
${WINSDK_DIR}/Bin/x86
${WINSDK_DIR}/Bin
${WINSDK_BINARY_DIRS}
NO_DEFAULT_PATH
)
IF(WINSDK_INCLUDE_DIR)
@ -433,7 +476,7 @@ IF(WINSDK_INCLUDE_DIR)
SET(WINSDK_INCLUDE_DIRS ${WINSDK_INCLUDE_DIRS} ${WINSDK_WINRT_INCLUDE_DIR})
ENDIF()
INCLUDE_DIRECTORIES(${WINSDK_INCLUDE_DIRS}) # TODO: Move this after all other includes somehow...
INCLUDE_DIRECTORIES(${WINSDK_INCLUDE_DIRS})
IF(WINSDK_UCRT_LIBRARY_DIR)
SET(CMAKE_LIBRARY_PATH ${WINSDK_UCRT_LIBRARY_DIR} ${CMAKE_LIBRARY_PATH})
@ -441,8 +484,8 @@ IF(WINSDK_INCLUDE_DIR)
SET(CMAKE_LIBRARY_PATH ${WINSDK_LIBRARY_DIR} ${CMAKE_LIBRARY_PATH})
# Fix for using Windows SDK 7.1 with Visual C++ 2012
IF(WINSDK_VERSION STREQUAL "7.1" AND MSVC11)
# Fix for using Windows SDK 7.1 with Visual C++ 2012, 2013, 2015 and 2017
IF(WINSDK_VERSION STREQUAL "7.1" AND (MSVC11 OR MSVC12 OR MSVC14))
ADD_DEFINITIONS(-D_USING_V110_SDK71_)
ENDIF()
ELSE()

View file

@ -7,7 +7,7 @@
IF(XF86VidMode_LIBRARY AND XF86VidMode_INCLUDE_DIR)
# in cache already
SET(XF86VidMode_FIND_QUIETLY TRUE)
ENDIF(XF86VidMode_LIBRARY AND XF86VidMode_INCLUDE_DIR)
ENDIF()
FIND_PATH(XF86VidMode_INCLUDE_DIR
@ -37,10 +37,10 @@ IF(XF86VidMode_LIBRARY AND XF86VidMode_INCLUDE_DIR)
SET(XF86VidMode_DEFINITIONS -DXF86VIDMODE)
IF(NOT XF86VidMode_FIND_QUIETLY)
MESSAGE(STATUS "Found XF86VidMode: ${XF86VidMode_LIBRARY}")
ENDIF(NOT XF86VidMode_FIND_QUIETLY)
ELSE(XF86VidMode_LIBRARY AND XF86VidMode_INCLUDE_DIR)
ENDIF()
ELSE()
IF(NOT XF86VidMode_FIND_QUIETLY)
MESSAGE(STATUS "Warning: Unable to find XF86VidMode!")
ENDIF(NOT XF86VidMode_FIND_QUIETLY)
ENDIF(XF86VidMode_LIBRARY AND XF86VidMode_INCLUDE_DIR)
ENDIF()
ENDIF()

View file

@ -1,29 +1,63 @@
IF(assimp_FIND_REQUIRED)
SET(ASSIMP_FIND_REQUIRED ON)
ENDIF()
FIND_PATH(
assimp_INCLUDE_DIRS
ASSIMP_INCLUDE_DIRS
NAMES assimp/postprocess.h assimp/scene.h assimp/version.h assimp/config.h assimp/cimport.h
PATHS /usr/local/include/
)
FIND_LIBRARY(
assimp_LIBRARIES
ASSIMP_LIBRARY_RELEASE
NAMES assimp
PATHS /usr/local/lib/
)
IF (assimp_INCLUDE_DIRS AND assimp_LIBRARIES)
SET(assimp_FOUND TRUE)
FIND_LIBRARY(
IRRXML_LIBRARY_RELEASE
NAMES IrrXML
PATHS /usr/local/lib/
)
FIND_LIBRARY(
ASSIMP_LIBRARY_DEBUG
NAMES assimpd
PATHS /usr/local/lib/
)
FIND_LIBRARY(
IRRXML_LIBRARY_DEBUG
NAMES IrrXMLd
PATHS /usr/local/lib/
)
IF (ASSIMP_INCLUDE_DIRS)
SET(ASSIMP_FOUND TRUE)
IF(ASSIMP_LIBRARY_RELEASE)
SET(ASSIMP_LIBRARIES ${ASSIMP_LIBRARIES} optimized ${ASSIMP_LIBRARY_RELEASE})
ENDIF()
IF(ASSIMP_LIBRARY_DEBUG)
SET(ASSIMP_LIBRARIES ${ASSIMP_LIBRARIES} debug ${ASSIMP_LIBRARY_DEBUG})
ENDIF()
FIND_PACKAGE(ZLIB)
IF(ZLIB_FOUND)
SET(assimp_LIBRARIES ${assimp_LIBRARIES} ${ZLIB_LIBRARIES})
SET(ASSIMP_LIBRARIES ${ASSIMP_LIBRARIES} ${ZLIB_LIBRARIES})
ENDIF()
ENDIF (assimp_INCLUDE_DIRS AND assimp_LIBRARIES)
IF(IRRXML_LIBRARY_RELEASE)
SET(ASSIMP_LIBRARIES ${ASSIMP_LIBRARIES} optimized ${IRRXML_LIBRARY_RELEASE})
ENDIF()
IF(IRRXML_LIBRARY_DEBUG)
SET(ASSIMP_LIBRARIES ${ASSIMP_LIBRARIES} debug ${IRRXML_LIBRARY_DEBUG})
ENDIF()
ENDIF()
IF (assimp_FOUND)
IF (NOT assimp_FIND_QUIETLY)
MESSAGE(STATUS "Found asset importer library: ${assimp_LIBRARIES}")
ENDIF (NOT assimp_FIND_QUIETLY)
ELSE (assimp_FOUND)
IF (assimp_FIND_REQUIRED)
IF (ASSIMP_FOUND)
IF (NOT ASSIMP_FIND_QUIETLY)
MESSAGE(STATUS "Found asset importer library: ${ASSIMP_LIBRARIES}")
ENDIF ()
ELSE (ASSIMP_FOUND)
IF (ASSIMP_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find asset importer library")
ENDIF (assimp_FIND_REQUIRED)
ENDIF (assimp_FOUND)
ENDIF ()
ENDIF ()

View file

@ -0,0 +1,131 @@
# Define OSX_SDK to force a specific version such as : -DOSX_SDK=10.11
#
# Example:
# cmake ../code -DCMAKE_TOOLCHAIN_FILE=../code/CMakeModules/OSXToolChain.cmake -DWITH_NEL_TESTS=OFF -DWITH_RYZOM_SERVER=OFF -DWITH_NEL_TOOLS=OFF -DWITH_RYZOM_TOOLS=OFF -DWITH_LUA51=OFF -DWITH_LUA53=ON -DCMAKE_BUILD_TYPE=Release -DWITH_RYZOM_INSTALLER=OFF -DWITH_RYZOM_PATCH=ON -DWITH_NEL_TESTS=OFF -DWITH_NEL_TOOLS=OFF -DWITH_TOOLS=OFF -DWITH_NEL_SAMPLES=OFF -DWITH_WARNINGS=OFF -DWITH_QT5=OFF -DWITH_STATIC=ON -DWITH_STATIC_DRIVERS=ON -DWITH_STATIC_EXTERNAL=ON -DWITH_UNIX_STRUCTURE=OFF -DWITH_INSTALL_LIBRARIES=OFF -DWITH_RYZOM_SANDBOX=OFF -DOSX_SDK=10.11
# Don't forget to define environment variables:
#
# export MACOSX_DEPLOYMENT_TARGET=10.7
# export OSXCROSS_GCC_NO_STATIC_RUNTIME=1
# export PATH=$PATH:/home/src/osxcross/target/bin
#
# ln -s /usr/bin/hg /home/src/osxcross/target/bin/hg
#
# To install all dependencies:
# ./osxcross-macports install libxml2 jpeg curl libogg libvorbis freetype boost openssl zlib lua-5.3 giflib
# to compile Luabind
# export CMAKE_MODULE_PATH=$HOME/shard/tools/external/cmake/modules
# cmake .. -DCMAKE_TOOLCHAIN_FILE=$HOME/ryzomcore/code/CMakeModules/OSXToolChain.cmake -DWITH_SHARED=OFF -DWITH_STATIC=ON -DWITH_LUA51=OFF -DWITH_LUA53=ON -DCMAKE_INSTALL_PREFIX=$HOME/osxcross/target/external
IF(DEFINED CMAKE_CROSSCOMPILING)
# subsequent toolchain loading is not really needed
RETURN()
ENDIF()
# Force the compilers to Clang for OS X
# C
SET(CMAKE_C_COMPILER x86_64-apple-darwin15-clang)
SET(CMAKE_C_STANDARD_COMPUTED_DEFAULT "11")
SET(CMAKE_C_COMPILE_FEATURES "c_std_90;c_function_prototypes;c_std_99;c_restrict;c_variadic_macros;c_std_11;c_static_assert")
SET(CMAKE_C90_COMPILE_FEATURES "c_std_90;c_function_prototypes")
SET(CMAKE_C99_COMPILE_FEATURES "c_std_99;c_restrict;c_variadic_macros")
SET(CMAKE_C11_COMPILE_FEATURES "c_std_11;c_static_assert")
# C++
SET(CMAKE_CXX_COMPILER x86_64-apple-darwin15-clang++)
SET(CMAKE_CXX_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters;cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates;cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates;cxx_std_17")
SET(CMAKE_CXX98_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters")
SET(CMAKE_CXX11_COMPILE_FEATURES "cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates")
SET(CMAKE_CXX14_COMPILE_FEATURES "cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates")
SET(CMAKE_CXX17_COMPILE_FEATURES "cxx_std_17")
# make
SET(CMAKE_MAKE_PROGRAM make)
# Skip the platform compiler checks for cross compiling.
SET(CMAKE_CXX_COMPILER_FORCED TRUE)
SET(CMAKE_C_COMPILER_FORCED TRUE)
# Check if osxcross is installed
EXECUTE_PROCESS(COMMAND which ${CMAKE_CXX_COMPILER} OUTPUT_VARIABLE COMPILER_FULLPATH OUTPUT_STRIP_TRAILING_WHITESPACE)
IF(NOT COMPILER_FULLPATH)
MESSAGE(FATAL_ERROR "Unable to find ${CMAKE_CXX_COMPILER}, are you sure osxcross is installed and is in PATH?")
ENDIF()
# Default paths
GET_FILENAME_COMPONENT(CMAKE_OSX_TOOLCHAIN_ROOT ${COMPILER_FULLPATH} DIRECTORY)
# Parent directory
GET_FILENAME_COMPONENT(CMAKE_OSX_TOOLCHAIN_ROOT ${CMAKE_OSX_TOOLCHAIN_ROOT} DIRECTORY)
SET(CMAKE_OSX_SYSROOT ${CMAKE_OSX_TOOLCHAIN_ROOT}/SDK)
SET(MACPORTS_ROOT_DIR ${CMAKE_OSX_TOOLCHAIN_ROOT}/macports/pkgs/opt/local)
SET(EXTERNAL_OSX_PATH ${CMAKE_OSX_TOOLCHAIN_ROOT}/external)
# List of all SDKs that have been found
SET(OSX_SDKS)
FILE(GLOB _CMAKE_OSX_SDKS "${CMAKE_OSX_SYSROOT}/MacOSX*")
IF(_CMAKE_OSX_SDKS)
LIST(SORT _CMAKE_OSX_SDKS)
LIST(REVERSE _CMAKE_OSX_SDKS)
FOREACH(_CMAKE_OSX_SDK ${_CMAKE_OSX_SDKS})
STRING(REGEX REPLACE ".+MacOSX([0-9.]+)\\.sdk" "\\1" _OSX_SDK "${_CMAKE_OSX_SDK}")
LIST(APPEND OSX_SDKS ${_OSX_SDK})
ENDFOREACH()
ENDIF()
# Find and use the most recent OS X sdk
IF(NOT OSX_SDKS)
MESSAGE(FATAL_ERROR "No OS X SDK's found in default search path ${CMAKE_OSX_SYSROOT}.")
ENDIF()
# if a specific SDK is defined, try to use it
IF(OSX_SDK)
LIST(FIND OSX_SDKS "${OSX_SDK}" _INDEX)
IF(_INDEX EQUAL -1)
# if specified SDK doesn't exist, use the last one
LIST(GET OSX_SDKS 0 OSX_SDK)
ENDIF()
ELSE()
# use the last SDK
LIST(GET OSX_SDKS 0 OSX_SDK)
ENDIF()
MESSAGE(STATUS "Using OS X SDK ${OSX_SDK}")
# Define final OS X sysroot
SET(CMAKE_OSX_SYSROOT ${CMAKE_OSX_SYSROOT}/MacOSX${OSX_SDK}.sdk)
# Standard settings
SET(CMAKE_SYSTEM_NAME Darwin)
SET(CMAKE_SYSTEM "Darwin-15.0.0")
SET(CMAKE_SYSTEM_VERSION "15.0.0")
SET(CMAKE_SYSTEM_PROCESSOR "x86_64")
SET(UNIX ON)
SET(APPLE ON)
# Set the find root to the OS X developer roots and to user defined paths
SET(CMAKE_FIND_ROOT_PATH ${CMAKE_OSX_TOOLCHAIN_ROOT} ${CMAKE_OSX_SYSROOT} ${CMAKE_PREFIX_PATH} ${CMAKE_INSTALL_PREFIX} ${MACPORTS_ROOT_DIR} ${EXTERNAL_OSX_PATH} $ENV{EXTERNAL_OSX_PATH} CACHE STRING "OS X find search path root")
# default to searching for frameworks first
SET(CMAKE_FIND_FRAMEWORK FIRST)
# set up the default search directories for frameworks
SET(CMAKE_SYSTEM_FRAMEWORK_PATH
${CMAKE_OSX_SYSROOT}/System/Library/Frameworks
${CMAKE_OSX_SYSROOT}/System/Library/PrivateFrameworks
${CMAKE_OSX_SYSROOT}/Developer/Library/Frameworks
)
# only search the OS X sdks, not the remainder of the host filesystem
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
# determinate location for bin utils based on CMAKE_FIND_ROOT_PATH
INCLUDE(CMakeFindBinUtils)

View file

@ -27,23 +27,45 @@ ELSE()
ENDIF()
ENDIF()
MACRO(APPEND_DEFINITION _NAME _VAL)
IF(CMAKE_VERSION VERSION_LESS "2.8.12")
# don't support logical expressions, append definition
LIST(APPEND ${_NAME} "-D${_VAL}")
ELSE()
# support logical expressions, use them
LIST(APPEND ${_NAME} "$<$<BOOL:${_VAL}>:-D$<JOIN:${_VAL},-D>>")
ENDIF()
ENDMACRO()
# Set PCH_FLAGS for common flags, PCH_ARCH_XXX_FLAGS for specific archs flags and PCH_ARCHS for archs
MACRO(PCH_SET_COMPILE_FLAGS _target)
SET(PCH_FLAGS)
SET(PCH_ARCHS)
SET(_FLAGS)
LIST(APPEND _FLAGS ${CMAKE_CXX_FLAGS})
# C++ flags
SET(_FLAG ${CMAKE_CXX_FLAGS})
SEPARATE_ARGUMENTS(_FLAG)
LIST(APPEND _FLAGS ${_FLAG})
# C++ config flags
STRING(TOUPPER "${CMAKE_BUILD_TYPE}" _UPPER_BUILD)
LIST(APPEND _FLAGS " ${CMAKE_CXX_FLAGS_${_UPPER_BUILD}}")
SET(_FLAG ${CMAKE_CXX_FLAGS_${_UPPER_BUILD}})
SEPARATE_ARGUMENTS(_FLAG)
LIST(APPEND _FLAGS ${_FLAG})
GET_TARGET_PROPERTY(_targetType ${_target} TYPE)
SET(_USE_PIC OFF)
IF(${_targetType} STREQUAL "SHARED_LIBRARY" OR ${_targetType} STREQUAL "MODULE_LIBRARY")
LIST(APPEND _FLAGS " ${CMAKE_SHARED_LIBRARY_CXX_FLAGS}")
SET(_FLAG ${CMAKE_SHARED_LIBRARY_CXX_FLAGS})
SEPARATE_ARGUMENTS(_FLAG)
LIST(APPEND _FLAGS ${_FLAG})
ELSE()
GET_TARGET_PROPERTY(_pic ${_target} POSITION_INDEPENDENT_CODE)
IF(_pic)
@ -53,67 +75,75 @@ MACRO(PCH_SET_COMPILE_FLAGS _target)
GET_DIRECTORY_PROPERTY(DIRINC INCLUDE_DIRECTORIES)
FOREACH(item ${DIRINC})
LIST(APPEND _FLAGS " -I\"${item}\"")
LIST(APPEND _FLAGS -I"${item}")
ENDFOREACH()
# NOTE: As cmake files (eg FindQT4) may now use generator expressions around their defines that evaluate
# to an empty string, wrap all "items" in an expression that outputs a -D IFF the generated
# expression is not empty.
# Required for CMake 2.6
SET(GLOBAL_DEFINITIONS)
GET_DIRECTORY_PROPERTY(DEFINITIONS COMPILE_DEFINITIONS)
IF(DEFINITIONS)
FOREACH(item ${DEFINITIONS})
LIST(APPEND GLOBAL_DEFINITIONS " -D${item}")
APPEND_DEFINITION(GLOBAL_DEFINITIONS ${item})
ENDFOREACH()
ENDIF()
GET_DIRECTORY_PROPERTY(DEFINITIONS COMPILE_DEFINITIONS_${_UPPER_BUILD})
IF(DEFINITIONS)
FOREACH(item ${DEFINITIONS})
LIST(APPEND GLOBAL_DEFINITIONS " -D${item}")
APPEND_DEFINITION(GLOBAL_DEFINITIONS ${item})
ENDFOREACH()
ENDIF()
GET_DIRECTORY_PROPERTY(DEFINITIONS DIRECTORY ${CMAKE_SOURCE_DIR} COMPILE_DEFINITIONS)
IF(DEFINITIONS)
FOREACH(item ${DEFINITIONS})
LIST(APPEND GLOBAL_DEFINITIONS " -D${item}")
APPEND_DEFINITION(GLOBAL_DEFINITIONS ${item})
ENDFOREACH()
ENDIF()
GET_DIRECTORY_PROPERTY(DEFINITIONS DIRECTORY ${CMAKE_SOURCE_DIR} COMPILE_DEFINITIONS_${_UPPER_BUILD})
IF(DEFINITIONS)
FOREACH(item ${DEFINITIONS})
LIST(APPEND GLOBAL_DEFINITIONS " -D${item}")
APPEND_DEFINITION(GLOBAL_DEFINITIONS ${item})
ENDFOREACH()
ENDIF()
GET_TARGET_PROPERTY(oldProps ${_target} COMPILE_FLAGS)
IF(oldProps)
LIST(APPEND _FLAGS " ${oldProps}")
SET(_FLAG ${oldProps})
SEPARATE_ARGUMENTS(_FLAG)
LIST(APPEND _FLAGS ${_FLAG})
ENDIF()
GET_TARGET_PROPERTY(oldPropsBuild ${_target} COMPILE_FLAGS_${_UPPER_BUILD})
IF(oldPropsBuild)
LIST(APPEND _FLAGS " ${oldPropsBuild}")
SET(_FLAG ${oldPropsBuild})
SEPARATE_ARGUMENTS(_FLAG)
LIST(APPEND _FLAGS ${_FLAG})
ENDIF()
GET_TARGET_PROPERTY(DIRINC ${_target} INCLUDE_DIRECTORIES)
IF(DIRINC)
FOREACH(item ${DIRINC})
LIST(APPEND _FLAGS " -I\"${item}\"")
LIST(APPEND _FLAGS -I"${item}")
ENDFOREACH()
ENDIF()
GET_TARGET_PROPERTY(DEFINITIONS ${_target} COMPILE_DEFINITIONS)
IF(DEFINITIONS)
FOREACH(item ${DEFINITIONS})
LIST(APPEND GLOBAL_DEFINITIONS " -D${item}")
APPEND_DEFINITION(GLOBAL_DEFINITIONS ${item})
ENDFOREACH()
ENDIF()
GET_TARGET_PROPERTY(DEFINITIONS ${_target} COMPILE_DEFINITIONS_${_UPPER_BUILD})
IF(DEFINITIONS)
FOREACH(item ${DEFINITIONS})
LIST(APPEND GLOBAL_DEFINITIONS " -D${item}")
APPEND_DEFINITION(GLOBAL_DEFINITIONS ${item})
ENDFOREACH()
ENDIF()
@ -126,7 +156,7 @@ MACRO(PCH_SET_COMPILE_FLAGS _target)
IF(_DIRS)
FOREACH(item ${_DIRS})
LIST(APPEND GLOBAL_DEFINITIONS " -I\"${item}\"")
LIST(APPEND GLOBAL_DEFINITIONS -I"${item}")
ENDFOREACH()
ENDIF()
@ -135,10 +165,7 @@ MACRO(PCH_SET_COMPILE_FLAGS _target)
IF(_DEFINITIONS)
FOREACH(item ${_DEFINITIONS})
# don't use dynamic expressions
IF(NOT item MATCHES "\\$<")
LIST(APPEND GLOBAL_DEFINITIONS " -D${item}")
ENDIF()
APPEND_DEFINITION(GLOBAL_DEFINITIONS ${item})
ENDFOREACH()
ENDIF()
ENDIF()
@ -149,7 +176,7 @@ MACRO(PCH_SET_COMPILE_FLAGS _target)
IF(GLOBAL_DEFINITIONS MATCHES "QT_CORE_LIB")
# Hack to define missing QT_NO_DEBUG with Qt 5.2
IF(_UPPER_BUILD STREQUAL "RELEASE")
LIST(APPEND GLOBAL_DEFINITIONS " -DQT_NO_DEBUG")
LIST(APPEND GLOBAL_DEFINITIONS "-DQT_NO_DEBUG")
ENDIF()
# Qt5_POSITION_INDEPENDENT_CODE should be true if Qt was compiled with PIC
@ -158,28 +185,43 @@ MACRO(PCH_SET_COMPILE_FLAGS _target)
ENDIF()
IF(_USE_PIC)
LIST(APPEND _FLAGS " ${CMAKE_CXX_COMPILE_OPTIONS_PIC}")
LIST(APPEND _FLAGS ${CMAKE_CXX_COMPILE_OPTIONS_PIC})
ENDIF()
ENDIF()
LIST(APPEND _FLAGS " ${GLOBAL_DEFINITIONS}")
IF(CMAKE_VERSION VERSION_LESS "3.3.0")
GET_DIRECTORY_PROPERTY(_directory_flags DEFINITIONS)
GET_DIRECTORY_PROPERTY(_directory_definitions DIRECTORY ${CMAKE_SOURCE_DIR} DEFINITIONS)
LIST(APPEND _FLAGS " ${_directory_flags}")
LIST(APPEND _FLAGS " ${_directory_definitions}")
GET_DIRECTORY_PROPERTY(_DIRECTORY_FLAGS DEFINITIONS)
IF(_DIRECTORY_FLAGS)
SEPARATE_ARGUMENTS(_DIRECTORY_FLAGS)
FOREACH(item ${_DIRECTORY_FLAGS})
LIST(APPEND _FLAGS "${item}")
ENDFOREACH()
ENDIF()
GET_DIRECTORY_PROPERTY(_DIRECTORY_DEFINITIONS DIRECTORY ${CMAKE_SOURCE_DIR} DEFINITIONS)
IF(_DIRECTORY_DEFINITIONS)
SEPARATE_ARGUMENTS(_DIRECTORY_DEFINITIONS)
FOREACH(item ${_DIRECTORY_DEFINITIONS})
LIST(APPEND _FLAGS "${item}")
ENDFOREACH()
ENDIF()
ENDIF()
IF(USE_CPP0X AND gcc_compiler_version GREATER "6.2.0")
LIST(APPEND _FLAGS "-std=gnu++11")
ENDIF()
# Format definitions
IF(MSVC)
# Fix path with space
SEPARATE_ARGUMENTS(_FLAGS UNIX_COMMAND "${_FLAGS}")
ELSE()
STRING(REGEX REPLACE " +" " " _FLAGS ${_FLAGS})
SEPARATE_ARGUMENTS(_FLAGS)
ENDIF()
# Already in list form and items may contain non-leading spaces that should not be split on
LIST(INSERT _FLAGS 0 "${GLOBAL_DEFINITIONS}")
IF(CLANG)
# Determining all architectures and get common flags
SET(_ARCH_NEXT)
@ -236,6 +278,7 @@ MACRO(PCH_SET_COMPILE_FLAGS _target)
ENDIF()
IF(PCH_FLAGS)
LIST(REMOVE_ITEM PCH_FLAGS "")
LIST(REMOVE_DUPLICATES PCH_FLAGS)
ENDIF()
ENDMACRO()
@ -247,16 +290,16 @@ MACRO(GET_PDB_FILENAME _out_filename _target)
SET(_targetOutput ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
ELSEIF(${_targetType} STREQUAL STATIC_LIBRARY)
SET(_targetOutput ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY})
ELSE(${_targetType} STREQUAL EXECUTABLE)
ELSE()
SET(_targetOutput ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
ENDIF(${_targetType} STREQUAL EXECUTABLE)
ENDIF()
# determine target postfix
STRING(TOUPPER "${CMAKE_BUILD_TYPE}_POSTFIX" _postfix_var_name)
GET_TARGET_PROPERTY(_targetPostfix ${_target} ${_postfix_var_name})
IF(${_targetPostfix} MATCHES NOTFOUND)
SET(_targetPostfix "")
ENDIF(${_targetPostfix} MATCHES NOTFOUND)
ENDIF()
SET(${_out_filename} "${_targetOutput}/${_target}${_targetPostfix}.pdb")
ENDMACRO(GET_PDB_FILENAME)
@ -270,8 +313,9 @@ MACRO(PCH_SET_COMPILE_COMMAND _inputcpp _compile_FLAGS)
ENDIF()
IF(MSVC)
GET_PDB_FILENAME(PDB_FILE ${_PCH_current_target})
SET(PCH_COMMAND ${CMAKE_CXX_COMPILER} ${pchsupport_compiler_cxx_arg1} ${_compile_FLAGS} /Yc /Fp"${PCH_OUTPUT}" ${_inputcpp} /Fd"${PDB_FILE}" /c /Fo"${PCH_OUTPUT}.obj")
GET_PDB_FILENAME(_PDB_FILE ${_PCH_current_target})
SET(PCH_COMMAND ${CMAKE_CXX_COMPILER} ${pchsupport_compiler_cxx_arg1} ${_compile_FLAGS} /Yc /Fp"${PCH_OUTPUT}" ${_inputcpp} /Fd"${_PDB_FILE}" /c /Fo"${PCH_OUTPUT}.obj")
# Ninja PCH Support
# http://public.kitware.com/pipermail/cmake-developers/2012-March/003653.html
SET_SOURCE_FILES_PROPERTIES(${_inputcpp} PROPERTIES OBJECT_OUTPUTS "${PCH_OUTPUT}.obj")
@ -280,7 +324,7 @@ MACRO(PCH_SET_COMPILE_COMMAND _inputcpp _compile_FLAGS)
SET(_FLAGS "")
IF(APPLE)
SET(HEADER_FORMAT "objective-${HEADER_FORMAT}")
SET(_FLAGS -fobjc-abi-version=2 -fobjc-legacy-dispatch)
SET(_FLAGS ${OBJC_FLAGS})
ENDIF()
SET(PCH_COMMAND ${CMAKE_CXX_COMPILER} ${pchsupport_compiler_cxx_arg1} ${_compile_FLAGS} ${_FLAGS} -x ${HEADER_FORMAT} -o ${PCH_OUTPUT} -c ${PCH_INPUT})
ENDIF()
@ -366,7 +410,8 @@ MACRO(ADD_PRECOMPILED_HEADER_TO_TARGET _targetName)
ENDIF()
IF(APPLE)
SET(PCH_ADDITIONAL_COMPILER_FLAGS "-fobjc-abi-version=2 -fobjc-legacy-dispatch -x objective-c++ ${PCH_ADDITIONAL_COMPILER_FLAGS}")
STRING(REPLACE ";" " " OBJC_FLAGS_STR "${OBJC_FLAGS}")
SET(PCH_ADDITIONAL_COMPILER_FLAGS "${OBJC_FLAGS_STR} -x objective-c++ ${PCH_ADDITIONAL_COMPILER_FLAGS}")
ENDIF()
IF(WITH_PCH_DEBUG)

View file

@ -35,23 +35,6 @@ SET(UNIX ON)
SET(APPLE ON)
SET(IOS ON)
# Force the compilers to Clang for iOS
include (CMakeForceCompiler)
CMAKE_FORCE_C_COMPILER (clang Clang)
CMAKE_FORCE_CXX_COMPILER (clang++ Clang)
IF(CMAKE_CXX_COMPILER)
EXECUTE_PROCESS(COMMAND ${CMAKE_CXX_COMPILER} --version
OUTPUT_VARIABLE CLANG_VERSION_RAW
OUTPUT_STRIP_TRAILING_WHITESPACE)
STRING(REGEX REPLACE "Apple LLVM version ([\\.0-9]+).*"
"\\1" CMAKE_CXX_COMPILER_VERSION "${CLANG_VERSION_RAW}")
SET(CMAKE_C_COMPILER_VERSION ${CMAKE_CXX_COMPILER_VERSION})
SET(CMAKE_COMPILER_VERSION ${CMAKE_CXX_COMPILER_VERSION})
ENDIF()
# Setup iOS platform
IF(NOT DEFINED IOS_PLATFORM)
SET(IOS_PLATFORM "OS")
@ -162,14 +145,14 @@ IF(CMAKE_GENERATOR MATCHES Xcode)
ENDIF()
ELSE()
IF(${IOS_PLATFORM} STREQUAL "OS")
SET(ARCHS "armv7;arm64")
SET(ARCHS armv7 arm64)
SET(CMAKE_SYSTEM_PROCESSOR "armv7")
ELSEIF(${IOS_PLATFORM} STREQUAL "SIMULATOR")
# iPhone simulator targets i386
SET(ARCHS "i386")
SET(CMAKE_SYSTEM_PROCESSOR "x86")
ELSEIF(${IOS_PLATFORM} STREQUAL "ALL")
SET(ARCHS "armv7;arm64;i386;x86_64")
SET(ARCHS armv7 arm64 i386 x86_64)
SET(CMAKE_SYSTEM_PROCESSOR "armv7")
ENDIF()
ENDIF()
@ -198,5 +181,13 @@ SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
# Force the compilers to Clang for iOS
SET(CMAKE_C_COMPILER clang)
SET(CMAKE_CXX_COMPILER clang++)
# Skip the platform compiler checks for cross compiling.
SET(CMAKE_CXX_COMPILER_FORCED TRUE)
SET(CMAKE_C_COMPILER_FORCED TRUE)
# determinate location for bin utils based on CMAKE_FIND_ROOT_PATH
include(CMakeFindBinUtils)
INCLUDE(CMakeFindBinUtils)

File diff suppressed because it is too large Load diff

View file

@ -1,24 +1,21 @@
PROJECT(NeL CXX C)
IF(WITH_STATIC_DRIVERS)
ADD_DEFINITIONS(-DNL_STATIC)
ENDIF(WITH_STATIC_DRIVERS)
ENDIF()
IF(WIN32)
# On Win32 we can also build the MAX plugins.
IF(WITH_NEL_MAXPLUGIN)
FIND_PACKAGE(3dsMaxSDK)
ENDIF(WITH_NEL_MAXPLUGIN)
ENDIF(WIN32)
ENDIF()
ENDIF()
IF(WITH_3D)
FIND_PACKAGE(FreeType)
IF(WITH_NEL_CEGUI)
FIND_PACKAGE(CEGUI)
ENDIF(WITH_NEL_CEGUI)
ENDIF(WITH_3D)
ENDIF()
ENDIF()
IF(WITH_SOUND)
FIND_PACKAGE(Ogg)
@ -26,24 +23,16 @@ IF(WITH_SOUND)
IF(WITH_DRIVER_OPENAL)
FIND_PACKAGE(OpenAL)
ENDIF(WITH_DRIVER_OPENAL)
ENDIF()
IF(WITH_DRIVER_FMOD)
FIND_PACKAGE(FMOD)
ENDIF(WITH_DRIVER_FMOD)
ENDIF(WITH_SOUND)
ENDIF()
ENDIF()
IF(WITH_GTK)
FIND_PACKAGE(GTK2)
ENDIF(WITH_GTK)
IF(WITH_LIBOVR)
FIND_PACKAGE(LibOVR)
ENDIF(WITH_LIBOVR)
IF(WITH_LIBVR)
FIND_PACKAGE(LibVR)
ENDIF(WITH_LIBVR)
ENDIF()
IF(WITH_INSTALL_LIBRARIES)
IF(UNIX)
@ -61,7 +50,7 @@ IF(WITH_INSTALL_LIBRARIES)
CONFIGURE_FILE(nel-config.in ${CMAKE_CURRENT_BINARY_DIR}/nel-config)
INSTALL(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/nel-config DESTINATION ${NL_BIN_PREFIX})
ENDIF(UNIX)
ENDIF()
ADD_SUBDIRECTORY(include)
ENDIF()

View file

@ -19,6 +19,8 @@
#include "nel/misc/types_nl.h"
#include "nel/misc/bit_set.h"
#include "nel/misc/smart_ptr.h"
#include <string>
#include <vector>
#include <map>

View file

@ -21,13 +21,17 @@
#include "nel/misc/types_nl.h"
#include "nel/misc/smart_ptr.h"
#include "nel/3d/animatable.h"
#include "nel/3d/track.h"
#include <map>
namespace NL3D
{
class CScene;
// ***************************************************************************
/**
* An animated lightmap

View file

@ -93,7 +93,7 @@ public:
uint addAnimation (const char* fileName, const char* animName, bool displayMissingFileWarning = true)
{
// Allocate an animation
std::auto_ptr<CAnimation> anim (new CAnimation);
CUniquePtr<CAnimation> anim (new CAnimation);
// Read it
NLMISC::CIFile file;
@ -130,7 +130,7 @@ public:
virtual uint addSkeletonWeight (const char* fileName, const char* skelName)
{
// Allocate an animation
std::auto_ptr<CSkeletonWeight> skeletonWeight (new CSkeletonWeight);
CUniquePtr<CSkeletonWeight> skeletonWeight (new CSkeletonWeight);
// Read it
NLMISC::CIFile file;

View file

@ -88,7 +88,7 @@ private:
public:
std::string MeshName;
public:
CMeshLoad (const std::string &meshName, IShape **ppShp, IDriver *pDriver, const CVector &position, uint selectedTexture);
CMeshLoad (const std::string &meshName, IShape **ppShp, IDriver *pDriver, const NLMISC::CVector &position, uint selectedTexture);
void run (void);
void getName (std::string &result) const;
};
@ -122,7 +122,7 @@ private:
CTextureFile *TextureFile;
bool *Signal;
public:
CTextureLoad(CTextureFile *textureFile, bool *psgn, const CVector &position)
CTextureLoad(CTextureFile *textureFile, bool *psgn, const NLMISC::CVector &position)
: TextureFile(textureFile), Signal(psgn)
{
Position = position;

View file

@ -152,7 +152,7 @@ private:
struct CTextureLodToSort
{
CTextureLod *Lod;
CVector Position;
NLMISC::CVector Position;
bool operator<(const CTextureLodToSort &other) const
{
return Lod->Weight<other.Lod->Weight;

View file

@ -20,6 +20,7 @@
#include "nel/misc/types_nl.h"
#include "nel/misc/vector.h"
#include "nel/misc/plane.h"
#include "nel/misc/aabbox.h"
namespace NL3D {
@ -39,16 +40,16 @@ public:
/** build the camera collision as a cone or a cylinder
*/
void build(const CVector &start, const CVector &end, float radius, bool cone);
void build(const NLMISC::CVector &start, const NLMISC::CVector &end, float radius, bool cone);
/** build the camera collision as a simple ray
*/
void buildRay(const CVector &start, const CVector &end);
void buildRay(const NLMISC::CVector &start, const NLMISC::CVector &end);
/** compute the intersection of the Camera Volume against the triangle, and minimize
* minDist (actual square of distance) with min sqr distance of the poly.
*/
void minimizeDistanceAgainstTri(const CVector &p0, const CVector &p1, const CVector &p2, float &sqrMinDist);
void minimizeDistanceAgainstTri(const NLMISC::CVector &p0, const NLMISC::CVector &p1, const NLMISC::CVector &p2, float &sqrMinDist);
/** Compute into this the camera collision 'other' mul by 'matrix'
* NB: for cone Radius, suppose uniform scale, else will have strange result (a uniform scale is deduced)
@ -69,9 +70,9 @@ private:
enum {MaxNPlanes=6};
// The start of the camera raycast
CVector _Start;
NLMISC::CVector _Start;
// The end of the camera raycast
CVector _End;
NLMISC::CVector _End;
// The radius (at end only if cone)
float _Radius;
// cone or cylinder?
@ -83,8 +84,8 @@ private:
NLMISC::CAABBox _BBox;
// Temp Data for minimizeDistanceAgainstTri
CVector _ArrayIn[3+MaxNPlanes];
CVector _ArrayOut[3+MaxNPlanes];
NLMISC::CVector _ArrayIn[3+MaxNPlanes];
NLMISC::CVector _ArrayOut[3+MaxNPlanes];
// The pyramid representing the camera collision volume. Nb: local to start for precision problems
NLMISC::CPlane _Pyramid[MaxNPlanes];
@ -97,10 +98,10 @@ private:
float _MaxRadiusProj;
float _OODeltaRadiusProj;
float _RayLen;
CVector _RayNorm;
NLMISC::CVector _RayNorm;
// simpler method for simple ray
void intersectRay(const CVector &p0, const CVector &p1, const CVector &p2, float &sqrMinDist);
void intersectRay(const NLMISC::CVector &p0, const NLMISC::CVector &p1, const NLMISC::CVector &p2, float &sqrMinDist);
};

View file

@ -22,6 +22,7 @@ namespace NL3D
class UDriver;
class UCamera;
class CCloudScape;
class CScene;
/// implementation of UWaterInstance methods
class CCloudScapeUser : public UCloudScape

View file

@ -120,7 +120,7 @@ public:
void setWorldMatrix (const NLMISC::CMatrix &WM);
bool isRoot() { return _LocalVolume.size() == 0; }
bool isRoot() { return _LocalVolume.empty(); }
//\name Sound related.
//@{

View file

@ -84,7 +84,7 @@ public:
void setTextureFile (const char* file);
/**
* Add a coarse mesh in the manager. If an error occured, it returns CantAddCoarseMesh.
* Add a coarse mesh in the manager. If an error occurred, it returns CantAddCoarseMesh.
* \param vBuffer the VertexBuffer pre-transformed / Colored. Size MUST be numVertices*NL3D_COARSEMESH_VERTEX_FORMAT_MGR
* \param indexBuffer containing triangles that will be inserted.
* \return false if the mesh can't be added to this pass BECAUSE OF TOO MANY VERTICES or TOO MANY PRIMITIVES reason

View file

@ -48,7 +48,7 @@ public:
static void releaseInstance();
/// convert a HLS (0..255) to a RGBA.
CRGBA convert(uint H, uint L, uint S);
NLMISC::CRGBA convert(uint H, uint L, uint S);
/// convert a RGBA bitmap into another RGBA, with HLS decal (0..255, -255..+255, -255..+255).
void convertRGBABitmap(NLMISC::CBitmap &dst, const NLMISC::CBitmap &src, uint8 dh, sint dl, sint ds);
@ -75,7 +75,7 @@ private:
uint8 H,L,S,A;
};
CRGBA _HueTable[HueTableSize];
NLMISC::CRGBA _HueTable[HueTableSize];
CHLSA _Color16ToHLS[65536];
/// Constructor

View file

@ -55,7 +55,7 @@ public:
CFlareShape();
/// serial this shape
void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
void serial(NLMISC::IStream &f);
//@}

View file

@ -27,7 +27,8 @@
#ifndef NL3D_GPU_PROGRAM_PARAMS_H
#define NL3D_GPU_PROGRAM_PARAMS_H
#include <nel/misc/types_nl.h>
#include "nel/misc/types_nl.h"
// STL includes
#include <map>
@ -167,7 +168,7 @@ private:
std::map<std::string, size_t> m_MapName; // map from name to offset
size_t m_First;
size_t m_Last;
static const size_t s_End = -1;
static const size_t s_End;
}; /* class CGPUProgramParams */

View file

@ -26,6 +26,7 @@
namespace NL3D
{
class CInstanceGroup;
// ***************************************************************************
/**
@ -106,14 +107,14 @@ public:
public:
/// Debug: build a colored Grid mesh of SunContribution.
void buildSunDebugMesh(CMesh::CMeshBuild &meshBuild, CMeshBase::CMeshBaseBuild &meshBaseBuild, const CVector &deltaPos=CVector::Null);
void buildSunDebugMesh(CMesh::CMeshBuild &meshBuild, CMeshBase::CMeshBaseBuild &meshBaseBuild, const NLMISC::CVector &deltaPos= NLMISC::CVector::Null);
/// Debug: build a colored Grid mesh of PointLight. R= pointLight1 id. G= PointLight2 id. B= The multiplier used to show Ids.
void buildPLDebugMesh(CMesh::CMeshBuild &meshBuild, CMeshBase::CMeshBaseBuild &meshBaseBuild, const CVector &deltaPos, const CInstanceGroup &igOut);
void buildPLDebugMesh(CMesh::CMeshBuild &meshBuild, CMeshBase::CMeshBaseBuild &meshBaseBuild, const NLMISC::CVector &deltaPos, const CInstanceGroup &igOut);
private:
void addDebugMeshFaces(CMesh::CMeshBuild &meshBuild, CSurface &surface, uint vId0,
const std::vector<CRGBA> &colors);
const std::vector<NLMISC::CRGBA> &colors);
};

View file

@ -47,7 +47,7 @@ public:
public:
/// Serial
void serial (NLMISC::IStream& f) throw (NLMISC::EStream)
void serial (NLMISC::IStream& f)
{
// Version number
(void)f.serialVersion (0);
@ -83,7 +83,7 @@ class CKeyTCB : public CKey<T>
public:
/// Serial
void serial (NLMISC::IStream& f) throw (NLMISC::EStream)
void serial (NLMISC::IStream& f)
{
// Version number
(void)f.serialVersion (0);
@ -130,7 +130,7 @@ class CKeyBezier : public CKey<T>
public:
/// Serial
void serial (NLMISC::IStream& f) throw (NLMISC::EStream)
void serial (NLMISC::IStream& f)
{
// Version number
(void)f.serialVersion (0);
@ -180,7 +180,7 @@ template<> class CKeyTCB<NLMISC::CAngleAxis> : public CKey<NLMISC::CAngleAxis>
public:
/// Serial
void serial (NLMISC::IStream& f) throw (NLMISC::EStream)
void serial (NLMISC::IStream& f)
{
// Version number
(void)f.serialVersion (0);
@ -228,7 +228,7 @@ template<> class CKeyBezier<NLMISC::CQuat> : public CKey<NLMISC::CQuat>
public:
/// Serial
void serial (NLMISC::IStream& f) throw (NLMISC::EStream)
void serial (NLMISC::IStream& f)
{
// Version number
(void)f.serialVersion (0);

View file

@ -716,7 +716,7 @@ private:
bool _RefineMode;
float _FarTransition;
uint _TileMaxSubdivision;
// For VertexProgram. true if change has occured in threshold since the last render().
// For VertexProgram. true if change has occurred in threshold since the last render().
float _VPThresholdChange;
/// \name VertexBuffer mgt.

View file

@ -692,7 +692,7 @@ private:
{
NLMISC::CMatrix TexMat[IDRV_MAT_MAXTEXTURES];
};
std::auto_ptr<CUserTexMat> _TexUserMat; // user texture matrix
CUniquePtr<CUserTexMat> _TexUserMat; // user texture matrix
public:
// Private. For Driver only.

View file

@ -47,7 +47,7 @@ public:
float a31, a32, a33, a34;
// Copy from a matrix.
void set(const CMatrix &mat)
void set(const NLMISC::CMatrix &mat)
{
const float *m =mat.get();
a11= m[0]; a12= m[4]; a13= m[8] ; a14= m[12];
@ -57,14 +57,14 @@ public:
// mulSetvector. NB: in should be different as v!! (else don't work).
void mulSetVector(const CVector &in, CVector &out)
void mulSetVector(const NLMISC::CVector &in, NLMISC::CVector &out)
{
out.x= (a11*in.x + a12*in.y + a13*in.z);
out.y= (a21*in.x + a22*in.y + a23*in.z);
out.z= (a31*in.x + a32*in.y + a33*in.z);
}
// mulSetpoint. NB: in should be different as v!! (else don't work).
void mulSetPoint(const CVector &in, CVector &out)
void mulSetPoint(const NLMISC::CVector &in, NLMISC::CVector &out)
{
out.x= (a11*in.x + a12*in.y + a13*in.z + a14);
out.y= (a21*in.x + a22*in.y + a23*in.z + a24);
@ -73,14 +73,14 @@ public:
// mulSetvector. NB: in should be different as v!! (else don't work).
void mulSetVector(const CVector &in, float scale, CVector &out)
void mulSetVector(const NLMISC::CVector &in, float scale, NLMISC::CVector &out)
{
out.x= (a11*in.x + a12*in.y + a13*in.z) * scale;
out.y= (a21*in.x + a22*in.y + a23*in.z) * scale;
out.z= (a31*in.x + a32*in.y + a33*in.z) * scale;
}
// mulSetpoint. NB: in should be different as v!! (else don't work).
void mulSetPoint(const CVector &in, float scale, CVector &out)
void mulSetPoint(const NLMISC::CVector &in, float scale, NLMISC::CVector &out)
{
out.x= (a11*in.x + a12*in.y + a13*in.z + a14) * scale;
out.y= (a21*in.x + a22*in.y + a23*in.z + a24) * scale;
@ -89,14 +89,14 @@ public:
// mulAddvector. NB: in should be different as v!! (else don't work).
void mulAddVector(const CVector &in, float scale, CVector &out)
void mulAddVector(const NLMISC::CVector &in, float scale, NLMISC::CVector &out)
{
out.x+= (a11*in.x + a12*in.y + a13*in.z) * scale;
out.y+= (a21*in.x + a22*in.y + a23*in.z) * scale;
out.z+= (a31*in.x + a32*in.y + a33*in.z) * scale;
}
// mulAddpoint. NB: in should be different as v!! (else don't work).
void mulAddPoint(const CVector &in, float scale, CVector &out)
void mulAddPoint(const NLMISC::CVector &in, float scale, NLMISC::CVector &out)
{
out.x+= (a11*in.x + a12*in.y + a13*in.z + a14) * scale;
out.y+= (a21*in.x + a22*in.y + a23*in.z + a24) * scale;

View file

@ -85,7 +85,7 @@ public:
// This is slow but doesn't matter since used at mesh building....
CCorner();
void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
void serial(NLMISC::IStream &f);
};
/// A Triangle face.
@ -94,7 +94,7 @@ public:
CCorner Corner[3];
sint32 MaterialId;
sint32 SmoothGroup;
void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
void serial(NLMISC::IStream &f);
};
@ -118,7 +118,7 @@ public:
}
}
void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
void serial(NLMISC::IStream &f);
};
struct CVertLink
@ -203,7 +203,7 @@ public:
CMeshBuild();
// Serialization
//void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
//void serial(NLMISC::IStream &f);
};
//@}
@ -257,7 +257,7 @@ public:
virtual void render(IDriver *drv, CTransformShape *trans, bool opaquePass);
/// serial this mesh.
virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
virtual void serial(NLMISC::IStream &f);
NLMISC_DECLARE_CLASS(CMesh);
/// get trinagle count.
@ -370,7 +370,7 @@ public:
virtual float getNumTriangles (float distance);
/// serial this mesh.
virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
virtual void serial(NLMISC::IStream &f);
NLMISC_DECLARE_CLASS(CMeshGeom);
// profile

View file

@ -146,7 +146,7 @@ public:
CMeshBaseBuild();
// Serialization is not used
//void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
//void serial(NLMISC::IStream &f);
};
//@}
@ -201,7 +201,7 @@ public:
// @}
/// serial the base Part of this mesh.
void serialMeshBase(NLMISC::IStream &f) throw(NLMISC::EStream);
void serialMeshBase(NLMISC::IStream &f);
/// Flush textures
void flushTextures (IDriver &driver, uint selectedTexture);

View file

@ -43,7 +43,7 @@ public:
std::vector<uint32> VertRefs; // Array of vertices reference
void serial (NLMISC::IStream &f) throw(NLMISC::EStream);
void serial (NLMISC::IStream &f);
};
// ***************************************************************************
@ -90,7 +90,7 @@ public:
NLMISC::CObjectVector<CRawSkinVertex*, false> &vertexRemap,
std::vector<CAnimatedMorph> *pBSFactor);
void serial (NLMISC::IStream &f) throw(NLMISC::EStream);
void serial (NLMISC::IStream &f);
private:

View file

@ -115,7 +115,7 @@ public:
virtual float getNumTriangles (float distance);
/// serial this meshGeom.
virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
virtual void serial(NLMISC::IStream &f);
NLMISC_DECLARE_CLASS(CMeshMRMGeom);
/// Scene profile
@ -579,11 +579,11 @@ private:
/// load the header of this mesh. return the version of the header.
sint loadHeader(NLMISC::IStream &f) throw(NLMISC::EStream);
sint loadHeader(NLMISC::IStream &f);
/// load this mesh.
void load(NLMISC::IStream &f) throw(NLMISC::EStream);
void load(NLMISC::IStream &f);
/// save the entire mesh.
void save(NLMISC::IStream &f) throw(NLMISC::EStream);
void save(NLMISC::IStream &f);
// Build bone Usage information for serialized mesh <= version 2.
void buildBoneUsageVer2 ();
@ -702,7 +702,7 @@ public:
virtual float getNumTriangles (float distance);
/// serial this mesh.
virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
virtual void serial(NLMISC::IStream &f);
NLMISC_DECLARE_CLASS(CMeshMRM);
/// Get bbox.

View file

@ -125,7 +125,7 @@ public:
virtual void getAABBox(NLMISC::CAABBox &bbox) const;
/// serial this mesh.
virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
virtual void serial(NLMISC::IStream &f);
/// Declare name of the shape
NLMISC_DECLARE_CLASS(CMeshMultiLod);
@ -238,7 +238,7 @@ private:
std::vector<TCoarseMeshIndexType> CoarseTriangles;
/// Serial
void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
void serial(NLMISC::IStream &f);
/// Is Opaque ?
bool isOpaque() { return (Flags&IsOpaque)!=0; }

View file

@ -65,7 +65,7 @@ public:
const NLMISC::CMatrix &invertedModelMat,
const NLMISC::CVector &viewerPos);
virtual void end(IDriver *drv);
virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
virtual void serial(NLMISC::IStream &f);
virtual void setupForMaterial(const CMaterial &mat,
IDriver *drv,
CScene *scene,

View file

@ -90,7 +90,7 @@ public:
virtual float getMaxVertexMove();
// Serial.
virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
virtual void serial(NLMISC::IStream &f);
NLMISC_DECLARE_CLASS(CMeshVPWindTree);
// @}
@ -124,7 +124,7 @@ private:
double _LastSceneTime;
// maximum amplitude vector for each level. Stored in mesh because same for all instances.
CVector _MaxDeltaPos[HrcDepth];
NLMISC::CVector _MaxDeltaPos[HrcDepth];
float _MaxVertexMove;
// MBR Cache

View file

@ -54,9 +54,9 @@ public:
void build(std::vector<TPackedZoneBaseSPtr> &packesZones);
bool raytrace(const NLMISC::CVector &start, const NLMISC::CVector &end, NLMISC::CVector &inter, std::vector<NLMISC::CTriangle> *testedTriangles = NULL, NLMISC::CVector *normal = NULL);
void getZones(std::vector<TPackedZoneBaseSPtr> &zones);
void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
void serial(NLMISC::IStream &f);
// just serialize the header, containing name of the zones this CPackedWorld was built from
void serialZoneNames(NLMISC::IStream &f) throw(NLMISC::EStream);
void serialZoneNames(NLMISC::IStream &f);
/** Roughly select triangles that are within a convex 2D polygon (world coordinates)
* Selection is not exact, because limited to the resolution of the grid into which is packed each zone.
* Triangle that are within are guaranteed to be selected, however.
@ -68,7 +68,7 @@ private:
public:
TPackedZoneBaseSPtr Zone;
uint32 RaytraceCounter;
void serial(NLMISC::IStream &f) throw(NLMISC::EStream)
void serial(NLMISC::IStream &f)
{
f.serialVersion(1);
CPackedZoneBase *pz = Zone;
@ -81,7 +81,7 @@ private:
{
public:
std::vector<uint32> IDs; // make a class from this vector just for serialization
void serial(NLMISC::IStream &f) throw(NLMISC::EStream)
void serial(NLMISC::IStream &f)
{
f.serialCont(IDs);
}

View file

@ -52,7 +52,7 @@ class CPackedVertex
public:
uint16 X, Y, Z;
public:
void serial(NLMISC::IStream &f) throw(NLMISC::EStream)
void serial(NLMISC::IStream &f)
{
f.serial(X, Y, Z);
}
@ -68,7 +68,7 @@ class CPackedTri
public:
uint32 V0, V1, V2;
public:
void serial(NLMISC::IStream &f) throw(NLMISC::EStream)
void serial(NLMISC::IStream &f)
{
f.serial(V0, V1, V2);
}
@ -79,7 +79,7 @@ class CPackedTri16
public:
uint16 V0, V1, V2;
public:
void serial(NLMISC::IStream &f) throw(NLMISC::EStream)
void serial(NLMISC::IStream &f)
{
f.serial(V0, V1, V2);
}
@ -101,7 +101,7 @@ public:
sint32 ZoneY;
public:
virtual ~CPackedZoneBase() {}
virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream) = 0;
virtual void serial(NLMISC::IStream &f) = 0;
// TMP For debug : render position covered by a frustum
virtual void render(CVertexBuffer &vb, IDriver &drv, CMaterial &mat, CMaterial &wiredMaterial, const NLMISC::CMatrix &camMat, uint batchSize, const NLMISC::CVector localFrustCorners[8]) = 0;
// raytracing test
@ -138,7 +138,7 @@ public:
sint32 zoneX,
sint32 zoneY
);
void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
void serial(NLMISC::IStream &f);
// TMP For debug : render porition covered by a frustum
void render(CVertexBuffer &vb, IDriver &drv, CMaterial &mat, CMaterial &wiredMaterial, const NLMISC::CMatrix &camMat, uint batchSize, const NLMISC::CVector localFrustCorners[8]);
// try to build a 16 bit version of this packed zone to save some more place
@ -183,7 +183,7 @@ public:
NLMISC_DECLARE_CLASS(CPackedZone16)
CPackedZone16();
//
void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
void serial(NLMISC::IStream &f);
// TMP For debug : render position covered by a frustum
void render(CVertexBuffer &vb, IDriver &drv, CMaterial &mat, CMaterial &wiredMaterial, const NLMISC::CMatrix &camMat, uint batchSize, const NLMISC::CVector localFrustCorners[8]);
// raytracing test

View file

@ -84,7 +84,7 @@ public:
/// dtor
virtual ~CParticleSystem();
/// serialize this particle system
void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
void serial(NLMISC::IStream &f);
/** Merge this system with a system instanciated from the given shape
* NB : This is for edition purpose, this is slow
* \return true if the operation could be performed. It can fail when this cause the system the system to last forever,
@ -841,7 +841,7 @@ public:
/// return true when there are still emitters in the system
bool hasEmitters(void) const;
bool hasEmitters() const;
/// return true when there are still particles
bool hasParticles() const;

View file

@ -87,7 +87,7 @@ private:
{
public:
CParticleSystemModel *Model;
CMatrix OldAncestorMatOrRelPos; // last matrix of ancestor skeleton or relative matrix of ps to its ancestor (see flag below)
NLMISC::CMatrix OldAncestorMatOrRelPos; // last matrix of ancestor skeleton or relative matrix of ps to its ancestor (see flag below)
bool IsRelMatrix; // gives usage of the field OldAncestorMatOrRelPos
bool HasAncestorSkeleton; // has the system an ancestor skeleton ?
public:

View file

@ -102,7 +102,7 @@ class CParticleSystemProcess : public NLMISC::IStreamable
* Everything is saved, except for the fontManager and the fontGenerator.
* They must be set again if the PSToolRender pass is used.
*/
virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream) ;
virtual void serial(NLMISC::IStream &f);
/// @}
@ -163,10 +163,10 @@ class CParticleSystemProcess : public NLMISC::IStreamable
virtual void setMatrixMode(TPSMatrixMode matrixMode);
/// tells whether there are alive entities / particles in the system
virtual bool hasParticles(void) const { return false ; }
virtual bool hasParticles() const { return false ; }
/// tells whether there are alive emitters / particles in the system
virtual bool hasEmitters(void) const { return false ; }
virtual bool hasEmitters() const { return false ; }
/// max number of faces wanted by this process (for load balancing)

View file

@ -90,7 +90,7 @@ public:
// @}
/// serial the shape
virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
virtual void serial(NLMISC::IStream &f);
NLMISC_DECLARE_CLASS(CParticleSystemShape);

View file

@ -92,9 +92,9 @@ public:
void setWorldMatrix (const NLMISC::CMatrix &WM);
void setName (std::string &name) { _Name = name; }
void setName (const std::string &name) { _Name = name; }
std::string getName () { return _Name; }
std::string getName () const { return _Name; }
void open (bool opened) { _Opened = opened; }
bool isOpened () { return _Opened; }

View file

@ -202,7 +202,7 @@ public:
uint size() const { return _Size; }
/// serialization
void serial(NLMISC::IStream &f) throw(NLMISC::EStream)
void serial(NLMISC::IStream &f)
{
if (f.isReading())
{
@ -262,7 +262,7 @@ public:
CPSAttrib();
/// Serialization method
void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
void serial(NLMISC::IStream &f);
// swap with another vector
void swap(CPSAttrib<T> &other);
@ -429,7 +429,7 @@ void CPSAttrib<T>::remove(uint32 index)
}
template <typename T>
void CPSAttrib<T>::serial(NLMISC::IStream &f) throw(NLMISC::EStream)
void CPSAttrib<T>::serial(NLMISC::IStream &f)
{
// version 4 to 5 => bug with size being > capacity
sint ver = f.serialVersion(5);

View file

@ -60,7 +60,7 @@ struct CPSInputType
uint32 UserParamNum;
};
void serial(NLMISC::IStream &f) throw(NLMISC::EStream)
void serial(NLMISC::IStream &f)
{
f.serialEnum(InputType);
switch(InputType)
@ -124,7 +124,7 @@ public:
}
/// serialisation of the object. Derivers MUST call this, (if they use the attribute of this class at least)
virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream)
virtual void serial(NLMISC::IStream &f)
{
f.serialVersion(1);
f.serial(_NbCycles);

View file

@ -103,7 +103,7 @@ public:
uint32 srcStep = (1 << 16)
) const;
virtual void serial (NLMISC::IStream &f) throw(NLMISC::EStream);
virtual void serial (NLMISC::IStream &f);
virtual void deleteElement (uint32 index);
virtual void newElement (const CPSEmitterInfo &info);
virtual void resize (uint32 capacity, uint32 nbPresentElements);

View file

@ -282,7 +282,7 @@ inline float CPSAttribMakerBinOp<float>::getMaxValue(void) const
template <class T>
inline CPSAttribMakerBinOp<T>::CPSAttribMakerBinOp(const CPSAttribMakerBinOp &other) : CPSAttribMaker<T>(other) // parent copy ctor
{
std::auto_ptr<CPSAttribMaker<T> > a0(NLMISC::safe_cast<CPSAttribMaker<T> *>(other._Arg[0]->clone()))
CUniquePtr<CPSAttribMaker<T> > a0(NLMISC::safe_cast<CPSAttribMaker<T> *>(other._Arg[0]->clone()))
, a1(NLMISC::safe_cast<CPSAttribMaker<T> *>(other._Arg[1]->clone()));
this->_Op = other._Op;
this->_Size = other._Size;
@ -729,7 +729,7 @@ inline void CPSAttribMakerBinOp<T>::makeN(CPSLocated *loc,
//=================================================================================================================
template <class T>
inline void CPSAttribMakerBinOp<T>::serial (NLMISC::IStream &f) throw(NLMISC::EStream)
inline void CPSAttribMakerBinOp<T>::serial (NLMISC::IStream &f)
{
if (f.isReading())
{

View file

@ -96,7 +96,7 @@ template <typename T, class F> class CPSAttribMakerT : public CPSAttribMaker<T>
/// serialization of the object
virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream)
virtual void serial(NLMISC::IStream &f)
{
sint ver = f.serialVersion(2);
CPSAttribMaker<T>::serial(f);
@ -1463,7 +1463,7 @@ public:
CPSAttribMakerMemoryBase(const CPSAttribMakerMemoryBase &src) : CPSAttribMaker<T>(src) // parent copy ctor
{
nlassert(src._Scheme);
std::auto_ptr<CPSAttribMaker<T> > s(NLMISC::safe_cast<CPSAttribMaker<T> *>(src._Scheme->clone()));
CUniquePtr<CPSAttribMaker<T> > s(NLMISC::safe_cast<CPSAttribMaker<T> *>(src._Scheme->clone()));
this->_T = src._T;
this->_DefaultValue = src._DefaultValue;
this->_Scheme = s.release();
@ -1624,7 +1624,7 @@ public:
}
/// serialisation of the object. Derivers MUST call this, (if they use the attribute of this class at least)
virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream)
virtual void serial(NLMISC::IStream &f)
{
f.serialVersion(1);
@ -1744,7 +1744,7 @@ public:
_MaxValue = other._MaxValue;
}
// serial. Should update min / max when reading
virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
virtual void serial(NLMISC::IStream &f);
virtual uint32 getMinValue(void) const { return _MinValue; }
virtual uint32 getMaxValue(void) const { return _MaxValue; }
virtual void newElement(const CPSEmitterInfo &info);
@ -1767,7 +1767,7 @@ public:
_MaxValue = other._MaxValue;
}
// serial. Should update min / max when reading
virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
virtual void serial(NLMISC::IStream &f);
virtual sint32 getMinValue(void) const { return _MinValue; }
virtual sint32 getMaxValue(void) const { return _MaxValue; }
virtual void newElement(const CPSEmitterInfo &info);
@ -1790,7 +1790,7 @@ public:
_MaxValue = other._MaxValue;
}
// serial. Should update min / max when reading
virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
virtual void serial(NLMISC::IStream &f);
virtual float getMinValue(void) const { return _MinValue; }
virtual float getMaxValue(void) const { return _MaxValue; }
virtual void newElement(const CPSEmitterInfo &info);

View file

@ -24,6 +24,8 @@
#include "nel/misc/rgba.h"
#include "nel/misc/traits_nl.h"
#include <iterator>
namespace NL3D {
/*
@ -91,7 +93,7 @@ public:
CPSValueBlendFunc() {}
/// serialization
void serial(NLMISC::IStream &f) throw(NLMISC::EStream)
void serial(NLMISC::IStream &f)
{
f.serialVersion(1);
f.serial(_StartValue, _EndValue);
@ -226,7 +228,7 @@ public:
CPSValueBlendSampleFunc() {}
/// serialization
void serial(NLMISC::IStream &f) throw(NLMISC::EStream)
void serial(NLMISC::IStream &f)
{
f.serialVersion(1);
if (f.isReading())
@ -351,7 +353,7 @@ public:
}
/// serialization
virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
virtual void serial(NLMISC::IStream &f);
T getMaxValue(void) const
@ -480,14 +482,18 @@ void CPSValueGradientFunc<T>::setValuesUnpacked(const T *valueTab, uint32 numVal
_MaxValue = _MinValue = valueTab[0];
_NbValues = (numValues - 1) * nbStages;
_Tab.resize(_NbValues + 1);
#ifdef NL_COMP_VC14
std::copy(valueTab, valueTab + _NbValues + 1, stdext::make_checked_array_iterator(&_Tab[0], _Tab.size()));
#else
std::copy(valueTab, valueTab + _NbValues + 1, &_Tab[0]);
#endif
}
template <typename T>
void CPSValueGradientFunc<T>::serial(NLMISC::IStream &f) throw(NLMISC::EStream)
void CPSValueGradientFunc<T>::serial(NLMISC::IStream &f)
{
f.serialVersion(1);
f.serial(_NbStages);

View file

@ -66,7 +66,7 @@ public:
{
CPSValueBlendFunc<NLMISC::CRGBA>::setValues(convertVBColor(startValue, _ColorType), convertVBColor(endValue, _ColorType));
}
void serial(NLMISC::IStream &f) throw(NLMISC::EStream)
void serial(NLMISC::IStream &f)
{
setColorType(CVertexBuffer::TRGBA);
CPSValueBlendFunc<NLMISC::CRGBA>::serial(f);
@ -100,7 +100,7 @@ public:
{
CPSValueBlendSampleFunc<NLMISC::CRGBA, RGBA_BLENDER_NUM_VALUES>::setValues(convertVBColor(startValue, _ColorType), convertVBColor(endValue, _ColorType));
}
void serial(NLMISC::IStream &f) throw(NLMISC::EStream)
void serial(NLMISC::IStream &f)
{
setColorType(CVertexBuffer::TRGBA);
CPSValueBlendSampleFunc<NLMISC::CRGBA, RGBA_BLENDER_NUM_VALUES>::serial(f);
@ -124,7 +124,7 @@ public:
NLMISC::CRGBA getValue(uint index) const;
void setValues(const NLMISC::CRGBA *valueTab, uint32 numValues, uint32 nbStages);
void setValuesUnpacked(const NLMISC::CRGBA *valueTab, uint32 numValues, uint32 nbStages);
void serial(NLMISC::IStream &f) throw(NLMISC::EStream)
void serial(NLMISC::IStream &f)
{
setColorType(CVertexBuffer::TRGBA);
CPSValueGradientFunc<NLMISC::CRGBA>::serial(f);
@ -153,7 +153,7 @@ public:
this->_F.setColorType(colorType);
}
// serialisation should always be done in RGBA mode, so enforce that
virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream)
virtual void serial(NLMISC::IStream &f)
{
setColorType(CVertexBuffer::TRGBA);
CPSAttribMakerT<NLMISC::CRGBA, F>::serial(f);
@ -229,7 +229,7 @@ public:
virtual void setColorType(CVertexBuffer::TVertexColorType colorType);
virtual void setDefaultValue(NLMISC::CRGBA defaultValue);
virtual NLMISC::CRGBA getDefaultValue(void) const;
virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
virtual void serial(NLMISC::IStream &f);
protected:
CVertexBuffer::TVertexColorType _ColorType;
};
@ -244,7 +244,7 @@ public:
NLMISC_DECLARE_CLASS(CPSColorBinOp);
CPSAttribMakerBase *clone() const { return new CPSColorBinOp(*this); }
virtual void setColorType(CVertexBuffer::TVertexColorType colorType);
virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
virtual void serial(NLMISC::IStream &f);
};

View file

@ -46,7 +46,7 @@ public:
NLMISC_DECLARE_CLASS(CPSDot);
///serialisation
void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
void serial(NLMISC::IStream &f);
/// return true if there are transparent faces in the object
virtual bool hasTransparentFaces(void);

View file

@ -51,14 +51,14 @@ public:
//@}
/// Return this bindable type
uint32 getType(void) const { return PSEmitter; }
uint32 getType() const { return PSEmitter; }
/// Return priority for emitters
virtual uint32 getPriority(void) const { return 500; }
virtual uint32 getPriority() const { return 500; }
/// Return true if this located bindable derived class holds alive emitters
virtual bool hasEmitters(void) { nlassert(_Owner); return _Owner->getSize() != 0; }
virtual bool hasEmitters() const { nlassert(_Owner); return _Owner->getSize() != 0; }
virtual void step(TPSProcessPass pass);
@ -76,7 +76,7 @@ public:
/// Display the emitter in edition mode
virtual void showTool(void);
virtual void showTool();
/** Set the type of located to be emitted. The default is NULL which mean that no emission will occur
* \return true if the operation could be performed. It can fail when this cause the system the system to last forever,
@ -90,9 +90,9 @@ public:
virtual void notifyTargetRemoved(CPSLocated *ptr);
/// Get emitted type.
CPSLocated *getEmittedType(void) { return _EmittedType; }
CPSLocated *getEmittedType() { return _EmittedType; }
/// Get const ptr on emitted type
const CPSLocated *getEmittedType(void) const { return _EmittedType; }
const CPSLocated *getEmittedType() const { return _EmittedType; }
/** The type of emission.
@ -171,7 +171,7 @@ public:
const CPSAttribMaker<uint32> *getGenNbScheme(void) const { return _GenNbScheme; }
/// Serialization
void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
void serial(NLMISC::IStream &f);
///\name Speed vector options
//@{
@ -336,7 +336,7 @@ protected:
* should not be called directly. Call CPSLocated::resize instead
*/
virtual void resize(uint32 size);
virtual void bounceOccured(uint32 index, TAnimationTime timeToNextSimStep);
virtual void bounceOccurred(uint32 index, TAnimationTime timeToNextSimStep);
void updateMaxCountVect();
@ -424,7 +424,7 @@ class CPSModulatedEmitter
bool useEmitteeSpeedScheme(void) const { return _EmitteeSpeedScheme != NULL; }
/// serialization
void serialEmitteeSpeedScheme(NLMISC::IStream &f) throw(NLMISC::EStream);
void serialEmitteeSpeedScheme(NLMISC::IStream &f);
protected:
@ -470,7 +470,7 @@ public:
}
/// Serialisation
virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
virtual void serial(NLMISC::IStream &f);
NLMISC_DECLARE_CLASS(CPSEmitterDirectionnal);
@ -506,7 +506,7 @@ class CPSRadialEmitter : public CPSEmitterDirectionnal
if (CParticleSystem::getSerializeIdentifierFlag()) _Name = std::string("RadialEmitter");
}
/// Serialisation
virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
virtual void serial(NLMISC::IStream &f);
NLMISC_DECLARE_CLASS(CPSRadialEmitter);
virtual void emit(const NLMISC::CVector &srcPos, uint32 index, NLMISC::CVector &pos, NLMISC::CVector &speed);
};
@ -527,7 +527,7 @@ public:
}
/// Serialisation
virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
virtual void serial(NLMISC::IStream &f);
NLMISC_DECLARE_CLASS(CPSEmitterOmni);
@ -561,7 +561,7 @@ class CPSEmitterRectangle : public CPSEmitter, public CPSModulatedEmitter, publi
}
/// Serialisation
virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
virtual void serial(NLMISC::IStream &f);
NLMISC_DECLARE_CLASS(CPSEmitterRectangle);
@ -636,7 +636,7 @@ public:
}
/// Serialisation
virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
virtual void serial(NLMISC::IStream &f);
NLMISC_DECLARE_CLASS(CPSEmitterConic);
@ -675,7 +675,7 @@ public:
}
/// Serialisation
virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
virtual void serial(NLMISC::IStream &f);
NLMISC_DECLARE_CLASS(CPSSphericalEmitter);

View file

@ -69,7 +69,7 @@ public:
*/
CPSFace(CSmartPtr<ITexture> tex = NULL);
void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
void serial(NLMISC::IStream &f);
NLMISC_DECLARE_CLASS(CPSFace);
/** Tells that all faces are turning in the same manner, and only have a rotationnal bias

View file

@ -40,7 +40,7 @@ public:
*/
CPSFaceLookAt(CSmartPtr<ITexture> tex = NULL);
void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
void serial(NLMISC::IStream &f);
NLMISC_DECLARE_CLASS(CPSFaceLookAt);

View file

@ -47,7 +47,7 @@ public:
CPSFanLight(uint32 nbFans = 7);
/// Dtor
~CPSFanLight();
void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
void serial(NLMISC::IStream &f);
//@}
// Set the number of fans used for drawing (minimum is 3, maximum is 128)

View file

@ -104,7 +104,7 @@ class CPSFloatCurveFunctor
CCtrlPoint(float date, float value) : Date(date), Value(value) { nlassert(Date >= 0 && Date <= 1); }
float Date;
float Value;
void serial(NLMISC::IStream &f) throw(NLMISC::EStream)
void serial(NLMISC::IStream &f)
{
f.serial(Date, Value);
}
@ -166,7 +166,7 @@ class CPSFloatCurveFunctor
float getValue(float date) const;
/// serialization
void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
void serial(NLMISC::IStream &f);
float getMinValue() const { return _MinValue; }
float getMaxValue() const { return _MaxValue; }

View file

@ -70,7 +70,7 @@ public:
virtual void show() = 0;
/// Serial the force definition. MUST be called by deriver during their serialisation
virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
virtual void serial(NLMISC::IStream &f);
/// check whether this force is integrable over time. The default is false
virtual bool isIntegrable(void) const { return false; }
@ -175,7 +175,7 @@ public:
/// get the attribute maker for a non constant intensity
CPSAttribMaker<float> *getIntensityScheme(void) { return _IntensityScheme; }
const CPSAttribMaker<float> *getIntensityScheme(void) const { return _IntensityScheme; }
void serialForceIntensity(NLMISC::IStream &f) throw(NLMISC::EStream);
void serialForceIntensity(NLMISC::IStream &f);
protected:
@ -209,7 +209,7 @@ protected:
class CPSForceIntensityHelper : public CPSForce, public CPSForceIntensity
{
public:
void serial(NLMISC::IStream &f) throw(NLMISC::EStream) ;
void serial(NLMISC::IStream &f);
protected:
virtual CPSLocated *getForceIntensityOwner(void) { return _Owner; }
@ -241,7 +241,7 @@ protected:
*
* // you can provide a serialization method. Note that that if the functor parameters are set before each use,
* // it useless to serial something ...
* void serial(NLMISC::IStream &f) throw(NLMISC::EStream)
* void serial(NLMISC::IStream &f)
*
* protected:
* ...
@ -275,7 +275,7 @@ public:
/// serialization
virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream)
virtual void serial(NLMISC::IStream &f)
{
f.serialVersion(1);
CPSForce::serial(f);
@ -354,7 +354,7 @@ class CPSDirectionnalForce : public CPSForceIntensityHelper, public CPSDirection
}
/// serialization
virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
virtual void serial(NLMISC::IStream &f);
NLMISC_DECLARE_CLASS(CPSDirectionnalForce);
@ -397,7 +397,7 @@ public:
}
/// serialization
virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
virtual void serial(NLMISC::IStream &f);
NLMISC_DECLARE_CLASS(CPSGravity);
@ -443,7 +443,7 @@ public:
}
/// serialization
virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
virtual void serial(NLMISC::IStream &f);
NLMISC_DECLARE_CLASS(CPSCentralGravity);
@ -464,7 +464,7 @@ public:
/// serialization
virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
virtual void serial(NLMISC::IStream &f);
/// Compute the force on the targets
@ -498,7 +498,7 @@ public:
speed -= (CParticleSystem::EllapsedTime * _K * invMass * speed);
}
virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream)
virtual void serial(NLMISC::IStream &f)
{
f.serialVersion(1);
// we don't save intensity info : it is saved by the owning object (and set before each use of this functor)
@ -539,7 +539,7 @@ public:
NLMISC_DECLARE_CLASS(CPSFluidFriction)
virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream)
virtual void serial(NLMISC::IStream &f)
{
f.serialVersion(1);
CIsotropicForceT<CPSFluidFrictionFunctor>::serial(f);
@ -571,7 +571,7 @@ public:
NLMISC_DECLARE_CLASS(CPSBrownianForce)
virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
virtual void serial(NLMISC::IStream &f);
/// We provide a kind of integration on a predefined sequence
virtual bool isIntegrable(void) const;
@ -648,7 +648,7 @@ struct CPSTurbulForceFunc
*/
}
virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream)
virtual void serial(NLMISC::IStream &f)
{
f.serialVersion(1);
f.serial(_Scale, _NumOctaves);
@ -686,7 +686,7 @@ public:
NLMISC_DECLARE_CLASS(CPSTurbul)
virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream)
virtual void serial(NLMISC::IStream &f)
{
f.serialVersion(1);
CIsotropicForceT<CPSTurbulForceFunc>::serial(f);
@ -758,7 +758,7 @@ public:
// serialization
virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
virtual void serial(NLMISC::IStream &f);
@ -801,7 +801,7 @@ class CPSMagneticForce : public CPSDirectionnalForce
}
virtual void computeForces(CPSLocated &target);
/// serialization
virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
virtual void serial(NLMISC::IStream &f);
NLMISC_DECLARE_CLASS(CPSMagneticForce);
};

View file

@ -42,7 +42,7 @@ public:
~CPSLight();
NLMISC_DECLARE_CLASS(CPSLight);
/// Serialisation. Derivers must override this, and call their parent version
virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
virtual void serial(NLMISC::IStream &f);
//@}
virtual uint32 getType(void) const;
virtual uint32 getPriority(void) const { return 600; }

View file

@ -66,14 +66,14 @@ class CParticleSystem;
/// This structure helps to perform the collision step, by telling which collisionner is the nearest if there are several candidate
/// a distance of -1 indicates that no collisions occured
/// a distance of -1 indicates that no collisions occurred
struct CPSCollisionInfo
{
CPSCollisionInfo *Next;
float Dist; // Distance to the nearest collider, or -1 if not collision occured
float Dist; // Distance to the nearest collider, or -1 if not collision occurred
NLMISC::CVector NewPos;
NLMISC::CVector NewSpeed; // The speed of particle after a collision occured. After the updated of collision it is swapped with the post-collision speed
CPSZone *CollisionZone; // The zone on which the bounce occured, can be useful to check the behaviour in case of collision
NLMISC::CVector NewSpeed; // The speed of particle after a collision occurred. After the updated of collision it is swapped with the post-collision speed
CPSZone *CollisionZone; // The zone on which the bounce occurred, can be useful to check the behaviour in case of collision
uint32 Index;
CPSCollisionInfo()
{
@ -356,7 +356,7 @@ public:
void resize(uint32 newSize);
/// serialization
void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
void serial(NLMISC::IStream &f);
/// Shortcut to get an instance of the 3d driver
IDriver *getDriver() const;
@ -449,14 +449,14 @@ public:
void setName(const std::string &name) { _Name = name; }
/// get the located bindable name (edition purpose)
std::string getName(void) const { return _Name; }
std::string getName() const { return _Name; }
/// tells whether there are alive entities / particles in the system
virtual bool hasParticles(void) const;
virtual bool hasParticles() const;
/// tells whether there are alive emitters / particles in the system
virtual bool hasEmitters(void) const;
virtual bool hasEmitters() const;
/** Enable the to force LOD degradation. This will suppress instances immediately, (during the motion pass) so that
* there won't be more than maxNbInstance * dist / maxDist instances. This may not be desirable
@ -468,7 +468,7 @@ public:
/** Test whether LOD degradation was activated
* \see forceLODDegradation()
*/
bool hasLODDegradation(void) const { return _LODDegradation; }
bool hasLODDegradation() const { return _LODDegradation; }
/// for the CPSLocated to reevaluate the max number of faces it may need
@ -730,7 +730,7 @@ public:
/// ctor
CPSLocatedBindable();
/// serialization
virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
virtual void serial(NLMISC::IStream &f);
/** this should be called before to delete any bindable inserted in a system, but this is done
* by the system, so you should never need calling it. This has been introduced because calls in dtor are not polymorphic
* to derived class (which are already destroyed anyway), and some infos are needed in some dtor. The default behaviour does nothing
@ -853,11 +853,11 @@ public:
*/
void setLOD(TPSLod lod) { _LOD = lod; }
/// get the valid lods for that object
TPSLod getLOD(void) const { return _LOD; }
TPSLod getLOD() const { return _LOD; }
/// tells whether there are alive entities / particles
virtual bool hasParticles(void) const { return false; }
virtual bool hasParticles() const { return false; }
/// tells whether there are alive emitters
virtual bool hasEmitters(void) const { return false; }
virtual bool hasEmitters() const { return false; }
/** set the extern ID of this located bindable. 0 means no extern access. The map of ID-locatedBindable. Is in th
* particle system, so this located bindable must have been attached to a particle system, otherwise an assertion is raised
*/
@ -906,10 +906,10 @@ protected:
*/
virtual void resize(uint32 size) = 0;
/** a bounce occured, so some action could be done. The default behaviour does nothing
/** a bounce occurred, so some action could be done. The default behaviour does nothing
* \param index the index of the element that bounced
*/
virtual void bounceOccured(uint32 /* index */, TAnimationTime /* timeToNextsimStep */) {}
virtual void bounceOccurred(uint32 /* index */, TAnimationTime /* timeToNextsimStep */) {}
/** show an drawing to represent the object, and in red if it is selected
* \param tab : a table of 2 * nbSeg vector. only the x and y coordinates are used
@ -1010,7 +1010,7 @@ public:
*/
virtual void releaseTargetRsc(CPSLocated * /* target */) {}
/// Seralization, must be called by derivers
void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
void serial(NLMISC::IStream &f);
/// Finalize this object : the default is to call releaseTargetRsc on targets
virtual void finalize(void);
virtual ~CPSTargetLocatedBindable();

View file

@ -82,7 +82,7 @@ public:
std::string getShape(void) const { return _Shape; }
/// serialisation. Derivers must override this, and call their parent version
virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
virtual void serial(NLMISC::IStream &f);
virtual ~CPSMesh();
@ -271,7 +271,7 @@ public:
/// serialisation. Derivers must override this, and call their parent version
virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
virtual void serial(NLMISC::IStream &f);
NLMISC_DECLARE_CLASS(CPSConstraintMesh);
@ -334,7 +334,7 @@ public:
float WRotSpeed; /* = 0 */
float WRotAccel; /* = 0 */
CGlobalTexAnim();
void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
void serial(NLMISC::IStream &f);
/// Build a texture matrix from a date and this obj.
void buildMatrix(TAnimationTime date, NLMISC::CMatrix &dest);
};
@ -587,10 +587,10 @@ protected:
struct CGlobalTexAnims
{
CGlobalTexAnim Anims[IDRV_MAT_MAXTEXTURES];
void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
void serial(NLMISC::IStream &f);
};
typedef std::auto_ptr<CGlobalTexAnims> PGlobalTexAnims;
typedef CUniquePtr<CGlobalTexAnims> PGlobalTexAnims;
PGlobalTexAnims _GlobalTexAnims;
float _GlobalAnimDate;

View file

@ -107,7 +107,7 @@ public:
virtual uint32 getNumWantedTris() const = 0;
/// serialisation. Derivers must override this, and call their parent version
virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream)
virtual void serial(NLMISC::IStream &f)
{
/// version 3 : global color lighting
/// version 2 : auto-lod saved
@ -210,7 +210,7 @@ class CPSColoredParticle
virtual ~CPSColoredParticle();
/// serialization.
void serialColorScheme(NLMISC::IStream &f) throw(NLMISC::EStream);
void serialColorScheme(NLMISC::IStream &f);
protected:
@ -273,7 +273,7 @@ class CPSSizedParticle
virtual ~CPSSizedParticle();
/// serialization. We choose a different name because of multiple-inheritance
void serialSizeScheme(NLMISC::IStream &f) throw(NLMISC::EStream);
void serialSizeScheme(NLMISC::IStream &f);
protected:
@ -335,7 +335,7 @@ class CPSRotated2DParticle
virtual ~CPSRotated2DParticle();
/// serialization. We choose a different name because of multiple-inheritance
void serialAngle2DScheme(NLMISC::IStream &f) throw(NLMISC::EStream);
void serialAngle2DScheme(NLMISC::IStream &f);
@ -453,7 +453,7 @@ class CPSTexturedParticle
virtual ~CPSTexturedParticle();
/// serialization. We choose a different name because of multiple-inheritance
void serialTextureScheme(NLMISC::IStream &f) throw(NLMISC::EStream);
void serialTextureScheme(NLMISC::IStream &f);
void enumTexs(std::vector<NLMISC::CSmartPtr<ITexture> > &dest);
@ -576,7 +576,7 @@ public:
}
/// serial this object
void serialMultiTex(NLMISC::IStream &f) throw(NLMISC::EStream);
void serialMultiTex(NLMISC::IStream &f);
/** setup a material from this object and a primary texture
* drv is used to check the device caps.
@ -683,7 +683,7 @@ class CPSRotated3DPlaneParticle
virtual ~CPSRotated3DPlaneParticle();
/// serialization. We choose a different name because of multiple-inheritance
void serialPlaneBasisScheme(NLMISC::IStream &f) throw(NLMISC::EStream);
void serialPlaneBasisScheme(NLMISC::IStream &f);
protected:
/// if this is false, constant size will be used instead of a scheme
@ -806,7 +806,7 @@ public:
enum TBlendingMode { add, modulate, alphaBlend, alphaTest };
/// serialization (not named 'serial' because it will be used via multiple-inheritance)
void serialMaterial(NLMISC::IStream &f) throw(NLMISC::EStream);
void serialMaterial(NLMISC::IStream &f);
/// set the blending mode. The default is ass
void setBlendingMode(CPSMaterial::TBlendingMode mode);

View file

@ -66,7 +66,7 @@ struct CPlaneBasis
}
void serial(NLMISC::IStream &f) throw(NLMISC::EStream)
void serial(NLMISC::IStream &f)
{
f.serial(X, Y) ;
}

View file

@ -128,7 +128,7 @@ class CPSPlaneBasisFollowSpeed : public CPSAttribMaker<CPlaneBasis>
NLMISC_DECLARE_CLASS(CPSPlaneBasisFollowSpeed);
/// serialization
virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream)
virtual void serial(NLMISC::IStream &f)
{
// version 2 : added projection plane
// version 1 : nothing to save here
@ -192,7 +192,7 @@ public:
/// get the number of samples for the rotation
uint32 getNumSamples(void) const;
/// serial this object
void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
void serial(NLMISC::IStream &f);
protected:
CPSVector<CPlaneBasis>::V _PBTab;
uint32 _NbSamples;

View file

@ -114,7 +114,7 @@ protected:
void updateVbColNUVForRender(CVertexBuffer &vb, uint32 startIndex, uint32 numQuad, uint32 srcStep, IDriver &drv);
/// DERIVERS MUST CALL this
void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
void serial(NLMISC::IStream &f);
virtual CPSLocated *getColorOwner(void) { return _Owner; }
virtual CPSLocated *getSizeOwner(void) { return _Owner; }
virtual CPSLocated *getTextureIndexOwner(void) { return _Owner; }

View file

@ -55,7 +55,7 @@ public:
/// dtor
~CPSRibbon();
/// serialisation. Derivers must override this, and call their parent version
virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
virtual void serial(NLMISC::IStream &f);
//
NLMISC_DECLARE_CLASS(CPSRibbon);
///@}

View file

@ -52,7 +52,7 @@ public:
///@{
CPSRibbonBase();
/// serialisation. Derivers must override this, and call their parent version
virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
virtual void serial(NLMISC::IStream &f);
///@}
///\name Behaviour

View file

@ -38,7 +38,7 @@ public:
/// dtor
~CPSRibbonLookAt();
/// serialisation. Derivers must override this, and call their parent version
virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
virtual void serial(NLMISC::IStream &f);
//
NLMISC_DECLARE_CLASS(CPSRibbonLookAt);
///@}

View file

@ -54,7 +54,7 @@ public:
float getRadiusCut(void) const { return _RadiusCut; }
/// serialisation. Derivers must override this, and call their parent version
virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
virtual void serial(NLMISC::IStream &f);
NLMISC_DECLARE_CLASS(CPSShockWave);

View file

@ -50,7 +50,7 @@ public:
/// dtor
~CPSSound();
/// serialisation. Derivers must override this, and call their parent version
virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
virtual void serial(NLMISC::IStream &f);
//@}
/// return this bindable type

View file

@ -37,7 +37,7 @@ public:
/// dtor
~CPSTailDot();
/// serialisation. Derivers must override this, and call their parent version
virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
virtual void serial(NLMISC::IStream &f);
//
NLMISC_DECLARE_CLASS(CPSTailDot);
///@}

View file

@ -82,7 +82,7 @@ public:
/// serialization, DERIVER must override this, and call the parent version
virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
virtual void serial(NLMISC::IStream &f);
/** Inherited from CPSTargetLocatedBindable. It's called when one of the targets has been detroyed or detached
@ -120,7 +120,7 @@ protected:
/**
* This set speed of a located so that it looks like bouncing on a surface
* \param locatedIndex the index
* \param bouncePoint the position where the collision occured
* \param bouncePoint the position where the collision occurred
* \param surfNormal the normal of the surface at the collision point (this must be a unit vector)
* \elasticity 1 = full bounce, 0 = no bounce (contact)
* \ellapsedTime the time ellapsed
@ -155,7 +155,7 @@ class CPSZonePlane : public CPSZone, public IPSMover
virtual NLMISC::CVector getNormal(uint32 index);
virtual void setNormal(uint32 index, NLMISC::CVector n);
virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
virtual void serial(NLMISC::IStream &f);
protected:
TPSAttribVector _Normal;
@ -176,7 +176,7 @@ struct CRadiusPair
{
// the adius, and the square radius
float R, R2;
void serial(NLMISC::IStream &f) throw(NLMISC::EStream)
void serial(NLMISC::IStream &f)
{
f.serial(R, R2);
}
@ -205,7 +205,7 @@ class CPSZoneSphere : public CPSZone, public IPSMover
virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
virtual void serial(NLMISC::IStream &f);
// inherited from IPSMover
@ -257,7 +257,7 @@ class CPSZoneDisc : public CPSZone, public IPSMover
virtual NLMISC::CVector getNormal(uint32 index);
virtual void setNormal(uint32 index, NLMISC::CVector n);
virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
virtual void serial(NLMISC::IStream &f);
@ -303,7 +303,7 @@ class CPSZoneCylinder : public CPSZone, public IPSMover
virtual NLMISC::CVector getScale(uint32 k) const;
// serialization
virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
virtual void serial(NLMISC::IStream &f);
@ -350,7 +350,7 @@ class CPSZoneRectangle : public CPSZone, public IPSMover
// serialization
virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
virtual void serial(NLMISC::IStream &f);
// inherited from IPSMover
virtual bool supportUniformScaling(void) const { return true; }

View file

@ -654,7 +654,7 @@ template<class T> typename CQuadGrid<T>::CIterator CQuadGrid<T>::erase(typename
if(!ptr->Selected)
next= NULL;
// delete the object.
_NodeBlockMemory.free(ptr);
_NodeBlockMemory.freeBlock(ptr);
return CIterator((CNode*)next);

View file

@ -53,7 +53,7 @@ public:
public:
// Simple Definition of a mesh used to test against Ray
std::vector<CVector> Vertices;
std::vector<NLMISC::CVector> Vertices;
std::vector<uint32> Triangles;
/// Empty?

View file

@ -28,6 +28,8 @@
#include "nel/3d/shadow_map_manager.h"
#include "nel/3d/u_scene.h"
#include "nel/3d/vertex_program.h"
#include "nel/3d/transform.h"
#include <vector>

View file

@ -22,7 +22,7 @@
#include "nel/misc/smart_ptr.h"
#include "nel/misc/vector.h"
#include "nel/misc/aabbox.h"
#include "nel/misc/class_id.h"
#include "nel/3d/texture.h"
#include "nel/3d/shape.h"
@ -70,7 +70,7 @@ public:
// assignement
CSegRemanenceShape &operator = (const CSegRemanenceShape &other);
virtual void serial(NLMISC::IStream &f) throw(NLMISC::EStream);
virtual void serial(NLMISC::IStream &f);
NLMISC_DECLARE_CLASS(CSegRemanenceShape);
//@}

Some files were not shown because too many files have changed in this diff Show more