Compare commits

..

No commits in common. "19_default_model_cfg_FV" and "main" have entirely different histories.

3720 changed files with 14318 additions and 111980 deletions

8
.gitignore vendored
View file

@ -162,13 +162,6 @@ build/*
install/*
build_vc*
code/nel/tools/build_gamedata/configuration/buildsite.py
code/build_mac
code/build_linux32
code/build_linux64
code/build_windows32
code/build_windows64
code/build_server
code/build_nel_tools
# Linux nel compile
code/nel/build/nel-config
@ -245,7 +238,6 @@ code/ryzom/tools/server/ryzom_ams/old
#tools and external dir's
external
external_vc14
external_stlport
nel_tools*
ryzom_tools*

View file

@ -1,25 +1,17 @@
stages:
- build
- test
- staging
- production
## BUILDS
# Job de compilation pour Linux
Linux client build:
Linux:
stage: build
except:
- ryzomcore
only:
- develop
- /^feature\/.*(\+CI$|\+CI-LIN64.*)/
- tags
tags:
- Docker
image: debian:jessie
- Linux
image: ubuntu:14.04
script:
# Installation des dépendances
- echo "deb http://ftp.debian.org/debian/ jessie-backports non-free contrib main" >> /etc/apt/sources.list
- apt-get update
- apt-get -y upgrade
- apt-get -t jessie-backports install libxml2 -y g++ gcc cmake libcurl4-openssl-dev libgl1-mesa-dev libjpeg-dev libpng-dev libopenal-dev libfreetype6-dev libxxf86vm-dev libxrandr-dev libxrender-dev libvorbis-dev libluabind-dev libboost-dev libmysqlclient-dev libssl-dev liblzma-dev libxml2-dev makeself
- apt-get install -y g++ gcc cmake libgl1-mesa-dev libjpeg-dev libpng12-dev libopenal-dev libfreetype6-dev libxxf86vm-dev libxrandr-dev libxrender-dev libvorbis-dev libluabind-dev libboost-dev libmysqlclient-dev libssl-dev liblzma-dev libxml2-dev
# Installation des dépendances des dépendances statiques (à commenter si construction de Khanat en mode dynamique)
# libxml2 : python-pyicu (support d'unicode), python-dev (support de... python)
- apt-get install -y wget python-pyicu python-dev
@ -28,32 +20,31 @@ Linux client build:
- cd BUILD/x86_64
## Le curl des dépots a trop de dépendances en statique. On le recompile donc, afin d'aléger l'executable
# Téléchargement et décompression des dépendances à recompiller
- wget -c http://curl.haxx.se/download/curl-7.50.0.tar.gz
- tar xzf curl-7.50.0.tar.gz
- wget -c http://curl.haxx.se/download/curl-7.21.0.tar.gz
- tar xzf curl-7.21.0.tar.gz
# Compilation de curl
- cd curl-7.50.0
- ./configure --disable-ldap --disable-ldaps --disable-rtsp --disable-dict --disable-ipv6 --disable-crypto-auth --disable-sspi --disable-tls-srp --without-gnutls --without-librtmp --without-libidn --disable-versioned-symbols --disable-pop3 --without-libssh2 --with-ssl
- make install -j$(nproc)
- cd curl-7.21.0
- ./configure --disable-ldap --disable-ldaps --disable-rtsp --disable-dict --disable-ipv6 --disable-crypto-auth --disable-sspi --disable-tls-srp --without-gnutls --without-librtmp --without-libidn --disable-versioned-symbols --disable-pop3 --without-libssh2 --with-ssl=/usr/lib/x86_64-linux-gnu/libssl.so
- make install -j$(($(nproc)-1))
- cd ..
## Compilation de Khanat
# Configuration
- cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/ -DCMAKE_BUILD_TYPE=Release -DWITH_RYZOM_SERVER=OFF -DWITH_RYZOM_TOOLS=OFF -DWITH_RYZOM_CLIENT=ON -DWITH_NEL_TESTS=OFF -DWITH_NEL_TOOLS=OFF -DWITH_NEL_SAMPLES=OFF -DWITH_STATIC=ON -DWITH_STATIC_DRIVERS=ON -DWITH_STATIC_EXTERNAL=ON -DWITH_UNIX_STRUCTURE=OFF -DWITH_INSTALL_LIBRARIES=OFF -DWITH_LUA52=ON ../../code
- cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=/ -DCMAKE_BUILD_TYPE=Release -DWITH_RYZOM_SERVER=OFF -DWITH_RYZOM_TOOLS=OFF -DWITH_RYZOM_CLIENT=ON -DWITH_NEL_TESTS=OFF -DWITH_NEL_TOOLS=OFF -DWITH_NEL_SAMPLES=OFF -DWITH_STATIC=ON -DWITH_STATIC_DRIVERS=ON -DWITH_STATIC_EXTERNAL=ON -DWITH_UNIX_STRUCTURE=OFF -DWITH_INSTALL_LIBRARIES=OFF -DWITH_LUA52=ON -DCURL_LIBRARY=/usr/local/lib/libcurl.a ../../code
# Compilation et installation
- make -j$(nproc) install DESTDIR=../../Linux/x86_64
# Packaging
- cd ../../
- cp ./dist/khanat/autoextract_script.sh ./Linux/x86_64/
- chmod +x ./Linux/x86_64/autoextract_script.sh
- makeself --nox11 --target /tmp/khanat_installer ./Linux/x86_64/ khanat-$(echo $CI_BUILD_REF | head -c 7 )-$CI_PIPELINE_ID-Linux-x86_64.run "Khanat installer" ./autoextract_script.sh
- make -j$(($(nproc)-1)) install DESTDIR=../../Linux/x86_64
artifacts:
name: "khanat-$(echo $CI_BUILD_REF | head -c 7)-$CI_PIPELINE_ID-Linux-x86_64"
paths:
- khanat-$(echo $CI_BUILD_REF | head -c 7 )-$CI_PIPELINE_ID-Linux-x86_64.run
- Linux
cache:
key: "$CI_BUILD_NAME"
paths:
- BUILD
# Job de compilation pour OSX
OSX client build:
OSX:
stage: build
only:
- develop
- /^feature\/.*(\+CI$|\+CI-OSX.*)/
- tags
tags:
- OSX
@ -64,77 +55,11 @@ OSX client build:
# Configuration
- cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DFINAL_VERSION=ON -DWITH_STATIC=ON -DWITH_STATIC_DRIVERS=ON -DWITH_NEL_TOOLS=OFF -DWITH_NEL_SAMPLES=OFF -DWITH_NEL_TESTS=OFF -DWITH_RYZOM_SERVER=OFF -DWITH_RYZOM_TOOLS=OFF -DWITH_STATIC_EXTERNAL=ON -DWITH_RYZOM_PATCH=ON -DWITH_RYZOM_CUSTOM_PATCH_SERVER=ON -DWITH_LUA52=ON ../../code
# Compilation et installation
- make -j$(($(sysctl -n hw.ncpu)/2)) install DESTDIR=../../OSX/x86_64
- make -j$(($(sysctl -n hw.ncpu)-1)) install DESTDIR=../../OSX/x86_64
artifacts:
name: "khanat-$(echo $CI_BUILD_REF | head -c 7 )-$CI_PIPELINE_ID-OSX-x86_64"
paths:
- OSX/x86_64/*
when: manual
## TESTS
Linux client test:
stage: test
except:
- ryzomcore
tags:
- Docker
image: ubuntu:14.04
script:
# Test de l'installation initiale
- ./khanat-$(echo $CI_BUILD_REF | head -c 7 )-$CI_PIPELINE_ID-Linux-x86_64.run
dependencies:
- Linux client build
.OSX client test:
stage: test
except:
- ryzomcore
tags:
- OSX
script:
- echo "pas encore de test pour le client OSX"
dependencies:
- OSX client build
when: manual
##DEPLOYEMENT TO STAGING (TEST SERVER)
# Job de déploiment vers le staging. Inutilisé pour le moment, il pourrait servir à l'avenir pour déployer automatiquement les nouvelles versions du client/serveur vers l'environnement de staging (zone de test)
.Deploy to Staging:
stage: staging
environment: Staging
except:
- ryzomcore
tags:
- Docker
image: ubuntu:14.04
script:
- echo "pas encore de deployment"
dependencies:
- Linux client build
- Linux client test
- OSX client build
- OSX client test
when: manual
##DEPLOYEMENT TO PRODUCTION
# Job de déploiment vers la production. Inutilisé pour le moment, il pourrait servir à l'avenir pour déployer automatiquement les nouvelles versions du client/serveur vers l'environnement de production
.Release to Production:
stage: production
environment: Production
only:
- tags
tags:
- Docker
image: ubuntu:14.04
script:
- echo "pas encore de tag"
dependencies:
- Linux client build
- Linux client test
- OSX client build
- OSX client test
- Deploy to Staging
when: manual
cache:
key: "$CI_BUILD_NAME"
paths:
- BUILD

View file

@ -36,7 +36,7 @@ IF(COMMAND cmake_policy)
IF(POLICY CMP0020)
CMAKE_POLICY(SET CMP0020 NEW)
ENDIF()
ENDIF()
ENDIF(COMMAND cmake_policy)
INCLUDE(nel)
INCLUDE(ConfigureChecks)
@ -61,12 +61,11 @@ SET(NL_VERSION_MAJOR 0)
SET(NL_VERSION_MINOR 12)
SET(NL_VERSION_PATCH 0)
SET(YEAR "2004-${CURRENT_YEAR}")
SET(AUTHOR "Winch Gate and The Ryzom Core Community")
SET(AUTHOR "Winchgate and The Ryzom Core Community")
SET(RYZOM_VERSION_MAJOR 2)
SET(RYZOM_VERSION_MINOR 9)
SET(RYZOM_VERSION_PATCH 0)
SET(REVISION 0)
#-----------------------------------------------------------------------------
# Redirect output files
@ -76,15 +75,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()
ELSE(WIN32)
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
ENDIF()
ENDIF(WIN32)
IF(WIN32)
IF(WITH_MFC)
FIND_PACKAGE(MFC QUIET)
ENDIF()
ENDIF()
ENDIF(WITH_MFC)
ENDIF(WIN32)
#-----------------------------------------------------------------------------
# Set default config options
@ -98,6 +97,8 @@ NL_SETUP_SNOWBALLS_DEFAULT_OPTIONS()
NL_SETUP_PREFIX_PATHS()
RYZOM_SETUP_PREFIX_PATHS()
NL_CONFIGURE_CHECKS()
NL_SETUP_BUILD()
NL_SETUP_BUILD_FLAGS()
@ -111,8 +112,8 @@ IF(WIN32)
IF(WITH_MFC)
FIND_PACKAGE(CustomMFC REQUIRED)
ENDIF()
ENDIF()
ENDIF(WITH_MFC)
ENDIF(WIN32)
FIND_PACKAGE(ZLIB REQUIRED)
FIND_PACKAGE(LibXml2 REQUIRED)
@ -121,25 +122,15 @@ FIND_PACKAGE(OpenSSL REQUIRED)
FIND_PACKAGE(GIF)
FIND_PACKAGE(Jpeg)
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()
ENDIF(WITH_STATIC_LIBXML2)
IF(WITH_LIBXML2_ICONV)
FIND_PACKAGE(Iconv REQUIRED)
INCLUDE_DIRECTORIES(${ICONV_INCLUDE_DIR})
SET(LIBXML2_LIBRARIES ${LIBXML2_LIBRARIES} ${ICONV_LIBRARIES})
ENDIF()
ENDIF(WITH_LIBXML2_ICONV)
IF(WITH_STATIC)
# libxml2 could need winsock2 library
@ -154,20 +145,20 @@ IF(WITH_STATIC)
SET(LIBXML2_LIBRARIES ${LIBXML2_LIBRARIES} ${LIBLZMA_LIBRARIES})
ENDIF()
ENDIF()
ENDIF()
ENDIF(WITH_STATIC)
INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/PCHSupport.cmake)
IF(FINAL_VERSION)
ADD_DEFINITIONS(-DFINAL_VERSION=1)
ENDIF()
ENDIF(FINAL_VERSION)
IF(WITH_SSE2)
ADD_DEFINITIONS(-DNL_HAS_SSE2)
IF(WITH_SSE3)
ADD_DEFINITIONS(-DNL_HAS_SSE3)
ENDIF()
ENDIF()
ENDIF(WITH_SSE3)
ENDIF(WITH_SSE2)
IF(APPLE_CERTIFICATE)
# Find codesign_allocate
@ -313,7 +304,7 @@ IF(WITH_QT5)
ADD_QT_LIBRARY(XcbQpa)
ADD_QT_LIBRARY(PlatformSupport)
SET(QT_LIBRARIES ${QT_LIBRARIES} -lX11-xcb -lXi -lSM -lICE -lxcb -lGL -lxcb-glx)
SET(QT_LIBRARIES ${QT_LIBRARIES} -lX11-xcb -lXi -lSM -lICE -lxcb -lGL)
IF(EXISTS "${QT_LIBRARY_DIR}/libxcb-static.a")
SET(QT_LIBRARIES ${QT_LIBRARIES} "${QT_LIBRARY_DIR}/libxcb-static.a")
ENDIF()
@ -408,16 +399,16 @@ IF(WITH_QT)
# Use Qt 4
FIND_PACKAGE(Qt4 COMPONENTS QtCore QtGui QtXml QtOpenGL REQUIRED)
ENDIF()
ENDIF(WITH_QT)
IF(WITH_ASSIMP)
FIND_PACKAGE(assimp REQUIRED)
ENDIF()
ENDIF(WITH_ASSIMP)
IF(WITH_NEL)
IF(WITH_NEL_TESTS)
FIND_PACKAGE(CppTest)
ENDIF()
ENDIF(WITH_NEL_TESTS)
IF(WITH_GUI)
FIND_PACKAGE(Luabind REQUIRED)
@ -455,19 +446,19 @@ IF(WITH_NEL)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/nel/include)
ADD_SUBDIRECTORY(nel)
ENDIF()
ENDIF(WITH_NEL)
IF(WITH_RYZOM)
ADD_SUBDIRECTORY(ryzom)
ENDIF()
ENDIF(WITH_RYZOM)
IF(WITH_NELNS)
ADD_SUBDIRECTORY(nelns)
ENDIF()
ENDIF(WITH_NELNS)
IF(WITH_SNOWBALLS)
ADD_SUBDIRECTORY(snowballs2)
ENDIF()
ENDIF(WITH_SNOWBALLS)
IF(WITH_TOOLS)
ADD_SUBDIRECTORY(tool)
@ -475,22 +466,22 @@ ENDIF()
IF(WITH_STUDIO)
ADD_SUBDIRECTORY(studio)
ENDIF()
ENDIF(WITH_STUDIO)
# 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()
ELSE(DOT)
SET(HAVE_DOT NO)
ENDIF()
ENDIF(DOT)
# 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()
ENDIF(BUILD_DOCUMENTATION)
IF(WITH_NEL_TESTS)
ENABLE_TESTING()
@ -500,8 +491,8 @@ IF(WITH_NEL_TESTS)
SET(SVNCOMMAND svn)
SET(SVNSOURCEDIR http://dev.ryzom.com/svn/trunk/nel)
SET(GENERATELOGS svn2cl)
ENDIF()
ENDIF()
ENDIF(BUILD_DASHBOARD)
ENDIF(WITH_NEL_TESTS)
# packaging information
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Ryzom Core MMORPG Framework")
@ -533,10 +524,10 @@ IF(WIN32)
#SET(CPACK_GENERATOR "NSIS")
SET(CPACK_GENERATOR "NSIS;ZIP")
SET(CPACK_SOURCE_GENERATOR "ZIP")
ELSE()
ELSE(WIN32)
SET(CPACK_GENERATOR "TGZ")
SET(CPACK_SOURCE_GENERATOR "TGZ")
ENDIF()
ENDIF(WIN32)
set(CPACK_SOURCE_IGNORE_FILES
"~$"
"\\\\.cvsignore$"
@ -554,8 +545,8 @@ IF(WIN32)
"${QT_LIBRARY_DIR}/../bin/QtXmld4.dll"
"${QT_LIBRARY_DIR}/../bin/QtCored4.dll"
DESTINATION ${NL_BIN_PREFIX})
ENDIF()
ELSE()
ENDIF(WITH_QT)
ELSE(NOT CMAKE_BUILD_TYPE STREQUAL "Release")
IF(WITH_QT)
INCLUDE(${QT_USE_FILE})
INSTALL(FILES
@ -563,8 +554,8 @@ IF(WIN32)
"${QT_LIBRARY_DIR}/../bin/QtXml4.dll"
"${QT_LIBRARY_DIR}/../bin/QtCore4.dll"
DESTINATION ${NL_BIN_PREFIX})
ENDIF()
ENDIF()
ENDIF(WITH_QT)
ENDIF(NOT CMAKE_BUILD_TYPE STREQUAL "Release")
# Install CEGUI and its dependencies.
IF(WITH_NEL_CEGUI)
@ -574,14 +565,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()
ENDIF(WITH_NEL_CEGUI)
# Only the tools require MFC.
IF(WITH_TOOLS)
SET(CMAKE_INSTALL_MFC_LIBRARIES TRUE)
ENDIF()
ENDIF(WITH_TOOLS)
#INCLUDE(InstallRequiredSystemLibraries)
ENDIF()
ENDIF(WIN32)
INCLUDE(CPack)
@ -591,4 +582,4 @@ INCLUDE(CMakePackaging.txt)
#INCLUDE(UseDebian)
#IF(DEBIAN_FOUND)
# ADD_DEBIAN_TARGETS(nel)
#ENDIF()
#ENDIF(DEBIAN_FOUND)

View file

@ -22,8 +22,13 @@ IF(NOT TARGET_CPU)
SET(TARGET_CPU "armv7")
ENDIF()
SET(ARMV7_HARD_FLOAT OFF)
IF(TARGET_CPU STREQUAL "armv7")
SET(LIBRARY_ARCHITECTURE "armeabi-v7a")
IF(ARMV7_HARD_FLOAT)
SET(LIBRARY_ARCHITECTURE "${LIBRARY_ARCHITECTURE}-hard")
ENDIF()
SET(CMAKE_SYSTEM_PROCESSOR "armv7")
SET(TOOLCHAIN_ARCH "arm")
SET(GCC_TOOLCHAIN_PREFIX "arm-linux-androideabi")
@ -118,12 +123,6 @@ MACRO(SEARCH_TOOLCHAIN _COMPILER)
ENDFOREACH()
ENDIF()
# 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(NOT ${_COMPILER}_TOOLCHAIN_VERSIONS)
MESSAGE(FATAL_ERROR "No Android ${_COMPILER} toolchain found in default search path ${NDK_ROOT}/toolchains")
ENDIF()
@ -137,15 +136,7 @@ MACRO(SEARCH_TOOLCHAIN _COMPILER)
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}*")
@ -201,7 +192,7 @@ SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
MACRO(SET_TOOLCHAIN_BINARY_LLVM _NAME _BINARY)
SET(${_NAME} ${CLANG_TOOLCHAIN_ROOT}/bin/${_BINARY}${TOOLCHAIN_BIN_SUFFIX} CACHE PATH "" FORCE)
SET(${_NAME} ${CLANG_TOOLCHAIN_ROOT}/bin/${_BINARY}${TOOLCHAIN_BIN_SUFFIX} CACHE PATH "" FORCE )
ENDMACRO()
MACRO(SET_TOOLCHAIN_BINARY_GCC _NAME _BINARY)
@ -223,14 +214,6 @@ IF(CLANG)
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")

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()
ENDIF()
ENDIF(NOT NM_SYMBOL MATCHES ${SYMBOL})
ENDIF(CMAKE_NM)
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()
ELSE(NOT OBJDUMP_SYMBOL MATCHES "UND")
#MESSAGE(STATUS "${${MYLIBRARY}} uses symbol ${SYMBOL}")
ENDIF()
ENDIF()
ENDIF()
ENDIF(NOT OBJDUMP_SYMBOL MATCHES "UND")
ENDIF(CMAKE_OBJDUMP)
ENDIF(WIN32)
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()
ENDIF()
ENDIF(OTOOL_LIBRARY MATCHES "${LIBNAME}")
ENDIF(CMAKE_OTOOL)
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()
ELSE(OBJDUMP_LIBRARY MATCHES "NEEDED")
#MESSAGE(STATUS "${${MYLIBRARY}} does not reference to ${LIBNAME}!")
ENDIF()
ENDIF()
ENDIF()
ENDIF(OBJDUMP_LIBRARY MATCHES "NEEDED")
ENDIF(CMAKE_OBJDUMP)
ENDIF(WIN32)
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()
ENDIF(SYMBOL_FOUND)
IF(SYMBOL_FOUND AND NOT LIBRARY_FOUND)
SET(${MUSTLINK} YES)
ELSE()
ELSE(SYMBOL_FOUND AND NOT LIBRARY_FOUND)
SET(${MUSTLINK} NO)
ENDIF()
ENDIF(SYMBOL_FOUND AND NOT LIBRARY_FOUND)
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()
ELSE(WIN32 OR WITH_STATIC)
CHECK_UNDEFINED_SYMBOL(${MYLIBRARY} ${SYMBOL} SYMBOL_FOUND)
IF(SYMBOL_FOUND)
CHECK_LINKED_LIBRARY(${MYLIBRARY} ${OTHERLIBRARY} LIBRARY_FOUND)
ENDIF()
ENDIF(SYMBOL_FOUND)
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()
ENDIF()
ENDIF()
ENDIF(SYMBOL_FOUND AND NOT LIBRARY_FOUND)
ENDIF(WIN32 OR WITH_STATIC)
ENDIF(${MYLIBRARY} AND ${OTHERLIBRARY} AND NOT ${OTHERLIBRARY}_LINKED)
IF(MUST_LINK)
MESSAGE(STATUS "Linking with ${${OTHERLIBRARY}}")
SET(${LIBRARIES} ${${LIBRARIES}} ${${OTHERLIBRARY}})
SET(${OTHERLIBRARY}_LINKED TRUE)
ENDIF()
ENDIF(MUST_LINK)
ENDMACRO(LINK_DEPENDS)

View file

@ -40,8 +40,7 @@ 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_SHORT "${RYZOM_VERSION_MAJOR}.${RYZOM_VERSION_MINOR}.${RYZOM_VERSION_PATCH}")
SET(RYZOM_VERSION "${RYZOM_VERSION_SHORT}.${REVISION}")
SET(RYZOM_VERSION "${RYZOM_VERSION_MAJOR}.${RYZOM_VERSION_MINOR}.${RYZOM_VERSION_PATCH}.${REVISION}")
SET(RYZOM_VERSION_RC "${RYZOM_VERSION_MAJOR},${RYZOM_VERSION_MINOR},${RYZOM_VERSION_PATCH},${REVISION}")
NOW(BUILD_DATE)

View file

@ -75,8 +75,8 @@ if(MAXSDK_FOUND)
${MAXSDK_PARAMBLK2_LIBRARY}
${MAXSDK_BMM_LIBRARY} )
ELSE()
else(MAXSDK_FOUND)
set(MAXSDK_LIBRARIES)
ENDIF()
endif(MAXSDK_FOUND)
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()
ENDIF(CEGUI_LIBRARY AND CEGUI_INCLUDE_DIRS)
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()
ELSE()
ENDIF(NOT CEGUI_FIND_QUIETLY)
ELSE(CEGUI_LIBRARY AND CEGUI_INCLUDE_DIRS)
IF(NOT CEGUI_FIND_QUIETLY)
MESSAGE(STATUS "Warning: Unable to find CEGUI!")
ENDIF()
ENDIF()
ENDIF(NOT CEGUI_FIND_QUIETLY)
ENDIF(CEGUI_LIBRARY AND CEGUI_INCLUDE_DIRS)

View file

@ -10,7 +10,7 @@
IF(CPPTEST_LIBRARIES AND CPPTEST_INCLUDE_DIR)
# in cache already
SET(CPPTEST_FIND_QUIETLY TRUE)
ENDIF()
ENDIF(CPPTEST_LIBRARIES AND CPPTEST_INCLUDE_DIR)
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()
ENDIF(WITH_STLPORT)
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()
ENDIF()
ENDIF()
ENDIF(CPPTEST_LIBRARY_DEBUG)
ENDIF(CPPTEST_LIBRARY_RELEASE)
ENDIF(CPPTEST_INCLUDE_DIR)
IF(CPPTEST_FOUND)
IF(NOT CPPTEST_FIND_QUIETLY)
MESSAGE(STATUS "Found CppTest: ${CPPTEST_LIBRARIES}")
ENDIF()
ELSE()
ENDIF(NOT CPPTEST_FIND_QUIETLY)
ELSE(CPPTEST_FOUND)
IF(NOT CPPTEST_FIND_QUIETLY)
MESSAGE(STATUS "Warning: Unable to find CppTest!")
ENDIF()
ENDIF()
ENDIF(NOT CPPTEST_FIND_QUIETLY)
ENDIF(CPPTEST_FOUND)
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()
ENDIF(CustomMFC_FIND_REQUIRED)
IF(NOT MFC_DIR)
# If MFC have been found, remember their directory
IF(VC_DIR)
SET(MFC_STANDARD_DIR "${VC_DIR}/atlmfc")
ENDIF()
ENDIF(VC_DIR)
FIND_PATH(MFC_DIR
include/afxwin.h
HINTS
${MFC_STANDARD_DIR}
)
ENDIF()
ENDIF(NOT MFC_DIR)
# 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,9 +33,9 @@ IF(MFC_FOUND)
# Using 32 or 64 bits libraries
IF(TARGET_X64)
SET(MFC_LIBRARY_DIR "${MFC_DIR}/lib/amd64")
ELSE()
ELSE(TARGET_X64)
SET(MFC_LIBRARY_DIR "${MFC_DIR}/lib")
ENDIF()
ENDIF(TARGET_X64)
# Add MFC libraries directory to default library path
LINK_DIRECTORIES(${MFC_LIBRARY_DIR})

View file

@ -8,7 +8,7 @@
if(DSOUND_INCLUDE_DIR)
# Already in cache, be silent
set(DSOUND_FIND_QUIETLY TRUE)
ENDIF()
endif(DSOUND_INCLUDE_DIR)
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()
else(DSOUND_FOUND)
set(DSOUND_LIBRARIES)
ENDIF()
endif(DSOUND_FOUND)
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()
ENDIF(DXSDK_DIR)
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()
ENDIF(EFXUTIL_LIBRARY AND EFXUTIL_INCLUDE_DIR)
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()
ELSE()
ENDIF(NOT EFXUTIL_FIND_QUIETLY)
ELSE(EFXUTIL_LIBRARY AND EFXUTIL_INCLUDE_DIR)
IF(NOT EFXUTIL_FIND_QUIETLY)
MESSAGE(STATUS "Warning: Unable to find EFX-Util!")
ENDIF()
ENDIF()
ENDIF(NOT EFXUTIL_FIND_QUIETLY)
ENDIF(EFXUTIL_LIBRARY AND EFXUTIL_INCLUDE_DIR)

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()
ENDIF(WITH_STLPORT)
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()
ENDIF(FMOD_LIBRARY AND FMOD_INCLUDE_DIR)
FIND_PATH(FMOD_INCLUDE_DIR
@ -25,9 +25,9 @@ FIND_PATH(FMOD_INCLUDE_DIR
IF(TARGET_X64)
SET(FMOD_LIBRARY_NAMES fmod64 fmod)
ELSE()
ELSE(TARGET_X64)
SET(FMOD_LIBRARY_NAMES fmodvc fmod)
ENDIF()
ENDIF(TARGET_X64)
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()
ELSE()
ENDIF(NOT FMOD_FIND_QUIETLY)
ELSE(FMOD_LIBRARY AND FMOD_INCLUDE_DIR)
IF(NOT FMOD_FIND_QUIETLY)
MESSAGE(STATUS "Warning: Unable to find FMOD!")
ENDIF()
ENDIF()
ENDIF(NOT FMOD_FIND_QUIETLY)
ENDIF(FMOD_LIBRARY AND FMOD_INCLUDE_DIR)

View file

@ -7,7 +7,7 @@
IF(FREETYPE_LIBRARIES AND FREETYPE_INCLUDE_DIRS)
# in cache already
SET(Freetype_FIND_QUIETLY TRUE)
ENDIF()
ENDIF(FREETYPE_LIBRARIES AND FREETYPE_INCLUDE_DIRS)
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()
ENDIF(NOT FREETYPE_INCLUDE_DIRS)
# 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()
ENDIF(FREETYPE_ADDITIONAL_INCLUDE_DIR)
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()
ENDIF()
ENDIF(FREETYPE_LIBRARY_RELEASE AND FREETYPE_LIBRARY_DEBUG)
ENDIF(FREETYPE_INCLUDE_DIRS)
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()
ENDIF()
ENDIF(BZIP2_FOUND)
ENDIF(WITH_STATIC_EXTERNAL AND APPLE)
IF(NOT Freetype_FIND_QUIETLY)
MESSAGE(STATUS "Found FreeType: ${FREETYPE_LIBRARIES}")
ENDIF()
ELSE()
ENDIF(NOT Freetype_FIND_QUIETLY)
ELSE(FREETYPE_LIBRARY AND FREETYPE_INCLUDE_DIRS)
IF(NOT Freetype_FIND_QUIETLY)
MESSAGE(STATUS "Warning: Unable to find FreeType!")
ENDIF()
ENDIF()
ENDIF(NOT Freetype_FIND_QUIETLY)
ENDIF(FREETYPE_FOUND)

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()
ENDIF(ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
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()
endif(ICONV_HAVE_WERROR)
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()
ENDIF(ICONV_FOUND)
set(CMAKE_REQUIRED_INCLUDES)
set(CMAKE_REQUIRED_LIBRARIES)
IF(ICONV_FOUND)
IF(NOT ICONV_FIND_QUIETLY)
MESSAGE(STATUS "Found Iconv: ${ICONV_LIBRARIES}")
ENDIF()
ELSE()
ENDIF(NOT ICONV_FIND_QUIETLY)
ELSE(ICONV_FOUND)
IF(Iconv_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find Iconv")
ENDIF()
ENDIF()
ENDIF(Iconv_FIND_REQUIRED)
ENDIF(ICONV_FOUND)
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()
ENDIF(JPEG_LIBRARY AND JPEG_INCLUDE_DIR)
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()
ELSE()
ENDIF(NOT JPEG_FIND_QUIETLY)
ELSE(JPEG_LIBRARY AND JPEG_INCLUDE_DIR)
IF(NOT JPEG_FIND_QUIETLY)
MESSAGE(STATUS "Warning: Unable to find Jpeg!")
ENDIF()
ENDIF()
ENDIF(NOT JPEG_FIND_QUIETLY)
ENDIF(JPEG_LIBRARY AND JPEG_INCLUDE_DIR)

View file

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

View file

@ -7,7 +7,7 @@
IF(LIBVR_LIBRARIES AND LIBVR_INCLUDE_DIR)
# in cache already
SET(LIBVR_FIND_QUIETLY TRUE)
ENDIF()
ENDIF(LIBVR_LIBRARIES AND LIBVR_INCLUDE_DIR)
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()
ENDIF(NOT LIBVR_FIND_QUIETLY)
SET(LIBVR_FOUND "YES")
SET(LIBVR_DEFINITIONS "-DHAVE_LIBVR")
SET(NL_STEREO_AVAILABLE ON)
ELSE()
ELSE(LIBVR_LIBRARY AND LIBVR_INCLUDE_DIR)
IF(NOT LIBVR_FIND_QUIETLY)
MESSAGE(STATUS "Warning: Unable to find LibVR!")
ENDIF()
ENDIF()
ENDIF(NOT LIBVR_FIND_QUIETLY)
ENDIF(LIBVR_LIBRARY AND LIBVR_INCLUDE_DIR)

View file

@ -124,7 +124,7 @@ IF(WITH_LUA51)
IF(WITH_STLPORT)
LIST(APPEND LIBRARY_NAME_RELEASE luabind_stlport_lua51)
LIST(APPEND LIBRARY_NAME_DEBUG luabind_stlport_lua51d)
ENDIF()
ENDIF(WITH_STLPORT)
LIST(APPEND LIBRARY_NAME_RELEASE luabind_lua51)
LIST(APPEND LIBRARY_NAME_DEBUG luabind_lua51d)
@ -134,7 +134,7 @@ IF(WITH_LUA50)
IF(WITH_STLPORT)
LIST(APPEND LIBRARY_NAME_RELEASE luabind_stlport_lua50)
LIST(APPEND LIBRARY_NAME_DEBUG luabind_stlport_lua50d)
ENDIF()
ENDIF(WITH_STLPORT)
LIST(APPEND LIBRARY_NAME_RELEASE luabind_lua50)
LIST(APPEND LIBRARY_NAME_DEBUG luabind_lua50d)
@ -143,7 +143,7 @@ ENDIF()
IF(WITH_STLPORT)
LIST(APPEND LIBRARY_NAME_RELEASE luabind_stlport)
LIST(APPEND LIBRARY_NAME_DEBUG luabind_stlportd)
ENDIF()
ENDIF(WITH_STLPORT)
# generic libraries names
LIST(APPEND LIBRARY_NAME_RELEASE luabind libluabind)
@ -194,8 +194,8 @@ 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()
ENDIF()
ENDIF(LUABIND_LIBRARY_RELEASE AND LUABIND_LIBRARY_DEBUG)
ENDIF(LUABIND_INCLUDE_DIR AND Boost_INCLUDE_DIR)
IF(LUABIND_FOUND)
SET(LUABIND_INCLUDE_DIR ${LUABIND_INCLUDE_DIR} ${Boost_INCLUDE_DIR})
@ -203,17 +203,17 @@ IF(LUABIND_FOUND)
FIND_FILE(LUABIND_VERSION_FILE luabind/version.hpp PATHS ${LUABIND_INCLUDE_DIR})
IF(LUABIND_VERSION_FILE)
SET(LUABIND_DEFINITIONS "-DHAVE_LUABIND_VERSION")
ENDIF()
ENDIF(LUABIND_VERSION_FILE)
FIND_CORRECT_LUA_VERSION()
IF(NOT Luabind_FIND_QUIETLY)
MESSAGE(STATUS "Found Luabind: ${LUABIND_LIBRARIES}")
ENDIF()
ELSE()
ENDIF(NOT Luabind_FIND_QUIETLY)
ELSE(LUABIND_FOUND)
IF(NOT Luabind_FIND_QUIETLY)
MESSAGE(STATUS "Warning: Unable to find Luabind!")
ENDIF()
ENDIF()
ENDIF(NOT Luabind_FIND_QUIETLY)
ENDIF(LUABIND_FOUND)
MARK_AS_ADVANCED(LUABIND_LIBRARY_RELEASE LUABIND_LIBRARY_DEBUG Boost_LIB_DIAGNOSTIC_DEFINITIONS)

View file

@ -7,7 +7,7 @@
IF(OGG_LIBRARY AND OGG_INCLUDE_DIR)
# in cache already
SET(OGG_FIND_QUIETLY TRUE)
ENDIF()
ENDIF(OGG_LIBRARY AND OGG_INCLUDE_DIR)
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()
ELSE()
ENDIF(NOT OGG_FIND_QUIETLY)
ELSE(OGG_LIBRARY AND OGG_INCLUDE_DIR)
IF(NOT OGG_FIND_QUIETLY)
MESSAGE(STATUS "Warning: Unable to find Ogg!")
ENDIF()
ENDIF()
ENDIF(NOT OGG_FIND_QUIETLY)
ENDIF(OGG_LIBRARY AND OGG_INCLUDE_DIR)

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()
ELSE(OPENGLES_EGL_LIBRARY)
SET(OPENGLES_EGL_FOUND "NO")
ENDIF()
ENDIF()
ENDIF(OPENGLES_EGL_LIBRARY)
ENDIF(OPENGLES_GLES_LIBRARY)

View file

@ -9,7 +9,7 @@
IF(STLPORT_LIBRARIES AND STLPORT_INCLUDE_DIR)
# in cache already
SET(STLPORT_FIND_QUIETLY TRUE)
ENDIF()
ENDIF(STLPORT_LIBRARIES AND STLPORT_INCLUDE_DIR)
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()
ENDIF()
ENDIF()
ENDIF(STLPORT_LIBRARY_DEBUG)
ENDIF(STLPORT_LIBRARY_RELEASE)
ENDIF(STLPORT_INCLUDE_DIR)
IF(STLPORT_FOUND)
IF(NOT STLPORT_FIND_QUIETLY)
MESSAGE(STATUS "Found STLport: ${STLPORT_LIBRARIES}")
ENDIF()
ELSE()
ENDIF(NOT STLPORT_FIND_QUIETLY)
ELSE(STLPORT_FOUND)
IF(NOT STLPORT_FIND_QUIETLY)
MESSAGE(STATUS "Warning: Unable to find STLport!")
ENDIF()
ENDIF()
ENDIF(NOT STLPORT_FIND_QUIETLY)
ENDIF(STLPORT_FOUND)
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()
ENDIF(SQUISH_LIBRARIES AND SQUISH_INCLUDE_DIR)
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()
ELSE(SQUISH_LIBRARY_DEBUG)
SET(SQUISH_LIBRARIES "${SQUISH_LIBRARIES};debug;${SQUISH_LIBRARY_RELEASE}")
MESSAGE("Debug Squish NOT found, using the release version!")
ENDIF()
ENDIF()
ENDIF()
ENDIF(SQUISH_LIBRARY_DEBUG)
ENDIF(SQUISH_LIBRARY_RELEASE)
ENDIF(SQUISH_INCLUDE_DIR)
IF(SQUISH_FOUND)
IF(NOT SQUISH_FIND_QUIETLY)
MESSAGE(STATUS "Found Squish: ${SQUISH_LIBRARIES}")
ENDIF()
ENDIF(NOT SQUISH_FIND_QUIETLY)
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()
ELSE()
ENDIF(METRIC)
ELSE(SQUISH_FOUND)
IF(NOT SQUISH_FIND_QUIETLY)
MESSAGE(STATUS "Warning: Unable to find Squish!")
ENDIF()
ENDIF()
ENDIF(NOT SQUISH_FIND_QUIETLY)
ENDIF(SQUISH_FOUND)
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()
ENDIF(VORBIS_LIBRARY AND VORBIS_INCLUDE_DIR)
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()
ELSE()
ENDIF(NOT VORBIS_FIND_QUIETLY)
ELSE(VORBIS_LIBRARY AND VORBISFILE_LIBRARY AND VORBIS_INCLUDE_DIR)
IF(NOT VORBIS_FIND_QUIETLY)
MESSAGE(STATUS "Warning: Unable to find Vorbis!")
ENDIF()
ENDIF()
ENDIF(NOT VORBIS_FIND_QUIETLY)
ENDIF(VORBIS_LIBRARY AND VORBISFILE_LIBRARY AND VORBIS_INCLUDE_DIR)

View file

@ -366,34 +366,19 @@ FIND_PATH(WINSDK_LIBRARY_DIR ComCtl32.lib
)
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}")
# directory where UCRT headers are found
FIND_PATH(WINSDK_UCRT_INCLUDE_DIR corecrt.h
HINTS
${WINSDK_UCRT_INCLUDE_ROOT_DIR}/${UCRT_VERSION}/ucrt
${WINSDK_UCRT_DIR}/Include/10.0.10056.0/ucrt
${WINSDK_UCRT_DIR}/Include/10.0.10150.0/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}
${WINSDK_UCRT_DIR}/Lib/10.0.10056.0/ucrt/${WINSDK8_SUFFIX}
${WINSDK_UCRT_DIR}/Lib/10.0.10150.0/ucrt/${WINSDK8_SUFFIX}
)
ENDIF()
ENDIF()
# signtool is used to sign executables

View file

@ -7,7 +7,7 @@
IF(XF86VidMode_LIBRARY AND XF86VidMode_INCLUDE_DIR)
# in cache already
SET(XF86VidMode_FIND_QUIETLY TRUE)
ENDIF()
ENDIF(XF86VidMode_LIBRARY AND XF86VidMode_INCLUDE_DIR)
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()
ELSE()
ENDIF(NOT XF86VidMode_FIND_QUIETLY)
ELSE(XF86VidMode_LIBRARY AND XF86VidMode_INCLUDE_DIR)
IF(NOT XF86VidMode_FIND_QUIETLY)
MESSAGE(STATUS "Warning: Unable to find XF86VidMode!")
ENDIF()
ENDIF()
ENDIF(NOT XF86VidMode_FIND_QUIETLY)
ENDIF(XF86VidMode_LIBRARY AND XF86VidMode_INCLUDE_DIR)

View file

@ -33,29 +33,17 @@ MACRO(PCH_SET_COMPILE_FLAGS _target)
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)
SET(_FLAG ${CMAKE_CXX_FLAGS_${_UPPER_BUILD}})
SEPARATE_ARGUMENTS(_FLAG)
LIST(APPEND _FLAGS ${_FLAG})
LIST(APPEND _FLAGS " ${CMAKE_CXX_FLAGS_${_UPPER_BUILD}}")
GET_TARGET_PROPERTY(_targetType ${_target} TYPE)
SET(_USE_PIC OFF)
IF(${_targetType} STREQUAL "SHARED_LIBRARY" OR ${_targetType} STREQUAL "MODULE_LIBRARY")
SET(_FLAG ${CMAKE_SHARED_LIBRARY_CXX_FLAGS})
SEPARATE_ARGUMENTS(_FLAG)
LIST(APPEND _FLAGS ${_FLAG})
LIST(APPEND _FLAGS " ${CMAKE_SHARED_LIBRARY_CXX_FLAGS}")
ELSE()
GET_TARGET_PROPERTY(_pic ${_target} POSITION_INDEPENDENT_CODE)
IF(_pic)
@ -65,71 +53,67 @@ 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 "$<$<BOOL:${item}>:-D$<JOIN:${item},-D>>")
LIST(APPEND GLOBAL_DEFINITIONS " -D${item}")
ENDFOREACH()
ENDIF()
GET_DIRECTORY_PROPERTY(DEFINITIONS COMPILE_DEFINITIONS_${_UPPER_BUILD})
IF(DEFINITIONS)
FOREACH(item ${DEFINITIONS})
LIST(APPEND GLOBAL_DEFINITIONS "$<$<BOOL:${item}>:-D$<JOIN:${item},-D>>")
LIST(APPEND GLOBAL_DEFINITIONS " -D${item}")
ENDFOREACH()
ENDIF()
GET_DIRECTORY_PROPERTY(DEFINITIONS DIRECTORY ${CMAKE_SOURCE_DIR} COMPILE_DEFINITIONS)
IF(DEFINITIONS)
FOREACH(item ${DEFINITIONS})
LIST(APPEND GLOBAL_DEFINITIONS "$<$<BOOL:${item}>:-D$<JOIN:${item},-D>>")
LIST(APPEND GLOBAL_DEFINITIONS " -D${item}")
ENDFOREACH()
ENDIF()
GET_DIRECTORY_PROPERTY(DEFINITIONS DIRECTORY ${CMAKE_SOURCE_DIR} COMPILE_DEFINITIONS_${_UPPER_BUILD})
IF(DEFINITIONS)
FOREACH(item ${DEFINITIONS})
LIST(APPEND GLOBAL_DEFINITIONS "$<$<BOOL:${item}>:-D$<JOIN:${item},-D>>")
LIST(APPEND GLOBAL_DEFINITIONS " -D${item}")
ENDFOREACH()
ENDIF()
GET_TARGET_PROPERTY(oldProps ${_target} COMPILE_FLAGS)
IF(oldProps)
LIST(APPEND _FLAGS ${oldProps})
LIST(APPEND _FLAGS " ${oldProps}")
ENDIF()
GET_TARGET_PROPERTY(oldPropsBuild ${_target} COMPILE_FLAGS_${_UPPER_BUILD})
IF(oldPropsBuild)
LIST(APPEND _FLAGS ${oldPropsBuild})
LIST(APPEND _FLAGS " ${oldPropsBuild}")
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 "$<$<BOOL:${item}>:-D$<JOIN:${item},-D>>")
LIST(APPEND GLOBAL_DEFINITIONS " -D${item}")
ENDFOREACH()
ENDIF()
GET_TARGET_PROPERTY(DEFINITIONS ${_target} COMPILE_DEFINITIONS_${_UPPER_BUILD})
IF(DEFINITIONS)
FOREACH(item ${DEFINITIONS})
LIST(APPEND GLOBAL_DEFINITIONS "$<$<BOOL:${item}>:-D$<JOIN:${item},-D>>")
LIST(APPEND GLOBAL_DEFINITIONS " -D${item}")
ENDFOREACH()
ENDIF()
@ -142,7 +126,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()
@ -151,7 +135,10 @@ MACRO(PCH_SET_COMPILE_FLAGS _target)
IF(_DEFINITIONS)
FOREACH(item ${_DEFINITIONS})
LIST(APPEND GLOBAL_DEFINITIONS "$<$<BOOL:${item}>:-D$<JOIN:${item},-D>>")
# don't use dynamic expressions
IF(NOT item MATCHES "\\$<")
LIST(APPEND GLOBAL_DEFINITIONS " -D${item}")
ENDIF()
ENDFOREACH()
ENDIF()
ENDIF()
@ -162,7 +149,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
@ -171,26 +158,28 @@ 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})
LIST(APPEND _FLAGS " ${_directory_flags}")
LIST(APPEND _FLAGS " ${_directory_definitions}")
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)
@ -247,7 +236,6 @@ MACRO(PCH_SET_COMPILE_FLAGS _target)
ENDIF()
IF(PCH_FLAGS)
LIST(REMOVE_ITEM PCH_FLAGS "")
LIST(REMOVE_DUPLICATES PCH_FLAGS)
ENDIF()
ENDMACRO()
@ -259,16 +247,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()
ELSE(${_targetType} STREQUAL EXECUTABLE)
SET(_targetOutput ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
ENDIF()
ENDIF(${_targetType} STREQUAL EXECUTABLE)
# 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()
ENDIF(${_targetPostfix} MATCHES NOTFOUND)
SET(${_out_filename} "${_targetOutput}/${_target}${_targetPostfix}.pdb")
ENDMACRO(GET_PDB_FILENAME)

View file

@ -177,26 +177,26 @@ ENDIF()
# set the architecture for iOS - using ARCHS_STANDARD_32_BIT sets armv7,armv7s and appears to be XCode's standard.
# The other value that works is ARCHS_UNIVERSAL_IPHONE_OS but that sets armv7 only
IF(ARCHS)
SET(CMAKE_OSX_ARCHITECTURES ${ARCHS} CACHE STRING "Build architecture for iOS")
SET(CMAKE_OSX_ARCHITECTURES ${ARCHS} CACHE string "Build architecture for iOS")
ENDIF()
# Set the find root to the iOS developer roots and to user defined paths
SET(CMAKE_FIND_ROOT_PATH ${CMAKE_IOS_DEVELOPER_ROOT} ${CMAKE_IOS_SDK_ROOT} ${CMAKE_PREFIX_PATH} ${CMAKE_INSTALL_PREFIX} ${CMAKE_SOURCE_DIR}/external $ENV{EXTERNAL_IOS_PATH} CACHE STRING "iOS find search path root")
set (CMAKE_FIND_ROOT_PATH ${CMAKE_IOS_DEVELOPER_ROOT} ${CMAKE_IOS_SDK_ROOT} ${CMAKE_PREFIX_PATH} ${CMAKE_INSTALL_PREFIX} $ENV{EXTERNAL_IOS_PATH} CACHE string "iOS find search path root")
# default to searching for frameworks first
SET(CMAKE_FIND_FRAMEWORK FIRST)
set (CMAKE_FIND_FRAMEWORK FIRST)
# set up the default search directories for frameworks
SET(CMAKE_SYSTEM_FRAMEWORK_PATH
set (CMAKE_SYSTEM_FRAMEWORK_PATH
${CMAKE_IOS_SDK_ROOT}/System/Library/Frameworks
${CMAKE_IOS_SDK_ROOT}/System/Library/PrivateFrameworks
${CMAKE_IOS_SDK_ROOT}/Developer/Library/Frameworks
)
# only search the iOS sdks, not the remainder of the host filesystem
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
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

@ -4,7 +4,7 @@ SET(CMAKE_TRY_COMPILE_CONFIGURATION "Release")
# Force Release configuration by default
IF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE "Release" CACHE STRING "" FORCE)
ENDIF()
ENDIF(NOT CMAKE_BUILD_TYPE)
# Declare CMAKE_CONFIGURATION_TYPES before PROJECT
SET(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "" FORCE)
@ -17,7 +17,7 @@ MACRO(NL_GEN_PC name)
IF(NOT WIN32 AND WITH_INSTALL_LIBRARIES)
CONFIGURE_FILE(${name}.in "${CMAKE_CURRENT_BINARY_DIR}/${name}")
INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/${name}" DESTINATION ${NL_LIB_PREFIX}/pkgconfig)
ENDIF()
ENDIF(NOT WIN32 AND WITH_INSTALL_LIBRARIES)
ENDMACRO(NL_GEN_PC)
###
@ -26,9 +26,9 @@ ENDMACRO(NL_GEN_PC)
MACRO(NL_TARGET_LIB name)
IF(WITH_STATIC)
ADD_LIBRARY(${name} STATIC ${ARGN})
ELSE()
ELSE(WITH_STATIC)
ADD_LIBRARY(${name} SHARED ${ARGN})
ENDIF()
ENDIF(WITH_STATIC)
ENDMACRO(NL_TARGET_LIB)
###
@ -37,9 +37,9 @@ ENDMACRO(NL_TARGET_LIB)
MACRO(NL_TARGET_DRIVER name)
IF(WITH_STATIC_DRIVERS)
ADD_LIBRARY(${name} STATIC ${ARGN})
ELSE()
ELSE(WITH_STATIC_DRIVERS)
ADD_LIBRARY(${name} MODULE ${ARGN})
ENDIF()
ENDIF(WITH_STATIC_DRIVERS)
ENDMACRO(NL_TARGET_DRIVER)
###
@ -64,35 +64,16 @@ MACRO(NL_DEFAULT_PROPS name label)
VERSION ${NL_VERSION} SOVERSION ${NL_VERSION_MAJOR})
IF(NL_LIB_PREFIX)
SET_TARGET_PROPERTIES(${name} PROPERTIES INSTALL_NAME_DIR ${NL_LIB_PREFIX})
ENDIF()
ENDIF()
ENDIF(NL_LIB_PREFIX)
ENDIF(${type} STREQUAL SHARED_LIBRARY)
IF(${type} STREQUAL EXECUTABLE AND WIN32 AND NOT MINGW)
# check if using a GUI
GET_TARGET_PROPERTY(_VALUE ${name} WIN32_EXECUTABLE)
IF(TARGET_X64)
# Target Windows XP 64 bits
SET(_SUBSYSTEM_VERSION "5.02")
ELSE()
# Target Windows XP
SET(_SUBSYSTEM_VERSION "5.01")
ENDIF()
IF(_VALUE)
# GUI
SET(_SUBSYSTEM "WINDOWS")
ELSE()
# Console
SET(_SUBSYSTEM "CONSOLE")
ENDIF()
SET_TARGET_PROPERTIES(${name} PROPERTIES
VERSION ${NL_VERSION}
SOVERSION ${NL_VERSION_MAJOR}
COMPILE_FLAGS "/GA"
LINK_FLAGS "/VERSION:${NL_VERSION_MAJOR}.${NL_VERSION_MINOR} /SUBSYSTEM:${_SUBSYSTEM},${_SUBSYSTEM_VERSION}")
ENDIF()
LINK_FLAGS "/VERSION:${NL_VERSION_MAJOR}.${NL_VERSION_MINOR}")
ENDIF(${type} STREQUAL EXECUTABLE AND WIN32 AND NOT MINGW)
ENDMACRO(NL_DEFAULT_PROPS)
###
@ -102,7 +83,7 @@ ENDMACRO(NL_DEFAULT_PROPS)
MACRO(NL_ADD_LIB_SUFFIX name)
IF(WIN32)
SET_TARGET_PROPERTIES(${name} PROPERTIES DEBUG_POSTFIX "_d" RELEASE_POSTFIX "_r")
ENDIF()
ENDIF(WIN32)
ENDMACRO(NL_ADD_LIB_SUFFIX)
###
@ -114,10 +95,10 @@ MACRO(NL_ADD_RUNTIME_FLAGS name)
# SET_TARGET_PROPERTIES(${name} PROPERTIES
# LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_DEBUG}"
# LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE}")
ENDIF()
ENDIF(WIN32)
IF(WITH_STLPORT)
TARGET_LINK_LIBRARIES(${name} ${STLPORT_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
ENDIF()
ENDIF(WITH_STLPORT)
ENDMACRO(NL_ADD_RUNTIME_FLAGS)
MACRO(NL_ADD_STATIC_VID_DRIVERS name)
@ -125,25 +106,25 @@ MACRO(NL_ADD_STATIC_VID_DRIVERS name)
IF(WIN32)
IF(WITH_DRIVER_DIRECT3D)
TARGET_LINK_LIBRARIES(${name} nel_drv_direct3d_win)
ENDIF()
ENDIF()
ENDIF(WITH_DRIVER_DIRECT3D)
ENDIF(WIN32)
IF(WITH_DRIVER_OPENGL)
IF(WIN32)
TARGET_LINK_LIBRARIES(${name} nel_drv_opengl_win)
ELSE()
ELSE(WIN32)
TARGET_LINK_LIBRARIES(${name} nel_drv_opengl)
ENDIF()
ENDIF()
ENDIF(WIN32)
ENDIF(WITH_DRIVER_OPENGL)
IF(WITH_DRIVER_OPENGLES)
IF(WIN32)
TARGET_LINK_LIBRARIES(${name} nel_drv_opengles_win)
ELSE()
ELSE(WIN32)
TARGET_LINK_LIBRARIES(${name} nel_drv_opengles)
ENDIF()
ENDIF()
ENDIF()
ENDIF(WIN32)
ENDIF(WITH_DRIVER_OPENGLES)
ENDIF(WITH_STATIC_DRIVERS)
ENDMACRO(NL_ADD_STATIC_VID_DRIVERS)
MACRO(NL_ADD_STATIC_SND_DRIVERS name)
@ -151,30 +132,30 @@ MACRO(NL_ADD_STATIC_SND_DRIVERS name)
IF(WIN32)
IF(WITH_DRIVER_DSOUND)
TARGET_LINK_LIBRARIES(${name} nel_drv_dsound_win)
ENDIF()
ENDIF(WITH_DRIVER_DSOUND)
IF(WITH_DRIVER_XAUDIO2)
TARGET_LINK_LIBRARIES(${name} nel_drv_xaudio2_win)
ENDIF()
ENDIF(WITH_DRIVER_XAUDIO2)
IF(WITH_DRIVER_OPENAL)
TARGET_LINK_LIBRARIES(${name} nel_drv_openal_win)
ENDIF()
ENDIF(WITH_DRIVER_OPENAL)
IF(WITH_DRIVER_FMOD)
TARGET_LINK_LIBRARIES(${name} nel_drv_fmod_win)
ENDIF()
ELSE()
ENDIF(WITH_DRIVER_FMOD)
ELSE(WIN32)
IF(WITH_DRIVER_OPENAL)
TARGET_LINK_LIBRARIES(${name} nel_drv_openal)
ENDIF()
ENDIF(WITH_DRIVER_OPENAL)
IF(WITH_DRIVER_FMOD)
TARGET_LINK_LIBRARIES(${name} nel_drv_fmod)
ENDIF()
ENDIF()
ENDIF(WITH_DRIVER_FMOD)
ENDIF(WIN32)
ENDIF()
ENDIF(WITH_STATIC_DRIVERS)
ENDMACRO(NL_ADD_STATIC_SND_DRIVERS)
###
@ -192,14 +173,14 @@ Remove the CMakeCache.txt file and try again from another folder, e.g.:
cd cmake
cmake ..
")
ENDIF()
ENDIF(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
ENDMACRO(CHECK_OUT_OF_SOURCE)
MACRO(NL_SETUP_DEFAULT_OPTIONS)
IF(WITH_QT)
OPTION(WITH_STUDIO "Build Core Studio" OFF )
ENDIF()
ENDIF(WITH_QT)
###
# Features
@ -213,30 +194,30 @@ MACRO(NL_SETUP_DEFAULT_OPTIONS)
# Default to static building on Windows.
IF(WIN32)
OPTION(WITH_STATIC "With static libraries." ON )
ELSE()
ELSE(WIN32)
OPTION(WITH_STATIC "With static libraries." OFF)
ENDIF()
ENDIF(WIN32)
IF (WITH_STATIC)
OPTION(WITH_STATIC_LIBXML2 "With static libxml2" ON )
ELSE()
ELSE(WITH_STATIC)
OPTION(WITH_STATIC_LIBXML2 "With static libxml2" OFF)
ENDIF()
ENDIF(WITH_STATIC)
IF (WITH_STATIC)
OPTION(WITH_STATIC_CURL "With static curl" ON )
ELSE()
ELSE(WITH_STATIC)
OPTION(WITH_STATIC_CURL "With static curl" OFF)
ENDIF()
ENDIF(WITH_STATIC)
IF(APPLE)
OPTION(WITH_LIBXML2_ICONV "With libxml2 using iconv" ON )
ELSE()
ELSE(APPLE)
OPTION(WITH_LIBXML2_ICONV "With libxml2 using iconv" OFF)
ENDIF()
ENDIF(APPLE)
OPTION(WITH_STATIC_DRIVERS "With static drivers." OFF)
IF(WIN32)
OPTION(WITH_EXTERNAL "With provided external." ON )
ELSE()
ELSE(WIN32)
OPTION(WITH_EXTERNAL "With provided external." OFF)
ENDIF()
ENDIF(WIN32)
OPTION(WITH_STATIC_EXTERNAL "With static external libraries" OFF)
IF(UNIX AND NOT APPLE)
OPTION(WITH_UNIX_STRUCTURE "Use UNIX structure (bin, include, lib)" ON )
@ -256,21 +237,20 @@ MACRO(NL_SETUP_DEFAULT_OPTIONS)
IF(WIN32 AND MFC_FOUND)
OPTION(WITH_MFC "With MFC Support" ON )
ELSE()
ELSE(WIN32 AND MFC_FOUND)
OPTION(WITH_MFC "With MFC Support" OFF)
ENDIF()
ENDIF(WIN32 AND MFC_FOUND)
###
# Optional support
###
OPTION(WITH_SYMBOLS "Keep debug symbols in binaries" OFF)
# only enable STLport for VC++ 2010 and less
IF(WIN32 AND MSVC_VERSION LESS 1600)
IF(WIN32)
OPTION(WITH_STLPORT "With STLport support." ON )
ELSE()
ELSE(WIN32)
OPTION(WITH_STLPORT "With STLport support." OFF)
ENDIF()
ENDIF(WIN32)
OPTION(BUILD_DASHBOARD "Build to the CDash dashboard" OFF)
@ -323,7 +303,7 @@ MACRO(NL_SETUP_NEL_DEFAULT_OPTIONS)
IF(NOT MSVC)
OPTION(WITH_GCC_FPMATH_BOTH "With GCC -mfpmath=both" OFF)
ENDIF()
ENDIF(NOT MSVC)
ENDMACRO(NL_SETUP_NEL_DEFAULT_OPTIONS)
MACRO(NL_SETUP_NELNS_DEFAULT_OPTIONS)
@ -341,7 +321,7 @@ MACRO(NL_SETUP_RYZOM_DEFAULT_OPTIONS)
OPTION(WITH_RYZOM_CLIENT "Build Ryzom Core Client" ON )
OPTION(WITH_RYZOM_TOOLS "Build Ryzom Core Tools" ON )
OPTION(WITH_RYZOM_SERVER "Build Ryzom Core Services" ON )
OPTION(WITH_RYZOM_INSTALLER "Build Ryzom Installer" OFF)
OPTION(WITH_RYZOM_SOUND "Enable Ryzom Core Sound" ON )
###
# Optional support
@ -353,7 +333,6 @@ MACRO(NL_SETUP_RYZOM_DEFAULT_OPTIONS)
OPTION(WITH_RYZOM_PATCH "Enable Ryzom in-game patch support" OFF)
OPTION(WITH_RYZOM_CUSTOM_PATCH_SERVER "Only use patch server from CFG file" OFF)
OPTION(WITH_RYZOM_STEAM "Enable Steam features" OFF)
OPTION(WITH_RYZOM_SANDBOX "Enable Sandbox under OS X" OFF)
ENDMACRO(NL_SETUP_RYZOM_DEFAULT_OPTIONS)
MACRO(NL_SETUP_SNOWBALLS_DEFAULT_OPTIONS)
@ -380,15 +359,15 @@ MACRO(NL_SETUP_BUILD)
IF(CMAKE_BUILD_TYPE MATCHES "Debug")
SET(NL_BUILD_MODE "NL_DEBUG")
ELSE()
ELSE(CMAKE_BUILD_TYPE MATCHES "Debug")
IF(CMAKE_BUILD_TYPE MATCHES "Release")
SET(NL_BUILD_MODE "NL_RELEASE")
ELSE()
ELSE(CMAKE_BUILD_TYPE MATCHES "Release")
SET(NL_BUILD_MODE "NL_RELEASE")
# enforce release mode if it's neither Debug nor Release
SET(CMAKE_BUILD_TYPE "Release" CACHE STRING "" FORCE)
ENDIF()
ENDIF()
ENDIF(CMAKE_BUILD_TYPE MATCHES "Release")
ENDIF(CMAKE_BUILD_TYPE MATCHES "Debug")
SET(HOST_CPU ${CMAKE_HOST_SYSTEM_PROCESSOR})
@ -396,35 +375,35 @@ MACRO(NL_SETUP_BUILD)
SET(HOST_CPU "x86_64")
ELSEIF(HOST_CPU MATCHES "i.86")
SET(HOST_CPU "x86")
ENDIF()
ENDIF(HOST_CPU MATCHES "(amd|AMD)64")
# Determine target CPU
# If not specified, use the same CPU as host
IF(NOT TARGET_CPU)
SET(TARGET_CPU ${CMAKE_SYSTEM_PROCESSOR})
ENDIF()
ENDIF(NOT TARGET_CPU)
IF(TARGET_CPU MATCHES "(amd|AMD)64")
SET(TARGET_CPU "x86_64")
ELSEIF(TARGET_CPU MATCHES "i.86")
SET(TARGET_CPU "x86")
ENDIF()
ENDIF(TARGET_CPU MATCHES "(amd|AMD)64")
IF(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
SET(CLANG ON)
MESSAGE(STATUS "Using Clang compiler")
ENDIF()
ENDIF(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
IF(CMAKE_GENERATOR MATCHES "Xcode")
SET(XCODE ON)
MESSAGE(STATUS "Generating Xcode project")
ENDIF()
ENDIF(CMAKE_GENERATOR MATCHES "Xcode")
IF(CMAKE_GENERATOR MATCHES "NMake")
SET(NMAKE ON)
MESSAGE(STATUS "Generating NMake project")
ENDIF()
ENDIF(CMAKE_GENERATOR MATCHES "NMake")
# If target and host CPU are the same
IF("${HOST_CPU}" STREQUAL "${TARGET_CPU}" AND NOT CMAKE_CROSSCOMPILING)
@ -433,24 +412,24 @@ MACRO(NL_SETUP_BUILD)
IF(NOT CMAKE_SIZEOF_VOID_P)
INCLUDE (CheckTypeSize)
CHECK_TYPE_SIZE("void*" CMAKE_SIZEOF_VOID_P)
ENDIF()
ENDIF(NOT CMAKE_SIZEOF_VOID_P)
# Using 32 or 64 bits libraries
IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
SET(TARGET_CPU "x86_64")
ELSE()
ELSE(CMAKE_SIZEOF_VOID_P EQUAL 8)
SET(TARGET_CPU "x86")
ENDIF()
ENDIF(CMAKE_SIZEOF_VOID_P EQUAL 8)
ELSEIF(HOST_CPU MATCHES "arm")
SET(TARGET_CPU "arm")
ELSE()
ELSE(HOST_CPU MATCHES "x86")
SET(TARGET_CPU "unknown")
MESSAGE(STATUS "Unknown architecture: ${HOST_CPU}")
ENDIF()
ENDIF(HOST_CPU MATCHES "x86")
# TODO: add checks for PPC
ELSE()
ELSE("${HOST_CPU}" STREQUAL "${TARGET_CPU}" AND NOT CMAKE_CROSSCOMPILING)
MESSAGE(STATUS "Compiling on ${HOST_CPU} for ${TARGET_CPU}")
ENDIF()
ENDIF("${HOST_CPU}" STREQUAL "${TARGET_CPU}" AND NOT CMAKE_CROSSCOMPILING)
# Use values from environment variables
SET(PLATFORM_CFLAGS "$ENV{CFLAGS} $ENV{CPPFLAGS} ${PLATFORM_CFLAGS}")
@ -490,36 +469,36 @@ MACRO(NL_SETUP_BUILD)
SET(TARGET_ARM 1)
ELSEIF(TARGET_CPU STREQUAL "mips")
SET(TARGET_MIPS 1)
ENDIF()
ENDIF(TARGET_CPU STREQUAL "x86_64")
IF(TARGET_ARM)
IF(TARGET_ARMV7S)
ADD_PLATFORM_FLAGS("-DHAVE_ARMV7S")
ENDIF()
ENDIF(TARGET_ARMV7S)
IF(TARGET_ARMV7)
ADD_PLATFORM_FLAGS("-DHAVE_ARMV7")
ENDIF()
ENDIF(TARGET_ARMV7)
IF(TARGET_ARMV6)
ADD_PLATFORM_FLAGS("-HAVE_ARMV6")
ENDIF()
ENDIF(TARGET_ARMV6)
ADD_PLATFORM_FLAGS("-DHAVE_ARM")
ENDIF()
ENDIF(TARGET_ARM)
IF(TARGET_X86)
ADD_PLATFORM_FLAGS("-DHAVE_X86")
ENDIF()
ENDIF(TARGET_X86)
IF(TARGET_X64)
ADD_PLATFORM_FLAGS("-DHAVE_X64 -DHAVE_X86_64")
ENDIF()
ENDIF(TARGET_X64)
IF(TARGET_MIPS)
ADD_PLATFORM_FLAGS("-DHAVE_MIPS")
ENDIF()
ENDIF()
ENDIF(TARGET_MIPS)
ENDIF(NOT CMAKE_OSX_ARCHITECTURES)
# Fix library paths suffixes for Debian MultiArch
IF(LIBRARY_ARCHITECTURE)
@ -528,22 +507,22 @@ MACRO(NL_SETUP_BUILD)
SET(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} /lib64 /usr/lib64)
ELSEIF(TARGET_X86)
SET(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} /lib32 /usr/lib32)
ENDIF()
ENDIF()
ENDIF(TARGET_X64)
ENDIF(LIBRARY_ARCHITECTURE)
IF(APPLE AND NOT IOS)
SET(CMAKE_INCLUDE_PATH /opt/local/include ${CMAKE_INCLUDE_PATH})
SET(CMAKE_LIBRARY_PATH /opt/local/lib ${CMAKE_LIBRARY_PATH})
ENDIF()
ENDIF(APPLE AND NOT IOS)
IF(WITH_LOGGING)
ADD_PLATFORM_FLAGS("-DENABLE_LOGS")
ENDIF()
ENDIF(WITH_LOGGING)
IF(MSVC)
IF(MSVC_VERSION EQUAL "1700" AND NOT MSVC11)
SET(MSVC11 ON)
ENDIF()
ENDIF(MSVC_VERSION EQUAL "1700" AND NOT MSVC11)
# Ignore default include paths
ADD_PLATFORM_FLAGS("/X")
@ -555,50 +534,50 @@ MACRO(NL_SETUP_BUILD)
# without inlining it's unusable, use custom optimizations again
SET(DEBUG_CFLAGS "/Od /Ob1 /GF- ${DEBUG_CFLAGS}")
ELSEIF(MSVC12)
ADD_PLATFORM_FLAGS("/Gy- /MP /Zm1000")
ADD_PLATFORM_FLAGS("/Gy- /MP")
# /Ox is working with VC++ 2013, but custom optimizations don't exist
SET(RELEASE_CFLAGS "/Ox /GF /GS- ${RELEASE_CFLAGS}")
# without inlining it's unusable, use custom optimizations again
SET(DEBUG_CFLAGS "/Od /Ob1 /GF- ${DEBUG_CFLAGS}")
ELSEIF(MSVC11)
ADD_PLATFORM_FLAGS("/Gy- /MP /Zm1000")
ADD_PLATFORM_FLAGS("/Gy- /MP")
# /Ox is working with VC++ 2012, but custom optimizations don't exist
SET(RELEASE_CFLAGS "/Ox /GF /GS- ${RELEASE_CFLAGS}")
# without inlining it's unusable, use custom optimizations again
SET(DEBUG_CFLAGS "/Od /Ob1 /GF- ${DEBUG_CFLAGS}")
ELSEIF(MSVC10)
ADD_PLATFORM_FLAGS("/Gy- /MP /Zm1000")
ADD_PLATFORM_FLAGS("/Gy- /MP")
# /Ox is working with VC++ 2010, but custom optimizations don't exist
SET(RELEASE_CFLAGS "/Ox /GF /GS- ${RELEASE_CFLAGS}")
# without inlining it's unusable, use custom optimizations again
SET(DEBUG_CFLAGS "/Od /Ob1 /GF- ${DEBUG_CFLAGS}")
ELSEIF(MSVC90)
ADD_PLATFORM_FLAGS("/Gy- /MP /Zm1000")
ADD_PLATFORM_FLAGS("/Gy- /MP")
# don't use a /O[012x] flag if you want custom optimizations
SET(RELEASE_CFLAGS "/Ob2 /Oi /Ot /Oy /GT /GF /GS- ${RELEASE_CFLAGS}")
# without inlining it's unusable, use custom optimizations again
SET(DEBUG_CFLAGS "/Ob1 /GF- ${DEBUG_CFLAGS}")
ELSEIF(MSVC80)
ADD_PLATFORM_FLAGS("/Gy- /Wp64 /Zm1000")
ADD_PLATFORM_FLAGS("/Gy- /Wp64")
# don't use a /O[012x] flag if you want custom optimizations
SET(RELEASE_CFLAGS "/Ox /GF /GS- ${RELEASE_CFLAGS}")
# without inlining it's unusable, use custom optimizations again
SET(DEBUG_CFLAGS "/Od /Ob1 ${DEBUG_CFLAGS}")
ELSE()
ELSE(MSVC12)
MESSAGE(FATAL_ERROR "Can't determine compiler version ${MSVC_VERSION}")
ENDIF()
ENDIF(MSVC14)
ADD_PLATFORM_FLAGS("/D_CRT_SECURE_NO_DEPRECATE /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_WARNINGS /DWIN32 /D_WINDOWS /wd4250")
ADD_PLATFORM_FLAGS("/D_CRT_SECURE_NO_DEPRECATE /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_WARNINGS /DWIN32 /D_WINDOWS /Zm1000 /wd4250")
IF(TARGET_X64)
# Fix a bug with Intellisense
ADD_PLATFORM_FLAGS("/D_WIN64")
# Fix a compilation error for some big C++ files
SET(RELEASE_CFLAGS "${RELEASE_CFLAGS} /bigobj")
ELSE()
ELSE(TARGET_X64)
# Allows 32 bits applications to use 3 GB of RAM
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} /LARGEADDRESSAWARE")
ENDIF()
ENDIF(TARGET_X64)
# Exceptions are only set for C++
SET(PLATFORM_CXXFLAGS "${PLATFORM_CXXFLAGS} /EHa")
@ -606,9 +585,9 @@ MACRO(NL_SETUP_BUILD)
IF(WITH_SYMBOLS)
SET(NL_RELEASE_CFLAGS "/Zi ${NL_RELEASE_CFLAGS}")
SET(NL_RELEASE_LINKFLAGS "/DEBUG ${NL_RELEASE_LINKFLAGS}")
ELSE()
ELSE(WITH_SYMBOLS)
SET(NL_RELEASE_LINKFLAGS "/RELEASE ${NL_RELEASE_LINKFLAGS}")
ENDIF()
ENDIF(WITH_SYMBOLS)
SET(NL_DEBUG_CFLAGS "/Zi /MDd /RTC1 /D_DEBUG ${DEBUG_CFLAGS} ${NL_DEBUG_CFLAGS}")
SET(NL_RELEASE_CFLAGS "/MD /DNDEBUG ${RELEASE_CFLAGS} ${NL_RELEASE_CFLAGS}")
@ -617,25 +596,25 @@ MACRO(NL_SETUP_BUILD)
IF(WITH_WARNINGS)
SET(DEBUG_CFLAGS "/W4 ${DEBUG_CFLAGS}")
ELSE()
ELSE(WITH_WARNINGS)
SET(DEBUG_CFLAGS "/W3 ${DEBUG_CFLAGS}")
ENDIF()
ELSE()
ENDIF(WITH_WARNINGS)
ELSE(MSVC)
IF(WIN32)
ADD_PLATFORM_FLAGS("-DWIN32 -D_WIN32")
IF(CLANG)
ADD_PLATFORM_FLAGS("-nobuiltininc")
ENDIF()
ENDIF()
ENDIF(CLANG)
ENDIF(WIN32)
IF(WITH_SSE3)
ADD_PLATFORM_FLAGS("-msse3")
ENDIF()
ENDIF(WITH_SSE3)
IF(WITH_GCC_FPMATH_BOTH)
ADD_PLATFORM_FLAGS("-mfpmath=both")
ENDIF()
ENDIF(WITH_GCC_FPMATH_BOTH)
IF(APPLE)
IF(NOT XCODE)
@ -670,97 +649,97 @@ MACRO(NL_SETUP_BUILD)
SET(_ARCHS "${_ARCHS} mips")
SET(TARGET_MIPS 1)
MATH(EXPR TARGETS_COUNT "${TARGETS_COUNT}+1")
ELSE()
ELSE(_ARCH STREQUAL "i386")
SET(_ARCHS "${_ARCHS} unknwon(${_ARCH})")
ENDIF()
ENDIF(_ARCH STREQUAL "i386")
ENDFOREACH(_ARCH)
MESSAGE(STATUS "Compiling under Mac OS X for ${TARGETS_COUNT} architectures: ${_ARCHS}")
ELSE()
ELSE(CMAKE_OSX_ARCHITECTURES)
SET(TARGETS_COUNT 0)
ENDIF()
ENDIF(CMAKE_OSX_ARCHITECTURES)
IF(TARGETS_COUNT EQUAL 1)
IF(TARGET_ARM)
IF(TARGET_ARMV7S)
ADD_PLATFORM_FLAGS("-arch armv7s -DHAVE_ARMV7S")
ENDIF()
ENDIF(TARGET_ARMV7S)
IF(TARGET_ARMV7)
ADD_PLATFORM_FLAGS("-arch armv7 -DHAVE_ARMV7")
ENDIF()
ENDIF(TARGET_ARMV7)
IF(TARGET_ARMV6)
ADD_PLATFORM_FLAGS("-arch armv6 -DHAVE_ARMV6")
ENDIF()
ENDIF(TARGET_ARMV6)
IF(TARGET_ARMV5)
ADD_PLATFORM_FLAGS("-arch armv5 -DHAVE_ARMV5")
ENDIF()
ENDIF(TARGET_ARMV5)
ADD_PLATFORM_FLAGS("-mthumb -DHAVE_ARM")
ENDIF()
ENDIF(TARGET_ARM)
IF(TARGET_X64)
ADD_PLATFORM_FLAGS("-arch x86_64 -DHAVE_X64 -DHAVE_X86_64 -DHAVE_X86")
ELSEIF(TARGET_X86)
ADD_PLATFORM_FLAGS("-arch i386 -DHAVE_X86")
ENDIF()
ENDIF(TARGET_X64)
IF(TARGET_MIPS)
ADD_PLATFORM_FLAGS("-arch mips -DHAVE_MIPS")
ENDIF()
ENDIF(TARGET_MIPS)
ELSEIF(TARGETS_COUNT EQUAL 0)
# Not using CMAKE_OSX_ARCHITECTURES, HAVE_XXX already defined before
IF(TARGET_ARM)
IF(TARGET_ARMV7S)
ADD_PLATFORM_FLAGS("-arch armv7s")
ENDIF()
ENDIF(TARGET_ARMV7S)
IF(TARGET_ARMV7)
ADD_PLATFORM_FLAGS("-arch armv7")
ENDIF()
ENDIF(TARGET_ARMV7)
IF(TARGET_ARMV6)
ADD_PLATFORM_FLAGS("-arch armv6")
ENDIF()
ENDIF(TARGET_ARMV6)
IF(TARGET_ARMV5)
ADD_PLATFORM_FLAGS("-arch armv5")
ENDIF()
ENDIF(TARGET_ARMV5)
ADD_PLATFORM_FLAGS("-mthumb")
ENDIF()
ENDIF(TARGET_ARM)
IF(TARGET_X64)
ADD_PLATFORM_FLAGS("-arch x86_64")
ELSEIF(TARGET_X86)
ADD_PLATFORM_FLAGS("-arch i386")
ENDIF()
ENDIF(TARGET_X64)
IF(TARGET_MIPS)
ADD_PLATFORM_FLAGS("-arch mips")
ENDIF()
ELSE()
ENDIF(TARGET_MIPS)
ELSE(TARGETS_COUNT EQUAL 1)
IF(TARGET_ARMV6)
ADD_PLATFORM_FLAGS("-Xarch_armv6 -mthumb -Xarch_armv6 -DHAVE_ARM -Xarch_armv6 -DHAVE_ARMV6")
ENDIF()
ENDIF(TARGET_ARMV6)
IF(TARGET_ARMV7)
ADD_PLATFORM_FLAGS("-Xarch_armv7 -mthumb -Xarch_armv7 -DHAVE_ARM -Xarch_armv7 -DHAVE_ARMV7")
ENDIF()
ENDIF(TARGET_ARMV7)
IF(TARGET_X86)
ADD_PLATFORM_FLAGS("-Xarch_i386 -DHAVE_X86")
ENDIF()
ENDIF(TARGET_X86)
IF(TARGET_X64)
ADD_PLATFORM_FLAGS("-Xarch_x86_64 -DHAVE_X64 -Xarch_x86_64 -DHAVE_X86_64")
ENDIF()
ENDIF(TARGET_X64)
IF(TARGET_MIPS)
ADD_PLATFORM_FLAGS("-Xarch_mips -DHAVE_MIPS")
ENDIF()
ENDIF()
ENDIF(TARGET_MIPS)
ENDIF(TARGETS_COUNT EQUAL 1)
IF(IOS)
SET(CMAKE_OSX_SYSROOT "" CACHE PATH "" FORCE)
@ -770,73 +749,73 @@ MACRO(NL_SETUP_BUILD)
CONVERT_VERSION_NUMBER(${IOS_VERSION_MAJOR} ${IOS_VERSION_MINOR} ${IOS_VERSION_PATCH} IOS_VERSION_NUMBER)
ADD_PLATFORM_FLAGS("-D__IPHONE_OS_VERSION_MIN_REQUIRED=${IOS_VERSION_NUMBER}")
ENDIF()
ENDIF(IOS_VERSION)
IF(CMAKE_IOS_SYSROOT)
IF(TARGET_ARMV7S)
IF(TARGETS_COUNT GREATER 1)
SET(XARCH "-Xarch_armv7s ")
ENDIF()
ENDIF(TARGETS_COUNT GREATER 1)
ADD_PLATFORM_FLAGS("${XARCH}-isysroot${CMAKE_IOS_SYSROOT}")
ADD_PLATFORM_FLAGS("${XARCH}-miphoneos-version-min=${IOS_VERSION}")
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} ${XARCH}-Wl,-iphoneos_version_min,${IOS_VERSION}")
ENDIF()
ENDIF(TARGET_ARMV7S)
IF(TARGET_ARMV7)
IF(TARGETS_COUNT GREATER 1)
SET(XARCH "-Xarch_armv7 ")
ENDIF()
ENDIF(TARGETS_COUNT GREATER 1)
ADD_PLATFORM_FLAGS("${XARCH}-isysroot${CMAKE_IOS_SYSROOT}")
ADD_PLATFORM_FLAGS("${XARCH}-miphoneos-version-min=${IOS_VERSION}")
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} ${XARCH}-Wl,-iphoneos_version_min,${IOS_VERSION}")
ENDIF()
ENDIF(TARGET_ARMV7)
IF(TARGET_ARMV6)
IF(TARGETS_COUNT GREATER 1)
SET(XARCH "-Xarch_armv6 ")
ENDIF()
ENDIF(TARGETS_COUNT GREATER 1)
ADD_PLATFORM_FLAGS("${XARCH}-isysroot${CMAKE_IOS_SYSROOT}")
ADD_PLATFORM_FLAGS("${XARCH}-miphoneos-version-min=${IOS_VERSION}")
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} ${XARCH}-Wl,-iphoneos_version_min,${IOS_VERSION}")
ENDIF()
ENDIF()
ENDIF(TARGET_ARMV6)
ENDIF(CMAKE_IOS_SYSROOT)
IF(CMAKE_IOS_SIMULATOR_SYSROOT AND TARGET_X86)
IF(TARGETS_COUNT GREATER 1)
SET(XARCH "-Xarch_i386 ")
ENDIF()
ENDIF(TARGETS_COUNT GREATER 1)
ADD_PLATFORM_FLAGS("${XARCH}-isysroot${CMAKE_IOS_SIMULATOR_SYSROOT}")
ADD_PLATFORM_FLAGS("${XARCH}-mios-simulator-version-min=${IOS_VERSION}")
IF(CMAKE_OSX_DEPLOYMENT_TARGET)
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} ${XARCH}-Wl,-macosx_version_min,${CMAKE_OSX_DEPLOYMENT_TARGET}")
ENDIF()
ENDIF()
ELSE()
ENDIF(CMAKE_OSX_DEPLOYMENT_TARGET)
ENDIF(CMAKE_IOS_SIMULATOR_SYSROOT AND TARGET_X86)
ELSE(IOS)
# Always force -mmacosx-version-min to override environement variable
IF(CMAKE_OSX_DEPLOYMENT_TARGET)
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Wl,-macosx_version_min,${CMAKE_OSX_DEPLOYMENT_TARGET}")
ENDIF()
ENDIF()
ENDIF(CMAKE_OSX_DEPLOYMENT_TARGET)
ENDIF(IOS)
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Wl,-headerpad_max_install_names")
IF(HAVE_FLAG_SEARCH_PATHS_FIRST)
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Wl,-search_paths_first")
ENDIF()
ENDIF()
ELSE()
ENDIF(HAVE_FLAG_SEARCH_PATHS_FIRST)
ENDIF(NOT XCODE)
ELSE(APPLE)
IF(HOST_CPU STREQUAL "x86_64" AND TARGET_CPU STREQUAL "x86")
ADD_PLATFORM_FLAGS("-m32 -march=i686")
ENDIF()
ENDIF(HOST_CPU STREQUAL "x86_64" AND TARGET_CPU STREQUAL "x86")
IF(HOST_CPU STREQUAL "x86" AND TARGET_CPU STREQUAL "x86_64")
ADD_PLATFORM_FLAGS("-m64")
ENDIF()
ENDIF()
ENDIF(HOST_CPU STREQUAL "x86" AND TARGET_CPU STREQUAL "x86_64")
ENDIF(APPLE)
ADD_PLATFORM_FLAGS("-D_REENTRANT -fno-strict-aliasing")
@ -846,11 +825,11 @@ MACRO(NL_SETUP_BUILD)
IF(WITH_COVERAGE)
ADD_PLATFORM_FLAGS("-fprofile-arcs -ftest-coverage")
ENDIF()
ENDIF(WITH_COVERAGE)
IF(WITH_WARNINGS)
ADD_PLATFORM_FLAGS("-Wall -W -Wpointer-arith -Wsign-compare -Wno-deprecated-declarations -Wno-multichar -Wno-unused")
ENDIF()
ENDIF(WITH_WARNINGS)
IF(ANDROID)
ADD_PLATFORM_FLAGS("--sysroot=${PLATFORM_ROOT}")
@ -867,17 +846,17 @@ MACRO(NL_SETUP_BUILD)
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -march=armv7-a -Wl,--fix-cortex-a8")
ELSEIF(TARGET_ARMV5)
ADD_PLATFORM_FLAGS("-march=armv5te -mtune=xscale -msoft-float")
ENDIF()
ENDIF(TARGET_ARMV7)
SET(TARGET_THUMB ON)
IF(TARGET_THUMB)
ADD_PLATFORM_FLAGS("-mthumb -fno-strict-aliasing -finline-limit=64")
SET(DEBUG_CFLAGS "${DEBUG_CFLAGS} -marm")
ELSE()
ELSE(TARGET_THUMB)
ADD_PLATFORM_FLAGS("-funswitch-loops -finline-limit=300")
SET(DEBUG_CFLAGS "${DEBUG_CFLAGS} -fno-strict-aliasing")
SET(RELEASE_CFLAGS "${RELEASE_CFLAGS} -fstrict-aliasing")
ENDIF()
ENDIF(TARGET_THUMB)
ELSEIF(TARGET_X86)
# Optimizations for Intel Atom
ADD_PLATFORM_FLAGS("-march=i686 -mtune=atom -mstackrealign -msse3 -mfpmath=sse -m32 -flto -ffast-math -funroll-loops")
@ -887,39 +866,39 @@ MACRO(NL_SETUP_BUILD)
ELSEIF(TARGET_MIPS)
ADD_PLATFORM_FLAGS("-fpic -finline-functions -fmessage-length=0 -fno-inline-functions-called-once -fgcse-after-reload -frerun-cse-after-loop -frename-registers -fno-strict-aliasing")
SET(RELEASE_CFLAGS "${RELEASE_CFLAGS} -funswitch-loops -finline-limit=300")
ENDIF()
ENDIF(TARGET_ARM)
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now")
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -L${PLATFORM_ROOT}/usr/lib")
ENDIF()
ENDIF(ANDROID)
IF(APPLE)
ADD_PLATFORM_FLAGS("-gdwarf-2 -D_DARWIN_UNLIMITED_STREAMS")
ENDIF()
ENDIF(APPLE)
# Fix "relocation R_X86_64_32 against.." error on x64 platforms
IF(TARGET_X64 AND WITH_STATIC AND NOT WITH_STATIC_DRIVERS AND NOT MINGW)
ADD_PLATFORM_FLAGS("-fPIC")
ENDIF()
ENDIF(TARGET_X64 AND WITH_STATIC AND NOT WITH_STATIC_DRIVERS AND NOT MINGW)
SET(PLATFORM_CXXFLAGS "${PLATFORM_CXXFLAGS} -ftemplate-depth-48")
IF(NOT APPLE)
SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Wl,--no-undefined -Wl,--as-needed")
ENDIF()
ENDIF(NOT APPLE)
IF(WITH_SYMBOLS)
SET(NL_RELEASE_CFLAGS "${NL_RELEASE_CFLAGS} -g")
ELSE()
ELSE(WITH_SYMBOLS)
IF(APPLE)
SET(NL_RELEASE_LINKFLAGS "-Wl,-dead_strip ${NL_RELEASE_LINKFLAGS}")
ELSE()
ELSE(APPLE)
SET(NL_RELEASE_LINKFLAGS "-Wl,-s ${NL_RELEASE_LINKFLAGS}")
ENDIF()
ENDIF()
ENDIF(APPLE)
ENDIF(WITH_SYMBOLS)
SET(NL_DEBUG_CFLAGS "-g -DNL_DEBUG -D_DEBUG ${NL_DEBUG_CFLAGS}")
SET(NL_RELEASE_CFLAGS "-DNL_RELEASE -DNDEBUG -O3 ${NL_RELEASE_CFLAGS}")
ENDIF()
ENDIF(MSVC)
ENDMACRO(NL_SETUP_BUILD)
MACRO(NL_SETUP_BUILD_FLAGS)
@ -954,7 +933,7 @@ MACRO(NL_MAKE_ABSOLUTE_PREFIX NAME_RELATIVE NAME_ABSOLUTE)
ELSE()
SET(${NAME_ABSOLUTE} ${${NAME_RELATIVE}})
ENDIF()
ENDIF()
ENDIF(IS_ABSOLUTE "${${NAME_RELATIVE}}")
ENDMACRO(NL_MAKE_ABSOLUTE_PREFIX)
MACRO(NL_SETUP_PREFIX_PATHS)
@ -1031,7 +1010,7 @@ MACRO(RYZOM_SETUP_PREFIX_PATHS)
ELSE()
SET(RYZOM_ETC_PREFIX "." CACHE PATH "Installation path for configurations")
ENDIF()
ENDIF()
ENDIF(NOT RYZOM_ETC_PREFIX)
NL_MAKE_ABSOLUTE_PREFIX(RYZOM_ETC_PREFIX RYZOM_ETC_ABSOLUTE_PREFIX)
## Allow override of install_prefix/share path.
@ -1071,7 +1050,7 @@ MACRO(RYZOM_SETUP_PREFIX_PATHS)
ELSE()
SET(RYZOM_LIB_PREFIX "lib" CACHE PATH "Installation path for libraries.")
ENDIF()
ENDIF()
ENDIF(NOT RYZOM_LIB_PREFIX)
NL_MAKE_ABSOLUTE_PREFIX(RYZOM_LIB_PREFIX RYZOM_LIB_ABSOLUTE_PREFIX)
## Allow override of install_prefix/games path.
@ -1089,7 +1068,7 @@ ENDMACRO(RYZOM_SETUP_PREFIX_PATHS)
MACRO(SETUP_EXTERNAL)
IF(WITH_EXTERNAL)
FIND_PACKAGE(External REQUIRED)
ENDIF()
ENDIF(WITH_EXTERNAL)
IF(WIN32)
FIND_PACKAGE(External REQUIRED)
@ -1098,8 +1077,8 @@ MACRO(SETUP_EXTERNAL)
IF(DEFINED BOOST_DIR)
SET(BOOST_INCLUDEDIR ${BOOST_DIR}/include)
SET(BOOST_LIBRARYDIR ${BOOST_DIR}/lib)
ENDIF()
ELSE()
ENDIF(DEFINED BOOST_DIR)
ELSE(WIN32)
FIND_PACKAGE(External QUIET)
IF(APPLE)
@ -1108,28 +1087,28 @@ MACRO(SETUP_EXTERNAL)
ELSE()
SET(CMAKE_FIND_LIBRARY_SUFFIXES .dylib .so .a)
ENDIF()
ELSE()
ELSE(APPLE)
IF(WITH_STATIC_EXTERNAL)
SET(CMAKE_FIND_LIBRARY_SUFFIXES .a .so)
ELSE()
SET(CMAKE_FIND_LIBRARY_SUFFIXES .so .a)
ENDIF()
ENDIF()
ENDIF()
ENDIF(APPLE)
ENDIF(WIN32)
# Android and iOS have pthread
IF(ANDROID OR IOS)
SET(CMAKE_USE_PTHREADS_INIT 1)
SET(Threads_FOUND TRUE)
ELSE()
ELSE(ANDROID OR IOS)
FIND_PACKAGE(Threads REQUIRED)
# TODO: replace all -l<lib> by absolute path to <lib> in CMAKE_THREAD_LIBS_INIT
ENDIF()
ENDIF(ANDROID OR IOS)
IF(WITH_STLPORT)
FIND_PACKAGE(STLport REQUIRED)
INCLUDE_DIRECTORIES(${STLPORT_INCLUDE_DIR})
ENDIF()
ENDIF(WITH_STLPORT)
IF(WIN32)
# Must include DXSDK before WINSDK
@ -1137,10 +1116,10 @@ MACRO(SETUP_EXTERNAL)
# IF(DXSDK_INCLUDE_DIR)
# INCLUDE_DIRECTORIES(${DXSDK_INCLUDE_DIR})
# ENDIF()
ENDIF()
ENDIF(WIN32)
IF(MSVC)
FIND_PACKAGE(MSVC REQUIRED)
FIND_PACKAGE(WindowsSDK REQUIRED)
ENDIF()
ENDIF(MSVC)
ENDMACRO(SETUP_EXTERNAL)

View file

@ -2,23 +2,23 @@ PROJECT(NeL CXX C)
IF(WITH_STATIC_DRIVERS)
ADD_DEFINITIONS(-DNL_STATIC)
ENDIF()
ENDIF(WITH_STATIC_DRIVERS)
IF(WIN32)
# On Win32 we can also build the MAX plugins.
IF(WITH_NEL_MAXPLUGIN)
FIND_PACKAGE(3dsMaxSDK)
ENDIF()
ENDIF()
ENDIF(WITH_NEL_MAXPLUGIN)
ENDIF(WIN32)
IF(WITH_3D)
FIND_PACKAGE(FreeType)
IF(WITH_NEL_CEGUI)
FIND_PACKAGE(CEGUI)
ENDIF()
ENDIF(WITH_NEL_CEGUI)
ENDIF()
ENDIF(WITH_3D)
IF(WITH_SOUND)
FIND_PACKAGE(Ogg)
@ -26,16 +26,24 @@ IF(WITH_SOUND)
IF(WITH_DRIVER_OPENAL)
FIND_PACKAGE(OpenAL)
ENDIF()
ENDIF(WITH_DRIVER_OPENAL)
IF(WITH_DRIVER_FMOD)
FIND_PACKAGE(FMOD)
ENDIF()
ENDIF()
ENDIF(WITH_DRIVER_FMOD)
ENDIF(WITH_SOUND)
IF(WITH_GTK)
FIND_PACKAGE(GTK2)
ENDIF()
ENDIF(WITH_GTK)
IF(WITH_LIBOVR)
FIND_PACKAGE(LibOVR)
ENDIF(WITH_LIBOVR)
IF(WITH_LIBVR)
FIND_PACKAGE(LibVR)
ENDIF(WITH_LIBVR)
IF(WITH_INSTALL_LIBRARIES)
IF(UNIX)
@ -53,7 +61,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()
ENDIF(UNIX)
ADD_SUBDIRECTORY(include)
ENDIF()

View file

@ -61,10 +61,6 @@ public:
sint32 Top; // Distance between origin and top of the texture
sint32 Left; // Distance between origin and left of the texture
sint32 AdvX; // Advance to the next caracter
SLetterInfo():Char(0), FontGenerator(NULL), Size(0), Embolden(false), Oblique(false), Next(NULL), Prev(NULL), Cat(0), CharWidth(0), CharHeight(0), GlyphIndex(0), Top(0), Left(0), AdvX(0)
{
}
};
struct SLetterKey
@ -78,10 +74,6 @@ public:
uint32 getVal();
//bool operator < (const SLetterKey&k) const;
//bool operator == (const SLetterKey&k) const;
SLetterKey():Char(0), FontGenerator(NULL), Size(0), Embolden(false), Oblique(false)
{
}
};
public:

View file

@ -320,7 +320,7 @@ public:
// For edition: change the tileVegetableDesc. NB: only the TileVegetableDescFileName is serialised.
void setTileVegetableDesc (const CTileVegetableDesc &tvd);
/** try to load the vegetable tile desc associated with the fileName (nlinfo() if can't)
* lookup into CPath. no-op if string empty
* lookup into CPath. no-op if string=="".
*/
void loadTileVegetableDesc();

View file

@ -163,7 +163,7 @@ public:
/** There is (OrderS/2+1) * (OrderT/2+1) tiles light influence.
* It indicates which static pointLight influence each corner of a TessBlock (block of 2*2 tiles).
*
* If empty(), suppose no light influence. but CZone::retrieve() always return a
* If size()==0, suppose no light influence. but CZone::retrieve() always return a
* size() == (OrderS/2+1) * (OrderT/2+1).
*
* They are stored in line first order, from S=0 to 1, and T=0 to 1.

View file

@ -2,36 +2,36 @@ SUBDIRS(misc)
IF(WITH_3D)
SUBDIRS(3d)
ENDIF()
ENDIF(WITH_3D)
IF(WITH_GUI)
ADD_SUBDIRECTORY(gui)
ENDIF()
ENDIF(WITH_GUI)
IF(WITH_GEORGES)
SUBDIRS(georges)
ENDIF()
ENDIF(WITH_GEORGES)
IF(WITH_LIGO)
SUBDIRS(ligo)
ENDIF()
ENDIF(WITH_LIGO)
IF(WITH_LOGIC)
SUBDIRS(logic)
ENDIF()
ENDIF(WITH_LOGIC)
IF(WITH_NET)
SUBDIRS(net)
ENDIF()
ENDIF(WITH_NET)
IF(WITH_SOUND)
SUBDIRS(sound)
ENDIF()
ENDIF(WITH_SOUND)
IF(WITH_PACS)
SUBDIRS(pacs)
ENDIF()
ENDIF(WITH_PACS)
IF(WITH_NEL_CEGUI)
SUBDIRS(cegui)
ENDIF()
ENDIF(WITH_NEL_CEGUI)

View file

@ -865,7 +865,7 @@ void loadForm (const std::vector<std::string> &sheetFilters, const std::string &
}
// make sure the CSheetId singleton has been properly initialised
NLMISC::CSheetId::init(updatePackedSheet);
// NLMISC::CSheetId::init(updatePackedSheet);
// load the packed sheet if exists
try

View file

@ -39,6 +39,7 @@ namespace NLGUI
class CGroupParagraph;
extern std::string CurrentCookie;
extern std::string HTTPCurrentDomain;
// HTML group
/**
@ -77,7 +78,7 @@ namespace NLGUI
class CStyleParams
{
public:
CStyleParams () : FontFamily(""), TextColor(255,255,255,255)
CStyleParams () : TextColor(255,255,255,255)
{
FontSize=10;
FontWeight=400;
@ -92,7 +93,6 @@ namespace NLGUI
uint FontSize;
uint FontWeight;
bool FontOblique;
std::string FontFamily;
NLMISC::CRGBA TextColor;
bool Underlined;
bool StrikeThrough;
@ -253,7 +253,6 @@ namespace NLGUI
int luaEndElement(CLuaState &ls);
int luaShowDiv(CLuaState &ls);
int luaParseHtml(CLuaState &ls);
int luaRenderHtml(CLuaState &ls);
REFLECT_EXPORT_START(CGroupHTML, CGroupScrollText)
REFLECT_LUA_METHOD("browse", luaBrowse)
@ -266,7 +265,6 @@ namespace NLGUI
REFLECT_LUA_METHOD("endElement", luaEndElement)
REFLECT_LUA_METHOD("showDiv", luaShowDiv)
REFLECT_LUA_METHOD("parseHtml", luaParseHtml)
REFLECT_LUA_METHOD("renderHtml", luaRenderHtml)
REFLECT_STRING("url", getURL, setURL)
REFLECT_FLOAT("timeout", getTimeout, setTimeout)
REFLECT_EXPORT_END
@ -284,6 +282,9 @@ namespace NLGUI
// A new text block has been parsed
virtual void addText (const char * buf, int len);
// A link has been parsed
virtual void addLink (uint element_number, const std::vector<bool> &present, const std::vector<const char *> &value);
// A new begin HTML element has been parsed (<IMG> for exemple)
virtual void beginElement (uint element_number, const std::vector<bool> &present, const std::vector<const char *> &value);
@ -375,7 +376,6 @@ namespace NLGUI
std::string _URL;
// Current URL
std::string _DocumentUrl;
std::string _DocumentDomain;
// Valid base href was found
bool _IgnoreBaseUrlTag;
// Fragment from loading url
@ -511,15 +511,6 @@ namespace NLGUI
return _GlobalColor.back();
}
// Current font name
std::vector<std::string> _FontFamily;
inline const char* getFontFamily() const
{
if (_FontFamily.empty())
return "";
return _FontFamily.back().c_str();
}
// Current font size
std::vector<uint> _FontSize;
inline uint getFontSize() const

View file

@ -51,8 +51,7 @@ namespace NLGUI
public:
std::string scheme;
std::string authority;
std::string host;
std::string domain;
std::string path;
std::string query;
std::string hash;

View file

@ -586,12 +586,8 @@ namespace NLGUI
static NL3D::UDriver *driver;
static NL3D::UTextContext *textcontext;
typedef CHashMap< std::string, NL3D::UTextContext* > TFontsList;
static TFontsList fonts;
public:
static NL3D::UTextContext* getTextContext(const std::string &name="");
static bool registerFont(const std::string &name, const std::string &font);
static NL3D::UTextContext* getTextContext(){ return textcontext; }
/// Set of hw cursor images
static std::set< std::string > *hwCursors;

View file

@ -80,7 +80,6 @@ namespace NLGUI
/// Set
void setText (const ucstring &text);
void setFontName (const std::string &name);
void setFontSize (sint nFontSize);
void setEmbolden (bool nEmbolden);
void setOblique (bool nOblique);
@ -95,7 +94,6 @@ namespace NLGUI
void setMultiLineClipEndSpace (bool state); // use it for multiline edit box for instance
void setFirstLineX (uint firstLineX);
void setMultiMaxLine(uint l) { _MultiMaxLine = l; }
void setMultiMinLine(uint l) { _MultiMinLine = l; }
// Force only a subset of letter to be displayed. Default is 0/0xFFFFFFFF
void enableStringSelection(uint start, uint end);
@ -105,7 +103,6 @@ namespace NLGUI
ucstring getText() const { return _Text; }
sint getFontSize() const;
std::string getFontName() const { return _FontName; }
bool getEmbolden() { return _Embolden; }
bool getOblique() { return _Oblique; }
NLMISC::CRGBA getColor() { return _Color; }
@ -117,8 +114,6 @@ namespace NLGUI
sint getMultiLineSpace() const { return _MultiLineSpace; }
bool getMultiLineMaxWOnly() const { return _MultiLineMaxWOnly; }
uint32 getMultiMaxLine() const { return _MultiMaxLine; }
uint32 getMultiMinLine() const { return _MultiMinLine; }
uint32 getMultiMinOffsetY() const;
// get current Hint font width, in pixels
uint getFontWidth() const;
@ -229,8 +224,6 @@ namespace NLGUI
uint _Index;
/// info on the computed String associated to this text control
NL3D::UTextContext::CStringInfo _Info;
/// Font name to get TextContext
std::string _FontName;
/// the font size
sint _FontSize;
bool _Embolden;
@ -266,7 +259,6 @@ namespace NLGUI
sint _MultiLineSpace;
sint _LastMultiLineMaxW;
uint32 _MultiMaxLine;
uint32 _MultiMinLine;
/// FormatTag handling
@ -324,7 +316,7 @@ namespace NLGUI
CFormatInfo Format;
public:
// build from a string, using the current text context
void build(const ucstring &text, NL3D::UTextContext &textContext, uint numSpaces= 0);
void build(const ucstring &text, uint numSpaces= 0);
};
typedef std::vector<CWord> TWordVect;
@ -335,9 +327,9 @@ namespace NLGUI
// ctor
CLine();
// Clear the line & remove text contexts
void clear(NL3D::UTextContext &textContext);
void clear();
// Add a new word (and its context) in the line + a number of spaces to append at the end of the line
void addWord(const ucstring &word, uint numSpaces, const CFormatInfo &wordFormat, uint fontWidth, NL3D::UTextContext &textContext);
void addWord(const ucstring &word, uint numSpaces, const CFormatInfo &wordFormat, uint fontWidth);
void addWord(const CWord &word, uint fontWidth);
uint getNumWords() const { return (uint)_Words.size(); }
CWord &getWord(uint index) { return _Words[index]; }

View file

@ -442,7 +442,6 @@ namespace NLGUI
OptionTimeoutMessages,
OptionTimeoutContext,
OptionTimeoutContextHtml,
OptionMonospaceFont,
NumSystemOptions
};

View file

@ -375,12 +375,6 @@ public:
void makeOpaque();
/**
* Make fully transparent pixels (alpha 0) black.
*/
void makeTransparentPixelsBlack();
/**
* Return if the bitmap has uniform alpha values for all pixels.
* \param alpha return the uniform value if return is true
@ -615,7 +609,7 @@ public:
/**
* Extended version of blit. The destinaion of the blit is 'this' bitmap
* Source and dest rect are clamped as necessary.
* For now, only RGBA is supported (an asertion occurs otherwise)
* For now, only RGBA is uspported (an asertion occurs otherwise)
* mipmap are not updated.
* IMPORTANT : copy to self is not handled correctly
*/

View file

@ -120,9 +120,9 @@ public:
*/
std::string toString() const
{
if (_Ids.empty()) return std::string("");
if (_Ids.size()==0) return std::string("");
std::string str=_Ids[0];
for (uint i=1; i<_Ids.size(); i++)
for (unsigned i=1; i<_Ids.size(); i++)
str +=std::string(":")+ _Ids[i];
return str;
}

View file

@ -21,7 +21,7 @@
namespace STRING_MANAGER
{
const ucstring nl("\n");
const ucstring nl("\r\n");
struct TStringInfo

View file

@ -144,10 +144,12 @@ public:
* 16 bits encoding can be recognized by the official header :
* FF, FE, witch can be reversed if the data are MSB first.
*
* Optionally, you can force the reader to consider the file as
* UTF-8 encoded.
* Optionally, you can ask the reader to interpret #include commands.
*/
static void readTextFile(const std::string &filename,
ucstring &result,
ucstring &result, bool forceUtf8 = false,
bool fileLookup = true,
bool preprocess = false,
TLineFormat lineFmt = LINE_FMT_NO_CARE,
@ -160,8 +162,11 @@ public:
* EF,BB, BF.
* 16 bits encoding can be recognized by the official header :
* FF, FE, witch can be reversed if the data are MSB first.
*
* Optionally, you can force the reader to consider the file as
* UTF-8 encoded.
*/
static void readTextBuffer(uint8 *buffer, uint size, ucstring &result);
static void readTextBuffer(uint8 *buffer, uint size, ucstring &result, bool forceUtf8 = false);
/** Remove any C style comment from the passed string.
*/
@ -257,7 +262,7 @@ private:
/// The internal read function, it does the real job of readTextFile
static void _readTextFile(const std::string &filename,
ucstring &result,
ucstring &result, bool forceUtf8,
bool fileLookup,
bool preprocess,
TLineFormat lineFmt,

View file

@ -48,7 +48,7 @@ public:
/// Constructor
CPacsClient()
{
// No connection
// No connexion
_Server=NULL;
}
@ -567,7 +567,7 @@ static TCallbackItem PacsCallbackArray[] =
inline bool CPacsClient::connect ()
{
// Create a connection
// Create a connexion
_Server = new CCallbackClient;
// Look up for PACS service

View file

@ -67,7 +67,7 @@ public:
static IAudioDecoder *createAudioDecoder(const std::string &type, NLMISC::IStream *stream, bool loop);
/// Get information on a music file (only artist and title at the moment).
static bool getInfo(const std::string &filepath, std::string &artist, std::string &title, float &length);
static bool getInfo(const std::string &filepath, std::string &artist, std::string &title);
/// Get audio/container extensions that are currently supported by the nel sound library.
static void getMusicExtensions(std::vector<std::string> &extensions);

View file

@ -77,7 +77,7 @@ public:
inline sint32 getStreamOffset() { return _StreamOffset; }
/// Get information on a music file (only artist and title at the moment).
static bool getInfo(NLMISC::IStream *stream, std::string &artist, std::string &title, float &length);
static bool getInfo(NLMISC::IStream *stream, std::string &artist, std::string &title);
/// Get how many bytes the music buffer requires for output minimum.
virtual uint32 getRequiredBytes();

View file

@ -332,7 +332,7 @@ public:
virtual bool isMusicEnded();
virtual void setMusicVolume(float gain);
virtual float getMusicLength();
virtual bool getSongTitle(const std::string &filename, std::string &result, float &length);
virtual bool getSongTitle(const std::string &filename, std::string &result);
virtual void enableBackgroundMusic(bool enable);
virtual void enableBackgroundMusicTimeConstraint(bool enable);
CMusicSoundManager *getBackgroundMusicManager() const {return _BackgroundMusicManager;}

View file

@ -192,7 +192,7 @@ public:
* \param artist returns the song artist (empty if not available)
* \param title returns the title (empty if not available)
*/
virtual bool getMusicInfo(const std::string &/* filepath */, std::string &artist, std::string &title, float &length) { artist.clear(); title.clear(); length = 0.f; return false; }
virtual bool getMusicInfo(const std::string &/* filepath */, std::string &artist, std::string &title) { artist.clear(); title.clear(); return false; }
/// Get audio/container extensions that are supported natively by the driver implementation.
virtual void getMusicExtensions(std::vector<std::string> &extensions) const = 0;
/// Return if a music extension is supported by the driver's music channel.

View file

@ -432,7 +432,7 @@ public:
/** Get the song title. Returns false if the song is not found or the function is not implemented.
* If the song as no name, result is filled with the filename.
*/
virtual bool getSongTitle(const std::string &filename, std::string &result, float &length) =0;
virtual bool getSongTitle(const std::string &filename, std::string &result) =0;
/** enable or disable the background music system. disable it when you want to play your own mp3 for instance
*/
virtual void enableBackgroundMusic(bool enable) =0;

View file

@ -4,8 +4,8 @@ ADD_SUBDIRECTORY(shape_viewer)
IF(WITH_NEL_CEGUI)
ADD_SUBDIRECTORY(cegui)
ENDIF()
ENDIF(WITH_NEL_CEGUI)
#IF(WITH_QT)
# ADD_SUBDIRECTORY(qtnel)
#ENDIF()
#ENDIF(WITH_QT)

View file

@ -2,20 +2,20 @@ ADD_SUBDIRECTORY(misc)
IF(WITH_3D)
ADD_SUBDIRECTORY(3d)
ENDIF()
ENDIF(WITH_3D)
IF(WITH_GEORGES)
ADD_SUBDIRECTORY(georges)
ENDIF()
ENDIF(WITH_GEORGES)
IF(WITH_NET)
ADD_SUBDIRECTORY(net)
ENDIF()
ENDIF(WITH_NET)
IF(WITH_PACS)
ADD_SUBDIRECTORY(pacs)
ENDIF()
ENDIF(WITH_PACS)
IF(WITH_SOUND)
ADD_SUBDIRECTORY(sound)
ENDIF()
ENDIF(WITH_SOUND)

View file

@ -8,7 +8,7 @@ ADD_DEFINITIONS(-DUDP_DIR="\\"${NL_SHARE_ABSOLUTE_PREFIX}/nl_sample_udp/\\"")
IF(WITH_3D)
ADD_DEFINITIONS(-DUSE_3D)
ENDIF()
ENDIF(WITH_3D)
TARGET_LINK_LIBRARIES(nl_sample_udpclient nelmisc nelnet nel3d)
TARGET_LINK_LIBRARIES(nl_sample_udpserver nelmisc nelnet)
@ -22,4 +22,4 @@ INSTALL(FILES bench_service.cfg client.cfg readme.txt DESTINATION ${NL_SHARE_PRE
IF(WITH_3D)
INSTALL(FILES n019003l.pfb DESTINATION ${NL_SHARE_PREFIX}/nl_sample_udp COMPONENT samplesnet)
ENDIF()
ENDIF(WITH_3D)

View file

@ -730,12 +730,12 @@ ADD_DEFINITIONS(${LIBVR_DEFINITIONS})
IF(WITH_PCH)
ADD_NATIVE_PRECOMPILED_HEADER(nel3d ${CMAKE_CURRENT_SOURCE_DIR}/std3d.h ${CMAKE_CURRENT_SOURCE_DIR}/std3d.cpp)
ENDIF()
ENDIF(WITH_PCH)
NL_GEN_PC(nel-3d.pc)
IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC)
INSTALL(TARGETS nel3d LIBRARY DESTINATION ${NL_LIB_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} COMPONENT libraries)
ENDIF()
ENDIF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC)
ADD_SUBDIRECTORY(driver)

View file

@ -50,14 +50,14 @@ IDriver::~IDriver()
{
CSynchronized<TTexDrvInfoPtrMap>::CAccessor access(&_SyncTexDrvInfos);
TTexDrvInfoPtrMap &rTexDrvInfos = access.value();
nlassert(rTexDrvInfos.empty());
nlassert( rTexDrvInfos.size() == 0 );
}
nlassert(_TexDrvShares.empty());
nlassert(_MatDrvInfos.empty());
nlassert(_VBDrvInfos.empty());
nlassert(_IBDrvInfos.empty());
nlassert(_GPUPrgDrvInfos.empty());
nlassert(_TexDrvShares.size()==0);
nlassert(_MatDrvInfos.size()==0);
nlassert(_VBDrvInfos.size()==0);
nlassert(_IBDrvInfos.size()==0);
nlassert(_GPUPrgDrvInfos.size()==0);
}

View file

@ -1,13 +1,13 @@
IF(WITH_DRIVER_OPENGL)
ADD_SUBDIRECTORY(opengl)
ENDIF()
ENDIF(WITH_DRIVER_OPENGL)
IF(WITH_DRIVER_OPENGLES)
ADD_SUBDIRECTORY(opengles)
ENDIF()
ENDIF(WITH_DRIVER_OPENGLES)
IF(WIN32)
IF(WITH_DRIVER_DIRECT3D)
ADD_SUBDIRECTORY(direct3d)
ENDIF()
ENDIF()
ENDIF(WITH_DRIVER_DIRECT3D)
ENDIF(WIN32)

View file

@ -4,7 +4,7 @@ NL_TARGET_DRIVER(nel_drv_direct3d_win ${SRC})
INCLUDE_DIRECTORIES(BEFORE ${DXSDK_INCLUDE_DIR})
TARGET_LINK_LIBRARIES(nel_drv_direct3d_win nel3d nelmisc ${DXSDK_D3DX9_LIBRARY} ${DXSDK_D3D9_LIBRARY})
TARGET_LINK_LIBRARIES(nel_drv_direct3d_win nel3d nelmisc ${DXSDK_D3DX9_LIBRARY} ${DXSDK_D3D9_LIBRARY} ${DXSDK_DINPUT_LIBRARY} ${DXSDK_GUID_LIBRARY})
NL_DEFAULT_PROPS(nel_drv_direct3d_win "NeL, Driver, Video: Direct3D")
NL_ADD_RUNTIME_FLAGS(nel_drv_direct3d_win)

View file

@ -2267,10 +2267,7 @@ bool CDriverD3D::getCurrentScreenMode(GfxMode &gfxMode)
// ***************************************************************************
void CDriverD3D::setWindowTitle(const ucstring &title)
{
if (!SetWindowTextW(_HWnd, (WCHAR*)title.c_str()))
{
nlwarning("SetWindowText failed: %s", formatErrorMessage(getLastError()).c_str());
}
SetWindowTextW(_HWnd,(WCHAR*)title.c_str());
}
// ***************************************************************************

View file

@ -125,7 +125,7 @@ uint8 *CVBDrvInfosD3D::lock (uint begin, uint end, bool readOnly)
}
else
{
nlinfo("Buffer %s at %p is Locked", (*it)->VertexBufferPtr->getName().c_str(), *it);
nlinfo("Buffer %s at %x is Locked", (*it)->VertexBufferPtr->getName().c_str(), (int) *it);
}
}
}

View file

@ -6,7 +6,7 @@ extern "C" {
#endif
/*
** Copyright (c) 2013-2016 The Khronos Group Inc.
** Copyright (c) 2013-2015 The Khronos Group Inc.
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the
@ -33,7 +33,7 @@ extern "C" {
** used to make the header, and the header can be found at
** http://www.opengl.org/registry/
**
** Khronos $Revision: 33061 $ on $Date: 2016-07-14 20:14:13 -0400 (Thu, 14 Jul 2016) $
** Khronos $Revision: 32155 $ on $Date: 2015-10-22 23:25:39 -0400 (Thu, 22 Oct 2015) $
*/
#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
@ -53,7 +53,7 @@ extern "C" {
#define GLAPI extern
#endif
#define GL_GLEXT_VERSION 20160714
#define GL_GLEXT_VERSION 20151022
/* Generated C header for:
* API: gl
@ -4657,13 +4657,8 @@ GLAPI void APIENTRY glVertexBlendARB (GLint count);
#ifndef GL_ARB_vertex_buffer_object
#define GL_ARB_vertex_buffer_object 1
#if defined(__APPLE__)
typedef intptr_t GLsizeiptrARB;
typedef intptr_t GLintptrARB;
#else
typedef ptrdiff_t GLsizeiptrARB;
typedef ptrdiff_t GLintptrARB;
#endif
#define GL_BUFFER_SIZE_ARB 0x8764
#define GL_BUFFER_USAGE_ARB 0x8765
#define GL_ARRAY_BUFFER_ARB 0x8892
@ -5601,10 +5596,6 @@ GLAPI void APIENTRY glSetMultisamplefvAMD (GLenum pname, GLuint index, const GLf
#define GL_AMD_shader_atomic_counter_ops 1
#endif /* GL_AMD_shader_atomic_counter_ops */
#ifndef GL_AMD_shader_explicit_vertex_parameter
#define GL_AMD_shader_explicit_vertex_parameter 1
#endif /* GL_AMD_shader_explicit_vertex_parameter */
#ifndef GL_AMD_shader_stencil_export
#define GL_AMD_shader_stencil_export 1
#endif /* GL_AMD_shader_stencil_export */
@ -8645,20 +8636,6 @@ GLAPI void APIENTRY glVertexWeightPointerEXT (GLint size, GLenum type, GLsizei s
#endif
#endif /* GL_EXT_vertex_weighting */
#ifndef GL_EXT_window_rectangles
#define GL_EXT_window_rectangles 1
#define GL_INCLUSIVE_EXT 0x8F10
#define GL_EXCLUSIVE_EXT 0x8F11
#define GL_WINDOW_RECTANGLE_EXT 0x8F12
#define GL_WINDOW_RECTANGLE_MODE_EXT 0x8F13
#define GL_MAX_WINDOW_RECTANGLES_EXT 0x8F14
#define GL_NUM_WINDOW_RECTANGLES_EXT 0x8F15
typedef void (APIENTRYP PFNGLWINDOWRECTANGLESEXTPROC) (GLenum mode, GLsizei count, const GLint *box);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glWindowRectanglesEXT (GLenum mode, GLsizei count, const GLint *box);
#endif
#endif /* GL_EXT_window_rectangles */
#ifndef GL_EXT_x11_sync_object
#define GL_EXT_x11_sync_object 1
#define GL_SYNC_X11_FENCE_EXT 0x90E1
@ -8836,11 +8813,6 @@ GLAPI void APIENTRY glBlendFuncSeparateINGR (GLenum sfactorRGB, GLenum dfactorRG
#define GL_INTERLACE_READ_INGR 0x8568
#endif /* GL_INGR_interlace_read */
#ifndef GL_INTEL_conservative_rasterization
#define GL_INTEL_conservative_rasterization 1
#define GL_CONSERVATIVE_RASTERIZATION_INTEL 0x83FE
#endif /* GL_INTEL_conservative_rasterization */
#ifndef GL_INTEL_fragment_shader_ordering
#define GL_INTEL_fragment_shader_ordering 1
#endif /* GL_INTEL_fragment_shader_ordering */
@ -9157,17 +9129,6 @@ GLAPI void APIENTRY glBlendBarrierNV (void);
#define GL_NV_blend_square 1
#endif /* GL_NV_blend_square */
#ifndef GL_NV_clip_space_w_scaling
#define GL_NV_clip_space_w_scaling 1
#define GL_VIEWPORT_POSITION_W_SCALE_NV 0x937C
#define GL_VIEWPORT_POSITION_W_SCALE_X_COEFF_NV 0x937D
#define GL_VIEWPORT_POSITION_W_SCALE_Y_COEFF_NV 0x937E
typedef void (APIENTRYP PFNGLVIEWPORTPOSITIONWSCALENVPROC) (GLuint index, GLfloat xcoeff, GLfloat ycoeff);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glViewportPositionWScaleNV (GLuint index, GLfloat xcoeff, GLfloat ycoeff);
#endif
#endif /* GL_NV_clip_space_w_scaling */
#ifndef GL_NV_command_list
#define GL_NV_command_list 1
#define GL_TERMINATE_SEQUENCE_COMMAND_NV 0x0000
@ -9270,17 +9231,6 @@ GLAPI void APIENTRY glConservativeRasterParameterfNV (GLenum pname, GLfloat valu
#endif
#endif /* GL_NV_conservative_raster_dilate */
#ifndef GL_NV_conservative_raster_pre_snap_triangles
#define GL_NV_conservative_raster_pre_snap_triangles 1
#define GL_CONSERVATIVE_RASTER_MODE_NV 0x954D
#define GL_CONSERVATIVE_RASTER_MODE_POST_SNAP_NV 0x954E
#define GL_CONSERVATIVE_RASTER_MODE_PRE_SNAP_TRIANGLES_NV 0x954F
typedef void (APIENTRYP PFNGLCONSERVATIVERASTERPARAMETERINVPROC) (GLenum pname, GLint param);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glConservativeRasterParameteriNV (GLenum pname, GLint param);
#endif
#endif /* GL_NV_conservative_raster_pre_snap_triangles */
#ifndef GL_NV_copy_depth_to_color
#define GL_NV_copy_depth_to_color 1
#define GL_DEPTH_STENCIL_TO_RGBA_NV 0x886E
@ -10273,11 +10223,6 @@ GLAPI void APIENTRY glGetCombinerStageParameterfvNV (GLenum stage, GLenum pname,
#endif
#endif /* GL_NV_register_combiners2 */
#ifndef GL_NV_robustness_video_memory_purge
#define GL_NV_robustness_video_memory_purge 1
#define GL_PURGED_CONTEXT_RESET_NV 0x92BB
#endif /* GL_NV_robustness_video_memory_purge */
#ifndef GL_NV_sample_locations
#define GL_NV_sample_locations 1
#define GL_SAMPLE_LOCATION_SUBPIXEL_BITS_NV 0x933D
@ -10310,10 +10255,6 @@ GLAPI void APIENTRY glResolveDepthValuesNV (void);
#define GL_NV_shader_atomic_float 1
#endif /* GL_NV_shader_atomic_float */
#ifndef GL_NV_shader_atomic_float64
#define GL_NV_shader_atomic_float64 1
#endif /* GL_NV_shader_atomic_float64 */
#ifndef GL_NV_shader_atomic_fp16_vector
#define GL_NV_shader_atomic_fp16_vector 1
#endif /* GL_NV_shader_atomic_fp16_vector */
@ -10377,10 +10318,6 @@ GLAPI void APIENTRY glProgramUniformui64vNV (GLuint program, GLint location, GLs
#define GL_NV_shader_thread_shuffle 1
#endif /* GL_NV_shader_thread_shuffle */
#ifndef GL_NV_stereo_view_rendering
#define GL_NV_stereo_view_rendering 1
#endif /* GL_NV_stereo_view_rendering */
#ifndef GL_NV_tessellation_program5
#define GL_NV_tessellation_program5 1
#define GL_MAX_PROGRAM_PATCH_ATTRIBS_NV 0x86D8
@ -11151,26 +11088,6 @@ GLAPI void APIENTRY glVideoCaptureStreamParameterdvNV (GLuint video_capture_slot
#define GL_NV_viewport_array2 1
#endif /* GL_NV_viewport_array2 */
#ifndef GL_NV_viewport_swizzle
#define GL_NV_viewport_swizzle 1
#define GL_VIEWPORT_SWIZZLE_POSITIVE_X_NV 0x9350
#define GL_VIEWPORT_SWIZZLE_NEGATIVE_X_NV 0x9351
#define GL_VIEWPORT_SWIZZLE_POSITIVE_Y_NV 0x9352
#define GL_VIEWPORT_SWIZZLE_NEGATIVE_Y_NV 0x9353
#define GL_VIEWPORT_SWIZZLE_POSITIVE_Z_NV 0x9354
#define GL_VIEWPORT_SWIZZLE_NEGATIVE_Z_NV 0x9355
#define GL_VIEWPORT_SWIZZLE_POSITIVE_W_NV 0x9356
#define GL_VIEWPORT_SWIZZLE_NEGATIVE_W_NV 0x9357
#define GL_VIEWPORT_SWIZZLE_X_NV 0x9358
#define GL_VIEWPORT_SWIZZLE_Y_NV 0x9359
#define GL_VIEWPORT_SWIZZLE_Z_NV 0x935A
#define GL_VIEWPORT_SWIZZLE_W_NV 0x935B
typedef void (APIENTRYP PFNGLVIEWPORTSWIZZLENVPROC) (GLuint index, GLenum swizzlex, GLenum swizzley, GLenum swizzlez, GLenum swizzlew);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glViewportSwizzleNV (GLuint index, GLenum swizzlex, GLenum swizzley, GLenum swizzlez, GLenum swizzlew);
#endif
#endif /* GL_NV_viewport_swizzle */
#ifndef GL_OML_interlace
#define GL_OML_interlace 1
#define GL_INTERLACE_OML 0x8980

View file

@ -6,7 +6,7 @@ extern "C" {
#endif
/*
** Copyright (c) 2013-2016 The Khronos Group Inc.
** Copyright (c) 2013-2015 The Khronos Group Inc.
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the
@ -33,10 +33,10 @@ extern "C" {
** used to make the header, and the header can be found at
** http://www.opengl.org/registry/
**
** Khronos $Revision: 32889 $ on $Date: 2016-05-31 07:09:51 -0400 (Tue, 31 May 2016) $
** Khronos $Revision: 31597 $ on $Date: 2015-06-25 16:32:35 -0400 (Thu, 25 Jun 2015) $
*/
#define GLX_GLXEXT_VERSION 20160531
#define GLX_GLXEXT_VERSION 20150623
/* Generated C header for:
* API: glx
@ -317,11 +317,6 @@ void glXFreeContextEXT (Display *dpy, GLXContext context);
#endif
#endif /* GLX_EXT_import_context */
#ifndef GLX_EXT_libglvnd
#define GLX_EXT_libglvnd 1
#define GLX_VENDOR_NAMES_EXT 0x20F6
#endif /* GLX_EXT_libglvnd */
#ifndef GLX_EXT_stereo_tree
#define GLX_EXT_stereo_tree 1
typedef struct {
@ -548,11 +543,6 @@ int glXBindVideoDeviceNV (Display *dpy, unsigned int video_slot, unsigned int vi
#endif
#endif /* GLX_NV_present_video */
#ifndef GLX_NV_robustness_video_memory_purge
#define GLX_NV_robustness_video_memory_purge 1
#define GLX_GENERATE_RESET_ON_VIDEO_MEMORY_PURGE_NV 0x20F7
#endif /* GLX_NV_robustness_video_memory_purge */
#ifndef GLX_NV_swap_group
#define GLX_NV_swap_group 1
typedef Bool ( *PFNGLXJOINSWAPGROUPNVPROC) (Display *dpy, GLXDrawable drawable, GLuint group);

View file

@ -6,7 +6,7 @@ extern "C" {
#endif
/*
** Copyright (c) 2013-2016 The Khronos Group Inc.
** Copyright (c) 2013-2015 The Khronos Group Inc.
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the
@ -33,7 +33,7 @@ extern "C" {
** used to make the header, and the header can be found at
** http://www.opengl.org/registry/
**
** Khronos $Revision: 32686 $ on $Date: 2016-04-19 21:08:44 -0400 (Tue, 19 Apr 2016) $
** Khronos $Revision: 31597 $ on $Date: 2015-06-25 16:32:35 -0400 (Thu, 25 Jun 2015) $
*/
#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
@ -41,7 +41,7 @@ extern "C" {
#include <windows.h>
#endif
#define WGL_WGLEXT_VERSION 20160419
#define WGL_WGLEXT_VERSION 20150623
/* Generated C header for:
* API: wgl

View file

@ -196,6 +196,18 @@ CDriverGL::CDriverGL()
_backBufferHeight = 0;
_backBufferWidth = 0;
// autorelease pool for memory management
_autoreleasePool = [[NSAutoreleasePool alloc] init];
// init the application object
[NSApplication sharedApplication];
// create the menu in the top screen bar
setupApplicationMenu();
// finish the application launching
[NSApp finishLaunching];
#elif defined (NL_OS_UNIX)
_dpy = 0;
@ -361,6 +373,10 @@ CDriverGL::~CDriverGL()
{
H_AUTO_OGL(CDriverGL_CDriverGLDtor)
release();
#if defined(NL_OS_MAC)
[_autoreleasePool release];
#endif
}
// --------------------------------------------------
@ -660,8 +676,8 @@ bool CDriverGL::setupDisplay()
}
#endif
// Get initial VBL interval
_Interval = getSwapVBLInterval();
// Reset the vbl interval
setSwapVBLInterval(_Interval);
return true;
}
@ -926,6 +942,13 @@ bool CDriverGL::swapBuffers()
#elif defined(NL_OS_MAC)
// TODO: maybe do this somewhere else?
if(_DestroyWindow)
{
[_autoreleasePool release];
_autoreleasePool = [[NSAutoreleasePool alloc] init];
}
[_ctx flushBuffer];
#elif defined (NL_OS_UNIX)
@ -2265,22 +2288,16 @@ void CDriverGL::setSwapVBLInterval(uint interval)
H_AUTO_OGL(CDriverGL_setSwapVBLInterval);
if (!_Initialized)
{
nlwarning("OpenGL driver not initialized when calling setSwapVBLInterval");
return;
}
bool res = true;
// don't try to change VBL if interval didn't change
if (_Interval == interval) return;
#ifdef USE_OPENGLES
res = eglSwapInterval(_EglDisplay, interval) == EGL_TRUE;
res = eglSwapInterval(_EglDisplay, _Interval) == EGL_TRUE;
#elif defined(NL_OS_WINDOWS)
if(_Extensions.WGLEXTSwapControl)
{
res = nwglSwapIntervalEXT(interval) == TRUE;
res = nwglSwapIntervalEXT(_Interval) == TRUE;
}
#elif defined(NL_OS_MAC)
[_ctx setValues:(GLint*)&interval forParameter:NSOpenGLCPSwapInterval];

View file

@ -1685,7 +1685,6 @@ void registerGlExtensions(CGlExtensions &ext)
{
ext.ARBFragmentProgram = false;
ext.NVFragmentProgram2 = false;
ext.ARBFragmentShader = false;
}
ext.OESDrawTexture = setupOESDrawTexture(glext);
@ -1992,32 +1991,24 @@ bool registerWGlExtensions(CGlExtensions &ext, HDC hDC)
if (ext.WGLNVGPUAffinity)
{
uint gpuIndex = 0;
uint i = 0;
HGPUNV hGPU;
// list all GPUs
while (nwglEnumGpusNV(gpuIndex, &hGPU))
while(nwglEnumGpusNV(i, &hGPU))
{
uint j = 0;
_GPU_DEVICE gpuDevice;
gpuDevice.cb = sizeof(gpuDevice);
PGPU_DEVICE lpGpuDevice = NULL;
// list all devices connected to GPU
while(nwglEnumGpuDevicesNV(hGPU, j, &gpuDevice))
while(nwglEnumGpuDevicesNV(hGPU, j, lpGpuDevice))
{
nlinfo("Device: %s / %s / flags: %u", gpuDevice.DeviceName, gpuDevice.DeviceString, (uint)gpuDevice.Flags);
if (gpuDevice.Flags & DISPLAY_DEVICE_ATTACHED_TO_DESKTOP)
{
nlinfo("Virtual screen: (%d,%d)-(%d,%d)", (sint)gpuDevice.rcVirtualScreen.left, (sint)gpuDevice.rcVirtualScreen.top, (sint)gpuDevice.rcVirtualScreen.right, (sint)gpuDevice.rcVirtualScreen.bottom);
}
nlinfo("Device: %s - %s - flags: %u", lpGpuDevice->DeviceName, lpGpuDevice->DeviceString, lpGpuDevice->Flags);
++j;
}
++gpuIndex;
++i;
}
}

View file

@ -343,14 +343,9 @@ bool CDriverGL::init (uintptr_t windowIcon, emptyProc exitFunc)
retrieveATIDriverVersion();
#elif defined(NL_OS_MAC)
// nothing to do
nlunreferenced(windowIcon);
// autorelease pool for memory management
_autoreleasePool = [[NSAutoreleasePool alloc] init];
// init the application object
[NSApplication sharedApplication];
#elif defined (NL_OS_UNIX)
nlunreferenced(windowIcon);
@ -490,7 +485,7 @@ bool CDriverGL::unInit()
#elif defined(NL_OS_MAC)
[_autoreleasePool release];
// nothing to do
#elif defined (NL_OS_UNIX)
@ -1471,12 +1466,6 @@ bool CDriverGL::createWindow(const GfxMode &mode)
#elif defined(NL_OS_MAC)
// create the menu in the top screen bar
setupApplicationMenu();
// finish the application launching
[NSApp finishLaunching];
// describe how the window should look like and behave
unsigned int styleMask = NSTitledWindowMask | NSClosableWindowMask |
NSMiniaturizableWindowMask | NSResizableWindowMask;
@ -1497,7 +1486,7 @@ bool CDriverGL::createWindow(const GfxMode &mode)
[[CocoaApplicationDelegate alloc] initWithDriver:this];
// set the application delegate, this will handle window/app close events
[NSApp setDelegate:(id<NSApplicationDelegate>)appDelegate];
[NSApp setDelegate:(id<NSFileManagerDelegate>)appDelegate];
// bind the close button of the window to applicationShouldTerminate
id closeButton = [cocoa_window standardWindowButton:NSWindowCloseButton];
@ -1653,7 +1642,6 @@ bool CDriverGL::destroyWindow()
}
#elif defined(NL_OS_MAC)
#elif defined(NL_OS_UNIX)
if (_DestroyWindow && _ctx) // FIXME: _DestroyWindow may need to be removed here as well
@ -2311,10 +2299,7 @@ void CDriverGL::setWindowTitle(const ucstring &title)
#ifdef NL_OS_WINDOWS
if (!SetWindowTextW(_win, (WCHAR*)title.c_str()))
{
nlwarning("SetWindowText failed: %s", formatErrorMessage(getLastError()).c_str());
}
SetWindowTextW(_win, (WCHAR*)title.c_str());
#elif defined(NL_OS_MAC)

View file

@ -442,16 +442,9 @@ void CCocoaEventEmitter::submitEvents(CEventServer& server, bool /* allWins */)
processMessage(event, &server);
}
@try
{
// forward the event to the cocoa application
[NSApp sendEvent:event];
}
@catch(NSException *e)
{
nlwarning("Exception when sending event: %s", [[e reason] UTF8String]);
}
}
_server = &server;
}

View file

@ -528,7 +528,7 @@ void CDRU::drawTrianglesUnlit(const NLMISC::CTriangleUV *trilist, sint ntris,
// ***************************************************************************
void CDRU::drawTrianglesUnlit(const std::vector<NLMISC::CTriangleUV> &trilist, CMaterial &mat, IDriver& driver)
{
if(trilist.empty())
if(trilist.size()==0)
return;
CDRU::drawTrianglesUnlit( &(*trilist.begin()), (uint)trilist.size(), mat, driver);
@ -570,7 +570,7 @@ void CDRU::drawLinesUnlit(const NLMISC::CLine *linelist, sint nlines, CMateria
// ***************************************************************************
void CDRU::drawLinesUnlit(const std::vector<NLMISC::CLine> &linelist, CMaterial &mat, IDriver& driver)
{
if(linelist.empty())
if(linelist.size()==0)
return;
CDRU::drawLinesUnlit( &(*linelist.begin()), (sint)linelist.size(), mat, driver);
}

View file

@ -457,7 +457,7 @@ CFontGenerator::CFontGenerator (const std::string &fontFileName, const std::stri
nlerror ("FT_New_Face() failed with file '%s': %s", fontFileName.c_str(), getFT2Error(error));
}
if (!fontExFileName.empty())
if (fontExFileName != "")
{
error = FT_Attach_File (_Face, fontExFileName.c_str ());
if (error)

View file

@ -1831,9 +1831,9 @@ void CLandscape::loadTile(uint16 tileId)
if(tile)
textName= tile->getRelativeFileName(CTile::additive);
else
textName.clear();
textName= "";
// If no additive for this tile, rdrpass is NULL.
if(textName.empty())
if(textName=="")
tileInfo->AdditiveRdrPass= NULL;
else
{
@ -1844,7 +1844,7 @@ void CLandscape::loadTile(uint16 tileId)
// We may have an alpha part for additive.
textName= tile->getRelativeFileName (CTile::alpha);
if(!textName.empty())
if(textName!="")
// Must Use clamp for alpha (although NVidia drivers are buggy), because the texture doesn't tile at all
pass.TextureAlpha= findTileTexture(TileBank.getAbsPath()+textName, true);
@ -1866,7 +1866,7 @@ void CLandscape::loadTile(uint16 tileId)
if(tile)
{
textName= tile->getRelativeFileName(CTile::diffuse);
if(!textName.empty())
if(textName!="")
// Avoid using Clamp for diffuse, because of recent NVidia GL drivers Bugs in 77.72
pass.TextureDiffuse= findTileTexture(TileBank.getAbsPath()+textName, false);
else
@ -1880,7 +1880,7 @@ void CLandscape::loadTile(uint16 tileId)
if(tile)
{
textName= tile->getRelativeFileName (CTile::alpha);
if(!textName.empty())
if(textName!="")
// Must Use clamp for alpha (although NVidia drivers are buggy), because the texture doesn't tile at all
pass.TextureAlpha= findTileTexture(TileBank.getAbsPath()+textName, true);
}
@ -2859,7 +2859,7 @@ void CLandscape::setupAutomaticLightDir(const CVector &lightDir)
// ***************************************************************************
CVector CLandscape::getHeightFieldDeltaZ(float x, float y) const
{
if(_HeightField.ZPatchs.empty())
if(_HeightField.ZPatchs.size()==0)
return CVector::Null;
// map to _HeightField coordinates.

View file

@ -213,9 +213,9 @@ void CLandscapeUser::refreshAllZonesAround(const CVector &pos, float radius, std
refreshZonesAround (pos, radius, za, zr);
// some zone added or removed??
if(!za.empty())
if(za != "")
zonesAdded.push_back(za);
if(!zr.empty())
if(zr != "")
zonesRemoved.push_back(zr);
_ZoneManager.checkZonesAround ((uint)pos.x, (uint)(-pos.y), (uint)radius);

View file

@ -174,7 +174,7 @@ UInstanceGroup *CLandscapeIGManager::loadZoneIG(const std::string &name)
{
NL3D_HAUTO_LAND_MNGR_LOAD_ZONEIG
if(name.empty())
if(name=="")
return NULL;
// try to find this InstanceGroup.
@ -232,7 +232,7 @@ void CLandscapeIGManager::unloadArrayZoneIG(const std::vector<std::string> &name
void CLandscapeIGManager::unloadZoneIG(const std::string &name)
{
NL3D_HAUTO_LAND_MNGR_UNLOAD_ZONEIG
if(name.empty())
if(name=="")
return;
// try to find this InstanceGroup.
@ -255,7 +255,7 @@ void CLandscapeIGManager::unloadZoneIG(const std::string &name)
// ***************************************************************************
bool CLandscapeIGManager::isIGAddedToScene(const std::string &name) const
{
if(name.empty())
if(name=="")
return false;
// try to find this InstanceGroup.
@ -272,7 +272,7 @@ bool CLandscapeIGManager::isIGAddedToScene(const std::string &name) const
// ***************************************************************************
UInstanceGroup *CLandscapeIGManager::getIG(const std::string &name) const
{
if(name.empty())
if(name=="")
return NULL;
// try to find this InstanceGroup.

View file

@ -134,7 +134,7 @@ void CLandscapeVBAllocator::resetReallocation()
uint CLandscapeVBAllocator::allocateVertex()
{
// if no more free, allocate.
if( _VertexFreeMemory.empty() )
if( _VertexFreeMemory.size()==0 )
{
// enlarge capacity.
uint newResize;

View file

@ -52,7 +52,7 @@ namespace NL3D
static NLMISC::CAABBoxExt makeBBox(const std::vector<CVector> &Vertices)
{
NLMISC::CAABBox ret;
nlassert(!Vertices.empty());
nlassert(Vertices.size());
ret.setCenter(Vertices[0]);
for(sint i=0;i<(sint)Vertices.size();i++)
{
@ -167,7 +167,7 @@ void CMeshGeom::build (CMesh::CMeshBuild &m, uint numMaxMaterial)
sint i;
// Empty geometry?
if(m.Vertices.empty() || m.Faces.empty())
if(m.Vertices.size()==0 || m.Faces.size()==0)
{
_VBuffer.setNumVertices(0);
_VBuffer.setName("CMeshGeom");
@ -436,7 +436,7 @@ void CMeshGeom::build (CMesh::CMeshBuild &m, uint numMaxMaterial)
}
// Set the vertex buffer preferred memory
bool avoidVBHard= _Skinned || ( _MeshMorpher && !_MeshMorpher->BlendShapes.empty() );
bool avoidVBHard= _Skinned || ( _MeshMorpher && _MeshMorpher->BlendShapes.size()>0 );
_VBuffer.setPreferredMemory (avoidVBHard?CVertexBuffer::RAMPreferred:CVertexBuffer::StaticPreferred, false);
// End!!
@ -638,7 +638,7 @@ void CMeshGeom::render(IDriver *drv, CTransformShape *trans, float polygonCount,
for(uint mb=0;mb<_MatrixBlocks.size();mb++)
{
CMatrixBlock &mBlock= _MatrixBlocks[mb];
if(mBlock.RdrPass.empty())
if(mBlock.RdrPass.size()==0)
continue;
// Global alpha ?
@ -790,7 +790,7 @@ void CMeshGeom::renderSkin(CTransformShape *trans, float alphaMRM)
for(uint mb=0;mb<_MatrixBlocks.size();mb++)
{
CMatrixBlock &mBlock= _MatrixBlocks[mb];
if(mBlock.RdrPass.empty())
if(mBlock.RdrPass.size()==0)
continue;
// Render all pass.
@ -840,7 +840,7 @@ void CMeshGeom::renderSimpleWithMaterial(IDriver *drv, const CMatrix &worldMatri
for(uint mb=0;mb<_MatrixBlocks.size();mb++)
{
CMatrixBlock &mBlock= _MatrixBlocks[mb];
if(mBlock.RdrPass.empty())
if(mBlock.RdrPass.size()==0)
continue;
// Render all pass.
@ -998,10 +998,10 @@ void CMeshGeom::compileRunTime()
_PreciseClipping= _BBox.getRadius() >= NL3D_MESH_PRECISE_CLIP_THRESHOLD;
// Support MeshBlockRendering only if not skinned/meshMorphed.
bool supportMeshBlockRendering= !_Skinned && _MeshMorpher->BlendShapes.empty();
bool supportMeshBlockRendering= !_Skinned && _MeshMorpher->BlendShapes.size()==0;
// true only if one matrix block, and at least one rdrPass.
supportMeshBlockRendering= supportMeshBlockRendering && _MatrixBlocks.size()==1 && !_MatrixBlocks[0].RdrPass.empty();
supportMeshBlockRendering= supportMeshBlockRendering && _MatrixBlocks.size()==1 && _MatrixBlocks[0].RdrPass.size()>0;
if (supportMeshBlockRendering && _MeshVertexProgram)
{
supportMeshBlockRendering = supportMeshBlockRendering && _MeshVertexProgram->supportMeshBlockRendering();
@ -1021,7 +1021,7 @@ void CMeshGeom::compileRunTime()
if(supportMBRPerMaterial)
_SupportMBRFlags|= MBRSortPerMaterial;
bool avoidVBHard= _Skinned || ( _MeshMorpher && !_MeshMorpher->BlendShapes.empty() );
bool avoidVBHard= _Skinned || ( _MeshMorpher && _MeshMorpher->BlendShapes.size()>0 );
_VBuffer.setPreferredMemory (avoidVBHard?CVertexBuffer::RAMPreferred:CVertexBuffer::StaticPreferred, false);
}

View file

@ -407,10 +407,9 @@ void CMeshMorpher::updateRawSkin (CVertexBuffer *vbOri,
rFactor*= 0.01f;
uint32 numVertices= (uint32)rBS.VertRefs.size();
// don't know why, but cases happen where deltaNorm not empty while deltaPos is
bool hasPos = !rBS.deltaPos.empty();
bool hasNorm = !rBS.deltaNorm.empty();
bool hasUV = !rBS.deltaUV.empty();
bool hasPos= rBS.deltaPos.size()>0;
bool hasNorm= rBS.deltaNorm.size()>0;
bool hasUV= rBS.deltaUV.size()>0;
for (j = 0; j < numVertices; ++j)
{
// Get the vertex Index in the VBufferFinal

View file

@ -180,7 +180,7 @@ void CMeshMRMGeom::CLod::optimizeTriangleOrder()
static NLMISC::CAABBoxExt makeBBox(const std::vector<CVector> &Vertices)
{
NLMISC::CAABBox ret;
nlassert(!Vertices.empty());
nlassert(Vertices.size());
ret.setCenter(Vertices[0]);
for(sint i=0;i<(sint)Vertices.size();i++)
{
@ -236,7 +236,7 @@ void CMeshMRMGeom::build(CMesh::CMeshBuild &m, std::vector<CMesh::CMeshBuild*>
uint numMaxMaterial, const CMRMParameters &params)
{
// Empty geometry?
if(m.Vertices.empty() || m.Faces.empty())
if(m.Vertices.size()==0 || m.Faces.size()==0)
{
_VBufferFinal.setNumVertices(0);
_VBufferFinal.reserve(0);
@ -308,7 +308,7 @@ void CMeshMRMGeom::build(CMesh::CMeshBuild &m, std::vector<CMesh::CMeshBuild*>
_LevelDetail.MaxFaceUsed= 0;
_LevelDetail.MinFaceUsed= 0;
// Count of primitive block
if (!_Lods.empty())
if(_Lods.size()>0)
{
uint pb;
// Compute MinFaces.
@ -469,7 +469,7 @@ void CMeshMRMGeom::applyGeomorph(std::vector<CMRMWedgeGeom> &geoms, float alpha
void CMeshMRMGeom::applyGeomorphWithVBHardPtr(std::vector<CMRMWedgeGeom> &geoms, float alphaLod, uint8 *vertexDestPtr)
{
// no geomorphs? quit.
if(geoms.empty())
if(geoms.size()==0)
return;
clamp(alphaLod, 0.f, 1.f);
@ -900,7 +900,7 @@ inline sint CMeshMRMGeom::chooseLod(float alphaMRM, float &alphaLod)
void CMeshMRMGeom::render(IDriver *drv, CTransformShape *trans, float polygonCount, uint32 rdrFlags, float globalAlpha)
{
nlassert(drv);
if(_Lods.empty())
if(_Lods.size()==0)
return;
@ -922,7 +922,7 @@ void CMeshMRMGeom::render(IDriver *drv, CTransformShape *trans, float polygonCou
// Render the choosen Lod.
CLod &lod= _Lods[numLod];
if(lod.RdrPass.empty())
if(lod.RdrPass.size()==0)
return;
@ -1104,7 +1104,7 @@ void CMeshMRMGeom::renderSkin(CTransformShape *trans, float alphaMRM)
{
H_AUTO( NL3D_MeshMRMGeom_renderSkin );
if(_Lods.empty())
if(_Lods.size()==0)
return;
@ -1126,7 +1126,7 @@ void CMeshMRMGeom::renderSkin(CTransformShape *trans, float alphaMRM)
// Render the choosen Lod.
CLod &lod= _Lods[numLod];
if(lod.RdrPass.empty())
if(lod.RdrPass.size()==0)
return;
@ -1295,7 +1295,7 @@ sint CMeshMRMGeom::renderSkinGroupGeom(CMeshMRMInstance *mi, float alphaMRM, uin
// Render the choosen Lod.
CLod &lod= _Lods[numLod];
if(lod.RdrPass.empty())
if(lod.RdrPass.size()==0)
// return no vertices added
return 0;
@ -1942,7 +1942,7 @@ void CMeshMRMGeom::loadFirstLod(NLMISC::IStream &f)
// If empty MRM, quit.
if(_LodInfos.empty())
if(_LodInfos.size()==0)
return;
/* If the version is <4, then SkinWeights are serialised per Lod.
@ -2431,7 +2431,7 @@ void CMeshMRMGeom::compileRunTime()
_PreciseClipping= _BBox.getRadius() >= NL3D_MESH_PRECISE_CLIP_THRESHOLD;
// Compute if can support SkinGrouping rendering
if(_Lods.empty() || !_Skinned)
if(_Lods.size()==0 || !_Skinned)
{
_SupportSkinGrouping= false;
_SupportShadowSkinGrouping= false;
@ -2451,7 +2451,7 @@ void CMeshMRMGeom::compileRunTime()
}
// Support MeshBlockRendering only if not skinned/meshMorphed.
_SupportMeshBlockRendering= !_Skinned && _MeshMorpher.BlendShapes.empty();
_SupportMeshBlockRendering= !_Skinned && _MeshMorpher.BlendShapes.size()==0;
// \todo yoyo: support later MeshVertexProgram
_SupportMeshBlockRendering= _SupportMeshBlockRendering && _MeshVertexProgram==NULL;
@ -3367,7 +3367,7 @@ void CMeshMRMGeom::updateRawSkinNormal(bool enabled, CMeshMRMInstance *mi, sint
// Case of MeshMorpher
//========
if(!_MeshMorpher.BlendShapes.empty())
if(_MeshMorpher.BlendShapes.size()>0)
{
skinLod.VertexRemap.resize((uint32)vertexFinalRemap.size());

View file

@ -55,7 +55,7 @@ namespace NL3D
void CMeshMRMGeom::applySkin(CLod &lod, const CSkeletonModel *skeleton)
{
nlassert(_Skinned);
if(_SkinWeights.empty())
if(_SkinWeights.size()==0)
return;
// get vertexPtr.

View file

@ -380,7 +380,7 @@ static void applyArraySkinTangentSpaceT(uint numMatrixes, uint32 *infPtr, CMesh:
void CMeshMRMGeom::applySkinWithNormal(CLod &lod, const CSkeletonModel *skeleton)
{
nlassert(_Skinned);
if(_SkinWeights.empty())
if(_SkinWeights.size()==0)
return;
// get vertexPtr / normalOff.
@ -446,7 +446,7 @@ void CMeshMRMGeom::applySkinWithTangentSpace(CLod &lod, const CSkeletonModel *sk
uint tangentSpaceTexCoord)
{
nlassert(_Skinned);
if(_SkinWeights.empty())
if(_SkinWeights.size()==0)
return;
// get vertexPtr / normalOff / tangent space offset.
@ -1468,7 +1468,7 @@ void CMeshMRMGeom::applyArrayRawSkinNormal4(CRawVertexNormalSkin4 *src, uint8 *
void CMeshMRMGeom::applyRawSkinWithNormal(CLod &lod, CRawSkinNormalCache &rawSkinLod, const CSkeletonModel *skeleton, uint8 *vbHard, float alphaLod)
{
nlassert(_Skinned);
if(_SkinWeights.empty())
if(_SkinWeights.size()==0)
return;
// Some assert

View file

@ -160,7 +160,7 @@ void CMeshMRMSkinnedGeom::CLod::buildPrimitiveBlock(uint renderPass, const CInde
static NLMISC::CAABBoxExt makeBBox(const std::vector<CVector> &Vertices)
{
NLMISC::CAABBox ret;
nlassert(!Vertices.empty());
nlassert(Vertices.size());
ret.setCenter(Vertices[0]);
for(sint i=0;i<(sint)Vertices.size();i++)
{
@ -211,7 +211,7 @@ void CMeshMRMSkinnedGeom::build(CMesh::CMeshBuild &m,
uint numMaxMaterial, const CMRMParameters &params)
{
// Empty geometry?
if(m.Vertices.empty() || m.Faces.empty())
if(m.Vertices.size()==0 || m.Faces.size()==0)
{
_VBufferFinal.clear();
_Lods.clear();
@ -261,7 +261,7 @@ void CMeshMRMSkinnedGeom::build(CMesh::CMeshBuild &m,
_LevelDetail.MaxFaceUsed= 0;
_LevelDetail.MinFaceUsed= 0;
// Count of primitive block
if(!_Lods.empty())
if(_Lods.size()>0)
{
uint pb;
// Compute MinFaces.
@ -421,7 +421,7 @@ void CMeshMRMSkinnedGeom::applyGeomorph(std::vector<CMRMWedgeGeom> &geoms, floa
void CMeshMRMSkinnedGeom::applyGeomorphWithVBHardPtr(std::vector<CMRMWedgeGeom> &geoms, float alphaLod)
{
// no geomorphs? quit.
if(geoms.empty())
if(geoms.size()==0)
return;
clamp(alphaLod, 0.f, 1.f);
@ -579,7 +579,7 @@ inline sint CMeshMRMSkinnedGeom::chooseLod(float alphaMRM, float &alphaLod)
void CMeshMRMSkinnedGeom::render(IDriver *drv, CTransformShape *trans, float polygonCount, uint32 rdrFlags, float globalAlpha)
{
nlassert(drv);
if(_Lods.empty())
if(_Lods.size()==0)
return;
@ -597,7 +597,7 @@ void CMeshMRMSkinnedGeom::render(IDriver *drv, CTransformShape *trans, float pol
// Render the choosen Lod.
CLod &lod= _Lods[numLod];
if(lod.RdrPass.empty())
if(lod.RdrPass.size()==0)
return;
@ -757,7 +757,7 @@ sint CMeshMRMSkinnedGeom::renderSkinGroupGeom(CMeshMRMSkinnedInstance *mi, float
// Render the choosen Lod.
CLod &lod= _Lods[numLod];
if(lod.RdrPass.empty())
if(lod.RdrPass.size()==0)
// return no vertices added
return 0;

View file

@ -3119,7 +3119,7 @@ bool CMRMBuilder::buildMRMSewingMeshes(const CMesh::CMeshBuild &mbuild, uint nWa
{
nlassert(nWantedLods>=1);
nlassert(divisor>=1);
if(mbuild.Interfaces.empty())
if(mbuild.Interfaces.size()==0)
return false;
// must have same size
if(mbuild.InterfaceLinks.size()!=mbuild.Vertices.size())

View file

@ -604,8 +604,7 @@ void CPatch::addRefTessBlocks()
uint i;
TessBlockRefCount++;
if (TessBlocks.empty())
if(TessBlocks.size()==0)
{
// Allocate the tessblocks.
//==========
@ -1630,7 +1629,7 @@ void CPatch::serial(NLMISC::IStream &f)
// then just copy to TileColors.
TileColors.resize(tmpArray.size());
if(!TileColors.empty())
if(TileColors.size()>0)
{
memcpy(&TileColors[0], &tmpArray[0], TileColors.size()*sizeof(CTileColor));
}

View file

@ -1452,7 +1452,7 @@ void CPatch::computeSoftwareGeomorphAndAlpha()
// Need only to fill CTessVertex, so do it only for FarVertices
// Hence Geomorph is done twice on edges of patches!!.
// If not too near for precise, fast compute of geomorph.
if( TessBlocks.empty() )
if( TessBlocks.size()==0 )
{
// Just update all vertices of master block.
computeGeomorphVertexList(MasterBlock.FarVertexList);

View file

@ -540,7 +540,7 @@ bool CPatchDLMContext::generate(CPatch *patch, CTextureDLM *textureDLM, CPatch
#ifndef NL_DLM_TILE_RES
// retrieve patch tileColor pointer.
nlassert(!_Patch->TileColors.empty());
nlassert(_Patch->TileColors.size()>0);
CTileColor *tileColor= &_Patch->TileColors[0];
// skip 1 tiles colors per column and per row
@ -898,7 +898,7 @@ void CPatchDLMContext::compileLighting(TCompileType compType, CRGBA modulateCt
if(! (_IsSrcTextureFullBlack && _IsDstTextureFullBlack) )
{
// if lightMap allocated
if(!_LightMap.empty() && _DLMTexture)
if(_LightMap.size()>0 && _DLMTexture)
{
// If the srcTexture is full black (ie no pointLight influence touch it),
if(_IsSrcTextureFullBlack)

View file

@ -226,7 +226,7 @@ void CPSFace::step(TPSProcessPass pass)
else if (pass == PSMotion)
{
if (!_PrecompBasis.empty()) // do we use precomputed basis ?
if (_PrecompBasis.size()) // do we use precomputed basis ?
{
// rotate all precomputed basis
for (CPSVector< CPlaneBasisPair >::V::iterator it = _PrecompBasis.begin(); it != _PrecompBasis.end(); ++it)
@ -394,7 +394,7 @@ void CPSFace::deleteElement(uint32 index)
NL_PS_FUNC(CPSFace_deleteElement)
CPSQuad::deleteElement(index);
deletePlaneBasisElement(index);
if (!_PrecompBasis.empty()) // do we use precomputed basis ?
if (_PrecompBasis.size()) // do we use precomputed basis ?
{
// replace ourself by the last element...
_IndexInPrecompBasis[index] = _IndexInPrecompBasis[_Owner->getSize() - 1];
@ -407,7 +407,7 @@ void CPSFace::resize(uint32 size)
NL_PS_FUNC(CPSFace_resize)
nlassert(size < (1 << 16));
resizePlaneBasis(size);
if (!_PrecompBasis.empty()) // do we use precomputed basis ?
if (_PrecompBasis.size()) // do we use precomputed basis ?
{
_IndexInPrecompBasis.resize(size);
}

View file

@ -1994,7 +1994,7 @@ void CPSConstraintMesh::deleteElement(uint32 index)
deleteSizeElement(index);
deletePlaneBasisElement(index);
// TODO : avoid code cuplication with CPSFace ...
if (!_PrecompBasis.empty()) // do we use precomputed basis ?
if (_PrecompBasis.size()) // do we use precomputed basis ?
{
// replace ourself by the last element...
_IndexInPrecompBasis[index] = _IndexInPrecompBasis[_Owner->getSize() - 1];
@ -2011,7 +2011,7 @@ void CPSConstraintMesh::resize(uint32 size)
resizeSize(size);
resizePlaneBasis(size);
// TODO : avoid code cuplication with CPSFace ...
if (!_PrecompBasis.empty()) // do we use precomputed basis ?
if (_PrecompBasis.size()) // do we use precomputed basis ?
{
_IndexInPrecompBasis.resize(size);
}

View file

@ -229,7 +229,7 @@ void CQuadEffect::processPoly(const TPoint2DVect &poly
static TRasters rDest;
float currY;
makeRasters(poly, quadWidth, quadHeight, rDest, currY);
if (!dest.empty())
if (dest.size())
{
TRasters::const_iterator it, endIt = rDest.end();
for (it = rDest.begin(); it != endIt; ++it)

View file

@ -451,6 +451,7 @@ void CInstanceGroup::serial (NLMISC::IStream& f)
_PointLightArray.clear();
}
if (version >= 2)
f.serial(_GlobalPos);
@ -573,15 +574,14 @@ bool CInstanceGroup::addToScene (CScene& scene, IDriver *driver, uint selectedTe
else
{
_Instances[i] = scene.createInstance (shapeName);
if (_Instances[i] == NULL)
}
if( _Instances[i] == NULL )
{
nlwarning("Not found '%s' file", shapeName.c_str());
}
}
}
}
}
scene.setWaterCallback(oldCallback);
return addToSceneWhenAllShapesLoaded (scene, driver, selectedTexture);
}
@ -1121,7 +1121,7 @@ void CInstanceGroup::setClusterSystemForInstances(CInstanceGroup *pIG)
void CInstanceGroup::getDynamicPortals (std::vector<std::string> &names)
{
for (uint32 i = 0; i < _Portals.size(); ++i)
if (!_Portals[i].getName().empty())
if (_Portals[i].getName() != "")
names.push_back (_Portals[i].getName());
}

View file

@ -705,7 +705,7 @@ void CShadowMapManager::renderProject(CScene *scene)
}
driver->activeVertexBuffer (CopyQuads);
if (!_ShadowCasters.empty())
if (_ShadowCasters.size()>0)
{
// get the transform to compute shadow map.
CTransform *sc= _ShadowCasters[0];

View file

@ -119,7 +119,7 @@ bool CTextureDLM::canCreateLightMap(uint w, uint h)
return true;
// If empty, test if there is an empty block.
return !_EmptyBlocks.empty();
return _EmptyBlocks.size()>0;
}
@ -166,7 +166,7 @@ bool CTextureDLM::createLightMap(uint w, uint h, uint &x, uint &y)
if(_FreeBlocks[lMapType]==NULL)
{
// list is empty => allocate a block from _EmptyBlocks.
nlassert(!_EmptyBlocks.empty());
nlassert(_EmptyBlocks.size()>0);
// pop a block from empty list
CBlock *block= &_Blocks[_EmptyBlocks.back()];

View file

@ -108,7 +108,7 @@ void CTileBank::serial(NLMISC::IStream &f) throw(NLMISC::EStream)
if (f.isReading())
{
// Checks
nlassert (!_DisplacementMap.empty());
nlassert (_DisplacementMap.size()>0);
// Set first empty
_DisplacementMap[0].setEmpty ();
@ -264,7 +264,7 @@ sint CTileBank::getNumBitmap (CTile::TBitmap bitmap) const
if (!_TileVector[i].isFree())
{
const std::string &str=_TileVector[i].getRelativeFileName (bitmap);
if (!str.empty())
if (str!="")
{
std::vector<char> vect (str.length()+1);
memcpy (&*vect.begin(), str.c_str(), str.length()+1);
@ -543,7 +543,7 @@ CTileNoiseMap *CTileBank::getTileNoiseMap (uint tileNumber, uint tileSubNoise)
}
}
if (_DisplacementMap.empty() || _DisplacementMap[0]._TileNoiseMap)
if (_DisplacementMap.size()==0 || _DisplacementMap[0]._TileNoiseMap)
return NULL;
// Checks
@ -583,7 +583,7 @@ void CTileBank::removeDisplacementMap (uint mapId)
if (mapId==_DisplacementMap.size()-1)
{
// Resize the array ?
while ((mapId>0)&&(_DisplacementMap[mapId]._FileName.empty()))
while ((mapId>0)&&(_DisplacementMap[mapId]._FileName==""))
_DisplacementMap.resize (mapId--);
}
}
@ -608,7 +608,7 @@ uint CTileBank::getDisplacementMap (const string &fileName)
for (noiseTile=0; noiseTile<_DisplacementMap.size(); noiseTile++)
{
// Same name ?
if (_DisplacementMap[noiseTile]._FileName.empty())
if (_DisplacementMap[noiseTile]._FileName=="")
break;
}
if (noiseTile==_DisplacementMap.size())
@ -1433,7 +1433,7 @@ void CTileSet::deleteBordersIfLast (const CTileBank& bank, CTile::TBitmap type)
while (ite!=_Tile128.end())
{
// If the file name is valid
if (!bank.getTile (*ite)->getRelativeFileName(type).empty())
if (bank.getTile (*ite)->getRelativeFileName(type)!="")
{
// Don't delete,
bDelete=false;
@ -1450,7 +1450,7 @@ void CTileSet::deleteBordersIfLast (const CTileBank& bank, CTile::TBitmap type)
while (ite!=_Tile256.end())
{
// If the file name is valid
if (!bank.getTile (*ite)->getRelativeFileName(type).empty())
if (bank.getTile (*ite)->getRelativeFileName(type)!="")
{
// Don't delete,
bDelete=false;
@ -1474,7 +1474,7 @@ void CTileSet::deleteBordersIfLast (const CTileBank& bank, CTile::TBitmap type)
if (nTile!=-1)
{
// If the file name is valid
if (!bank.getTile (nTile)->getRelativeFileName(type).empty())
if (bank.getTile (nTile)->getRelativeFileName(type)!="")
{
// Don't delete,
bDelete=false;
@ -1564,7 +1564,7 @@ const CTileVegetableDesc &CTileSet::getTileVegetableDesc() const
// ***************************************************************************
void CTileSet::loadTileVegetableDesc()
{
if(!_TileVegetableDescFileName.empty())
if(_TileVegetableDescFileName!="")
{
try
{

View file

@ -71,7 +71,7 @@ void CVegetableBlendLayerModel::render(IDriver *driver)
nlassert(VegetableManager);
if(SortBlocks.empty())
if(SortBlocks.size()==0)
return;
// Setup VegetableManager renderState (like pre-setuped material)

View file

@ -1019,12 +1019,12 @@ void CVegetableManager::reserveIgCompile(CVegetableInstanceGroup *ig, const CV
{
CVegetableInstanceGroup::CVegetableRdrPass &vegetRdrPass= ig->_RdrPass[rdrPass];
nlassert(vegetRdrPass.TriangleIndices.getNumIndexes()==0);
nlassert(vegetRdrPass.TriangleLocalIndices.empty());
nlassert(vegetRdrPass.Vertices.empty());
nlassert(vegetRdrPass.LightedInstances.empty());
nlassert(vegetRdrPass.TriangleLocalIndices.size()==0);
nlassert(vegetRdrPass.Vertices.size()==0);
nlassert(vegetRdrPass.LightedInstances.size()==0);
}
// Do the same for all quadrants of the zsort rdrPass.
nlassert(ig->_TriangleQuadrantOrderArray.empty());
nlassert(ig->_TriangleQuadrantOrderArray.size()==0);
nlassert(ig->_TriangleQuadrantOrderNumTriangles==0);
@ -2553,7 +2553,7 @@ bool CVegetableManager::updateLightingIGPart()
}
CVegetableInstanceGroup::CVegetableRdrPass &vegetRdrPass= _ULRootIg->_RdrPass[_ULCurrentIgRdrPass];
// if all instances are processed for this pass (especially if empty() !!)
// if all instances are processed for this pass (especially if size()==0 !!)
if(_ULCurrentIgInstance>= vegetRdrPass.LightedInstances.size())
{
// skip to the next rdrPass.

View file

@ -186,7 +186,7 @@ bool CVegetableVBAllocator::exceedMaxVertexInBufferHard(uint numAddVerts) cons
uint CVegetableVBAllocator::allocateVertex()
{
// if no more free, allocate.
if( _VertexFreeMemory.empty() )
if( _VertexFreeMemory.size()==0 )
{
// enlarge capacity.
uint newResize;

View file

@ -500,7 +500,7 @@ void CWaterModel::traverseRender()
sint startY;
projPoly.computeBorders(rasters, startY);
if (!rasters.empty())
if (rasters.size())
{
//===========================//
// perform Water animation //

View file

@ -1126,7 +1126,7 @@ void CZone::refineAll()
{
nlassert(Compiled);
if(Patchs.empty())
if(Patchs.size()==0)
return;
// DO NOT do a forceNoRenderClip(), to avoid big allocation of Near/Far VB vertices in driver.
@ -1150,7 +1150,7 @@ void CZone::averageTesselationVertices()
{
nlassert(Compiled);
if(Patchs.empty())
if(Patchs.size()==0)
return;
// averageTesselationVertices of ALL patchs.
@ -1250,10 +1250,8 @@ void CZone::resetRenderFarAndDeleteVBFV()
void CZone::forceMergeAtTileLevel()
{
CPatch *pPatch=0;
if (!Patchs.empty())
if(Patchs.size()>0)
pPatch= &(*Patchs.begin());
for(sint n=(sint)Patchs.size();n>0;n--, pPatch++)
{
pPatch->forceMergeAtTileLevel();
@ -1448,7 +1446,7 @@ void CZone::applyHeightField(const CLandscape &landScape)
vector<CBezierPatch> patchs;
// no patch, do nothing.
if(Patchs.empty())
if(Patchs.size()==0)
return;
// 0. Unpack patchs to Bezier Patchs.

View file

@ -3113,7 +3113,7 @@ void CZoneLighter::addWaterShape(CWaterShape *shape, const NLMISC::CMatrix &MT)
// ***********************************************************
void CZoneLighter::makeQuadGridFromWaterShapes(NLMISC::CAABBox zoneBBox)
{
if (_WaterShapes.empty()) return;
if (!_WaterShapes.size()) return;
NLMISC::CAABBox tmpBox;

View file

@ -2,40 +2,40 @@ ADD_SUBDIRECTORY(misc)
IF(WITH_3D)
ADD_SUBDIRECTORY(3d)
ENDIF()
ENDIF(WITH_3D)
IF(WITH_GUI)
ADD_SUBDIRECTORY(gui)
ENDIF()
ENDIF(WITH_GUI)
IF(WITH_GEORGES)
ADD_SUBDIRECTORY(georges)
ENDIF()
ENDIF(WITH_GEORGES)
IF(WITH_LIGO)
ADD_SUBDIRECTORY(ligo)
ENDIF()
ENDIF(WITH_LIGO)
IF(WITH_LOGIC)
ADD_SUBDIRECTORY(logic)
ENDIF()
ENDIF(WITH_LOGIC)
IF(WITH_NET)
ADD_SUBDIRECTORY(net)
ENDIF()
ENDIF(WITH_NET)
IF(WITH_SOUND)
ADD_SUBDIRECTORY(sound)
ENDIF()
ENDIF(WITH_SOUND)
IF(WITH_NEL_CEGUI)
ADD_SUBDIRECTORY(cegui)
ENDIF()
ENDIF(WITH_NEL_CEGUI)
IF(WITH_PACS)
ADD_SUBDIRECTORY(pacs)
ENDIF()
ENDIF(WITH_PACS)
IF(WITH_NEL_TOOLS)
ADD_SUBDIRECTORY(pipeline)
ENDIF()
ENDIF(WITH_NEL_TOOLS)

View file

@ -14,4 +14,4 @@ ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} -DNEL_CEGUIRENDERER_EXPORTS)
IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC)
INSTALL(TARGETS nelceguirenderer RUNTIME DESTINATION ${NL_BIN_PREFIX} LIBRARY DESTINATION ${NL_LIB_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} COMPONENT libraries)
ENDIF()
ENDIF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC)

View file

@ -17,10 +17,10 @@ ADD_DEFINITIONS(${LIBXML2_DEFINITIONS})
IF(WITH_PCH)
ADD_NATIVE_PRECOMPILED_HEADER(nelgeorges ${CMAKE_CURRENT_SOURCE_DIR}/stdgeorges.h ${CMAKE_CURRENT_SOURCE_DIR}/stdgeorges.cpp)
ENDIF()
ENDIF(WITH_PCH)
NL_GEN_PC(nel-georges.pc)
IF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC)
INSTALL(TARGETS nelgeorges LIBRARY DESTINATION ${NL_LIB_PREFIX} ARCHIVE DESTINATION ${NL_LIB_PREFIX} COMPONENT libraries)
ENDIF()
ENDIF((WITH_INSTALL_LIBRARIES AND WITH_STATIC) OR NOT WITH_STATIC)

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