diff --git a/.gitignore b/.gitignore
index 357c0503d..6d75a91f5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -160,15 +160,8 @@ code/build/*
code/build-2010/*
build/*
install/*
-build_*
+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
@@ -223,7 +216,6 @@ code/ryzom/server/src/ryzom_admin_service/ryzom_admin_service
code/ryzom/server/src/ryzom_naming_service/ryzom_naming_service
code/ryzom/server/src/ryzom_welcome_service/ryzom_welcome_service
code/ryzom/server/src/tick_service/tick_service
-
# WebTT temp dir
code/ryzom/tools/server/www/webtt/app/tmp
@@ -244,14 +236,13 @@ code/ryzom/tools/server/ryzom_ams/old
-# Tools and external directories
+#tools and external dir's
external
-external_vc14
external_stlport
nel_tools*
ryzom_tools*
-# Dumps
+#Dumps
*.dmp
code/nel/tools/build_gamedata/processes/ai_wmap/ai_build_wmap.cfg
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
deleted file mode 100644
index 9417c1f17..000000000
--- a/.gitlab-ci.yml
+++ /dev/null
@@ -1,1203 +0,0 @@
-# Configuration for Continous Integration
-#
-# Copyright (C) 2017 Khanat
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
-#
-# Example to execute locally:
-# gitlab-runner exec docker --timeout=3600 'Linux client build'
-# gitlab-runner exec docker --timeout=3600 'Linux server debian_amd64_strech build'
-# gitlab-runner exec docker --timeout=3600 'Linux server_static debian_amd64_strech build'
-# gitlab-runner exec docker --timeout=3600 'Linux client debian_amd64_strech build'
-# gitlab-runner exec docker --timeout=3600 'Linux client_static debian_amd64_strech build'
-# gitlab-runner exec docker --kubernetes-memory-limit='10g' --timeout=3600 'Linux client build'
-# gitlab-runner exec docker --kubernetes-memory-limit='10g' --timeout=3600 'Linux client archlinux build'
-# gitlab-runner exec docker --kubernetes-memory-limit='10g' --timeout=3600 'Linux client fedora_amd64_27 build'
-# gitlab-runner exec docker --kubernetes-memory-limit='10g' --timeout=3600 'Linux client ubuntu_amd64_17_10 build'
-# gitlab-runner exec docker --kubernetes-memory-limit='10g' --timeout=3600 'Windows client build'
-
-stages:
-- build
-- test
-#- staging
-#- production
-
-## BUILDS
-
-# Job de compilation pour Linux
-Linux client build:
- stage: build
- except:
- - ryzomcore
- - mac-ci-build
- tags:
- - Docker
- image: debian:jessie
- script:
- # Calcul le nombre de cpu désactivé (on ne laisse que 4 au maximum)
- - disableproc=$(( $(nproc) - 4 ))
- - if [[ $disableproc -le 0 ]] ; then disableproc=0; fi
- - optionproc="-j$(nproc --ignore=$disableproc)"
- - echo "disableproc:$disableproc, nb core compile:$(nproc --ignore=$disableproc) optionproc:$optionproc"
- # Installation des dépendances
- #- echo "deb http://ftp.debian.org/debian/ jessie-backports non-free contrib main" >> /etc/apt/sources.list
- - DEBIAN_FRONTEND=noninteractive apt-get update
- - DEBIAN_FRONTEND=noninteractive apt-get upgrade -y
- - DEBIAN_FRONTEND=noninteractive apt-get 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 libgif-dev patch
- # 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
- # Apply patch
- - (for patchfile in $(cat patch/series); do echo "patch patch/$patchfile"; patch -f -Z -t -p 1 -i patch/$patchfile || exit 2; done)
- # Création de l'environnement de compilation
- - mkdir -p BUILD/x86_64
- - 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
- # 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 $optionproc
- - cd ..
- # Build luabind
- - mkdir -p luabind
- - wget -q http://http.debian.net/debian/pool/main/l/luabind/luabind_0.9.1+dfsg.orig.tar.gz -O luabind.tar.gz
- - wget -q http://http.debian.net/debian/pool/main/l/luabind/luabind_0.9.1+dfsg-11.debian.tar.xz -O luabind-debian.tar.xz
- - tar xvf luabind.tar.gz -C luabind --strip 1 || exit 2
- - tar xvf luabind-debian.tar.xz -C luabind || exit 2
- - cd luabind
- - for file in $(cat debian/patches/series); do patch -p1 < debian/patches/$file; done
- - export -p DEB_HOST_MULTIARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH); bjam -d2 release debug install cflags="-fPIC $(dpkg-buildflags --get CFLAGS)" cxxflags="-fPIC $(dpkg-buildflags --get CXXFLAGS) -Wno-deprecated-declarations" linkflags=" $(dpkg-buildflags --get LDFLAGS)"
- - export -p DEB_HOST_MULTIARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH); bjam -d2 release debug install link=static cflags="-fPIC $(dpkg-buildflags --get CFLAGS)" cxxflags="-fPIC $(dpkg-buildflags --get CXXFLAGS) -Wno-deprecated-declarations" linkflags=" $(dpkg-buildflags --get LDFLAGS)"
- - cd ..
- # Build libogg
- - mkdir -p libogg/build
- - wget -q http://http.debian.net/debian/pool/main/libo/libogg/libogg_1.3.2.orig.tar.gz -O libogg.tar.gz
- - wget -q http://http.debian.net/debian/pool/main/libo/libogg/libogg_1.3.2-1.diff.gz -O libogg.diff.gz
- - tar xvf libogg.tar.gz -C libogg --strip 1 || exit 2
- - gunzip libogg.diff.gz
- - cd libogg
- - patch -p1 < ../libogg.diff
- - cd build
- - ../configure --disable-maintainer-mode --host=$(dpkg-architecture -qDEB_HOST_GNU_TYPE) --build=$(dpkg-architecture -qDEB_BUILD_GNU_TYPE) --libdir=/usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH) --enable-static --prefix=/usr CPPFLAGS="-D_FORTIFY_SOURCE=2" CFLAGS="-Wformat=2 -g -fPIC" CXXFLAGS="-Wformat=2 -g -fPIC" LDFLAGS="-Wl,-z,now"
- - make
- - make install
- - cd ../..
- # Build libvorbis
- - mkdir -p libvorbis
- - wget -q http://security.debian.org/debian-security/pool/updates/main/libv/libvorbis/libvorbis_1.3.5.orig.tar.gz -O libvorbis.tar.gz
- - tar xvf libvorbis.tar.gz -C libvorbis --strip 1 || exit 2
- # Get list package
- - wget -q http://security.debian.org/debian-security/pool/updates/main/libv/libvorbis -O list_libvorbis
- # get last patch for our release
- - line=$(egrep '(libvorbis_1.3.5)(.*)(tar[.]xz)' list_libvorbis | tail -n 1)
- # get only name of the patch
- - tmp=${line#*href} ; tmp2=${tmp%%>*} ; tmp3=${tmp2#*\"} ; namepatch=${tmp3%\"*}
- # download this patch
- - wget -q http://security.debian.org/debian-security/pool/updates/main/libv/libvorbis/$namepatch -O libvorbis.debian.tar.xz
- - tar xvf libvorbis.debian.tar.xz -C libvorbis || exit 2
- - cd libvorbis
- - for file in $(cat debian/patches/series); do patch -p1 < debian/patches/$file; done
- - ./configure --enable-static --with-pic
- - make
- - make install
- - 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
- # Compilation et installation
- - make $optionproc khanat_client_patcher khanat_client
- #- make $optionproc install DESTDIR=../../Linux/x86_64
- - mkdir -p ../../Linux/x86_64
- - cp bin/* ../../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
- 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 server debian_amd64_strech build:
- stage: build
- except:
- - mac-ci-build
- tags:
- - Docker
- image: amd64/debian:9
- script:
- # Prepare environment
- - DEBIAN_FRONTEND=noninteractive apt-get update
- - DEBIAN_FRONTEND=noninteractive apt-get dist-upgrade -y
- - DEBIAN_FRONTEND=noninteractive apt-get install -y mysql-server
- git
- libcurl4-openssl-dev
- libfreetype6-dev
- libx11-dev
- libgl1-mesa-dev
- libxxf86vm-dev
- libxrandr-dev
- libxrender-dev
- libopenal-dev
- libxml2-dev
- cmake
- build-essential
- libpng-dev
- libjpeg62-turbo-dev
- rrdtool
- bison
- libxmu-dev
- autoconf
- automake
- default-libmysqlclient-dev
- libgif-dev
- cpputest
- libssl-dev
- liblzma-dev
- unzip
- zlib1g-dev
- libssh2-1-dev
- libboost-all-dev
- libopenal-dev
- libgl1-mesa-dev
- mercurial
- wget
- autogen
- libtool
- libtool-bin
- fakeroot
- libxml2-dev
- patch
- - apt-get install -y liblua5.2-0 liblua5.2-dev libluabind-dev libluabind0.9.1v5
- # Apply patch
- - (for patchfile in $(cat patch/series); do echo "patch patch/$patchfile"; patch -f -Z -t -p 1 -i patch/$patchfile || exit 2; done)
- # install squish
- - mkdir -p squish
- - (cd squish; wget -c https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/libsquish/squish-1.11.zip)
- - (cd squish; unzip squish-1.11.zip)
- - (cd squish/squish-1.11; patch -i ../../patch/squish-limit.patch)
- - (cd squish/squish-1.11; make)
- - (cd squish/squish-1.11; make install)
- # Action
- - mkdir -p code/build
- - (cd code/build ; cmake -DWITH_LUA52=ON -DWITH_RYZOM_PATCH=ON -DWITH_RYZOM_CUSTOM_PATCH_SERVER=ON -DWITH_NEL_TESTS=OFF -DWITH_RYZOM_CLIENT=OFF -DWITH_DRIVER_OPENGL=OFF -DWITH_DRIVER_OPENAL=OFF -DWITH_NEL_SAMPLES=OFF -DWITH_SOUND=OFF ..)
- - (cd code/build; make ryzom_admin_service ryzom_ai_service ryzom_backup_service ryzom_dynamic_scenario_service ryzom_entities_game_service ryzom_frontend_service ryzom_general_utilities_service ryzom_gpm_service ryzom_ios_service ryzom_log_analyser_service ryzom_logger_service ryzom_mail_forum_service ryzom_mirror_service ryzom_mission_compiler ryzom_monitor_service ryzom_naming_service ryzom_patchman_service ryzom_pd_support_service ryzom_persistant_data_service ryzom_reference_builder_service ryzom_session_browser_service ryzom_shard_unifier_service ryzom_tick_service ryzom_welcome_service sheets_packer bnp_make make_sheet_id patch_gen)
- - (cd code/build/bin; ls -lh)
- artifacts:
- name: "khanat-server-debian_strech-$CI_COMMIT_REF_NAME"
- paths:
- - code/build/bin
- - code/build/lib
- - code/ryzom/server/shard.screen.rc
- - code/web
- - code/ryzom/server/*.cfg
- - code/ryzom/server/data_shard
- - code/ryzom/common/data_common
- - code/ryzom/common/data_leveldesign
- - code/ryzom/client/*.cfg
- - code/ryzom/client/cfg
- - code/ryzom/client/data
- - code/ryzom/client/macosx
- - code/ryzom/client/unix
- - code/ryzom/client/windows
- - code/ryzom/tools/scripts/linux
-# expire_in: 2 week
- when: manual
-
-
-Linux client debian_amd64_strech build:
- stage: build
- except:
- - mac-ci-build
- tags:
- - Docker
- image: amd64/debian:9
- script:
- # Prepare environment
- - DEBIAN_FRONTEND=noninteractive apt-get update
- - DEBIAN_FRONTEND=noninteractive apt-get dist-upgrade -y
- - apt-get install -y autoconf
- autogen
- automake
- bison
- build-essential
- cmake
- cpputest
- fakeroot
- libboost-all-dev
- libfreetype6-dev
- libgif-dev
- libgl1-mesa-dev
- libjpeg62-turbo-dev
- liblzma-dev
- libopenal-dev
- libpng-dev
- libssh2-1-dev
- libssl-dev
- libtool
- libtool-bin
- libx11-dev
- libxml2-dev
- libxmu-dev
- libxrandr-dev
- libxrender-dev
- libxxf86vm-dev
- mercurial
- rrdtool
- unzip
- wget
- zlib1g-dev
- patch
- - apt-get install -y liblua5.2-0 liblua5.2-dev libluabind-dev libluabind0.9.1v5 libogg-dev libvorbis-dev
- # Apply patch
- - (for patchfile in $(cat patch/series); do echo "patch patch/$patchfile"; patch -f -Z -t -p 1 -i patch/$patchfile || exit 2; done)
- # Build Curl
- - wget -q https://curl.haxx.se/download/curl-7.58.0.tar.gz -O curl.tar.gz
- - mkdir -p curl/build
- - tar xvf curl.tar.gz -C curl --strip 1
- - (cd curl/build; cmake -DCMAKE_BUILD_TYPE=Release -DCURL_ZLIB=ON -DBUILD_CURL_EXE=OFF -DCURL_STATICLIB=ON -DHTTP_ONLY=ON -DENABLE_IPV6=ON -DCMAKE_USE_OPENSSL=ON -DOPENSSL_SSL_LIBRARIES=/usr/lib/x86_64-linux-gnu/libssl.a -DOPENSSL_CRYPTO_LIBRARIES=/usr/lib/x86_64-linux-gnu/libcrypto.a -DCMAKE_USE_LIBSSH2=OFF -DZLIB_LIBRARY=/usr/lib/x86_64-linux-gnu/libz.a -DCMAKE_C_FLAGS='-fPIC' ..)
- - (cd curl/build; make)
- - (cd curl/build; make install)
- # Action
- - mkdir -p code/build
- - (cd code/build ; cmake -DWITH_NEL=ON -DWITH_LUA52=ON -DWITH_RYZOM_PATCH=OFF -DWITH_RYZOM_CUSTOM_PATCH_SERVER=OFF -DWITH_NEL_TESTS=OFF -DWITH_RYZOM_CLIENT=ON -DWITH_DRIVER_OPENGL=ON -DWITH_DRIVER_OPENAL=ON -DWITH_NEL_SAMPLES=OFF -DWITH_SOUND=ON -DWITH_STATIC_CURL=ON ..)
- - (cd code/build; make khanat_client)
- - (cd code/build/bin; ls -lh)
- artifacts:
- name: "khanat-client-debian_strech-$(echo $CI_BUILD_REF | head -c 7 )-$CI_PIPELINE_ID"
- paths:
- - code/build/bin
-# expire_in: 2 week
- when: manual
-
-
-Linux client_static debian_amd64_strech build:
- stage: build
- except:
- - mac-ci-build
- tags:
- - Docker
- image: amd64/debian:9
- script:
- # Prepare environment
- - DEBIAN_FRONTEND=noninteractive apt-get update
- - DEBIAN_FRONTEND=noninteractive apt-get dist-upgrade -y
- - apt-get install -y
- autoconf
- autogen
- automake
- bison
- build-essential
- cmake
- cpputest
- fakeroot
- libboost-all-dev
- libfreetype6-dev
- libgif-dev
- libgl1-mesa-dev
- libjpeg62-turbo-dev
- liblzma-dev
- libopenal-dev
- libpng-dev
- libssh2-1-dev
- libssl-dev
- libtool
- libtool-bin
- libx11-dev
- libxml2-dev
- libxmu-dev
- libxrandr-dev
- libxrender-dev
- libxxf86vm-dev
- mercurial
- rrdtool
- unzip
- wget
- zlib1g-dev
- patch
- - apt-get install -y liblua5.2-0 liblua5.2-dev
- # Apply patch
- - (for patchfile in $(cat patch/series); do echo "patch patch/$patchfile"; patch -f -Z -t -p 1 -i patch/$patchfile || exit 2; done)
- # Build Curl
- - wget -q https://curl.haxx.se/download/curl-7.58.0.tar.gz -O curl.tar.gz
- - mkdir -p curl/build
- - tar xvf curl.tar.gz -C curl --strip 1
- - (cd curl/build; cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_CURL_TESTS=OFF -DCURL_ZLIB=ON -DBUILD_CURL_EXE=OFF -DCURL_STATICLIB=ON -DHTTP_ONLY=ON -DENABLE_IPV6=ON -DCMAKE_USE_OPENSSL=ON -DOPENSSL_SSL_LIBRARIES=/usr/lib/x86_64-linux-gnu/libssl.a -DOPENSSL_CRYPTO_LIBRARIES=/usr/lib/x86_64-linux-gnu/libcrypto.a -DCMAKE_USE_LIBSSH2=OFF -DZLIB_LIBRARY=/usr/lib/x86_64-linux-gnu/libz.a -DCMAKE_C_FLAGS='-fPIC' ..)
- - (cd curl/build; make)
- - (cd curl/build; make install)
- # Build luabind
- - mkdir -p luabind
- - wget -q http://http.debian.net/debian/pool/main/l/luabind/luabind_0.9.1+dfsg.orig.tar.gz -O luabind.tar.gz
- - wget -q http://http.debian.net/debian/pool/main/l/luabind/luabind_0.9.1+dfsg-11.debian.tar.xz -O luabind-debian.tar.xz
- - ls
- - tar xvf luabind.tar.gz -C luabind --strip 1 || exit 2
- - tar xvf luabind-debian.tar.xz -C luabind || exit 2
- - cd luabind
- - for file in $(cat debian/patches/series); do patch -p1 < debian/patches/$file; done
- - export -p DEB_HOST_MULTIARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH); bjam -d2 release debug install cflags="-fPIC $(dpkg-buildflags --get CFLAGS)" cxxflags="-fPIC $(dpkg-buildflags --get CXXFLAGS) -Wno-deprecated-declarations" linkflags=" $(dpkg-buildflags --get LDFLAGS)"
- - export -p DEB_HOST_MULTIARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH); bjam -d2 release debug install link=static cflags="-fPIC $(dpkg-buildflags --get CFLAGS)" cxxflags="-fPIC $(dpkg-buildflags --get CXXFLAGS) -Wno-deprecated-declarations" linkflags=" $(dpkg-buildflags --get LDFLAGS)"
- - cd ..
- # Build libogg
- - mkdir -p libogg/build
- - wget -q http://http.debian.net/debian/pool/main/libo/libogg/libogg_1.3.2.orig.tar.gz -O libogg.tar.gz
- - wget -q http://http.debian.net/debian/pool/main/libo/libogg/libogg_1.3.2-1.diff.gz -O libogg.diff.gz
- - tar xvf libogg.tar.gz -C libogg --strip 1 || exit 2
- - gunzip libogg.diff.gz
- - cd libogg
- - patch -p1 < ../libogg.diff
- - cd build
- - ../configure --disable-maintainer-mode --host=$(dpkg-architecture -qDEB_HOST_GNU_TYPE) --build=$(dpkg-architecture -qDEB_BUILD_GNU_TYPE) --libdir=/usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH) --enable-static --prefix=/usr CPPFLAGS="-D_FORTIFY_SOURCE=2" CFLAGS="-Wformat=2 -g -fPIC" CXXFLAGS="-Wformat=2 -g -fPIC" LDFLAGS="-Wl,-z,now"
- - make
- - make install
- - cd ../..
- # Build libvorbis
- - mkdir -p libvorbis
- - wget -q http://security.debian.org/debian-security/pool/updates/main/libv/libvorbis/libvorbis_1.3.5.orig.tar.gz -O libvorbis.tar.gz
- - tar xvf libvorbis.tar.gz -C libvorbis --strip 1 || exit 2
- # Get list package
- - wget -q http://security.debian.org/debian-security/pool/updates/main/libv/libvorbis -O list_libvorbis
- # get last patch for our release
- - line=$(egrep '(libvorbis_1.3.5)(.*)(tar[.]xz)' list_libvorbis | tail -n 1)
- # get only name of the patch
- - tmp=${line#*href} ; tmp2=${tmp%%>*} ; tmp3=${tmp2#*\"} ; namepatch=${tmp3%\"*}
- # download this patch
- - wget -q http://security.debian.org/debian-security/pool/updates/main/libv/libvorbis/$namepatch -O libvorbis.debian.tar.xz
- - tar xvf libvorbis.debian.tar.xz -C libvorbis || exit 2
- - cd libvorbis
- - for file in $(cat debian/patches/series); do patch -p1 < debian/patches/$file; done
- - ./configure --enable-static --with-pic
- - make
- - make install
- - cd ..
- # Action
- - mkdir -p code/build
- - (cd code/build ; cmake -DWITH_NEL=ON -DWITH_STATIC=ON -DWITH_STATIC_DRIVERS=ON -DWITH_STATIC_EXTERNAL=ON -DWITH_LUA52=ON -DWITH_RYZOM_PATCH=ON -DWITH_RYZOM_CUSTOM_PATCH_SERVER=ON -DWITH_NEL_TESTS=OFF -DWITH_RYZOM_CLIENT=ON -DWITH_DRIVER_OPENGL=ON -DWITH_DRIVER_OPENAL=ON -DWITH_NEL_SAMPLES=ON -DWITH_SOUND=ON -DWITH_STATIC_CURL=ON ..)
- - (cd code/build; make khanat_client)
- - (cd code/build/bin; ls -lh)
- artifacts:
- name: "khanat-client_static-debian_amd64_strech-$CI_COMMIT_REF_NAME"
- paths:
- - code/build/bin
-# expire_in: 2 week
-
-
-Linux client_static_debug debian_amd64_strech build:
- stage: build
- except:
- - mac-ci-build
- tags:
- - Docker
- image: amd64/debian:9
- script:
- # Prepare environment
- - DEBIAN_FRONTEND=noninteractive apt-get update
- - DEBIAN_FRONTEND=noninteractive apt-get dist-upgrade -y
- - apt-get install -y
- autoconf
- autogen
- automake
- bison
- build-essential
- cmake
- cpputest
- fakeroot
- libboost-all-dev
- libfreetype6-dev
- libgif-dev
- libgl1-mesa-dev
- libjpeg62-turbo-dev
- liblzma-dev
- libopenal-dev
- libpng-dev
- libssh2-1-dev
- libssl-dev
- libtool
- libtool-bin
- libx11-dev
- libxml2-dev
- libxmu-dev
- libxrandr-dev
- libxrender-dev
- libxxf86vm-dev
- mercurial
- rrdtool
- unzip
- wget
- zlib1g-dev
- patch
- - apt-get install -y liblua5.2-0 liblua5.2-dev
- # Apply patch
- - (for patchfile in $(cat patch/series); do echo "patch patch/$patchfile"; patch -f -Z -t -p 1 -i patch/$patchfile || exit 2; done)
- # Build Curl
- - wget -q https://curl.haxx.se/download/curl-7.58.0.tar.gz -O curl.tar.gz
- - mkdir -p curl/build
- - tar xvf curl.tar.gz -C curl --strip 1
- - (cd curl/build; cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_CURL_TESTS=OFF -DCURL_ZLIB=ON -DBUILD_CURL_EXE=OFF -DCURL_STATICLIB=ON -DHTTP_ONLY=ON -DENABLE_IPV6=ON -DCMAKE_USE_OPENSSL=ON -DOPENSSL_SSL_LIBRARIES=/usr/lib/x86_64-linux-gnu/libssl.a -DOPENSSL_CRYPTO_LIBRARIES=/usr/lib/x86_64-linux-gnu/libcrypto.a -DCMAKE_USE_LIBSSH2=OFF -DZLIB_LIBRARY=/usr/lib/x86_64-linux-gnu/libz.a -DCMAKE_C_FLAGS='-fPIC' ..)
- - (cd curl/build; make)
- - (cd curl/build; make install)
- # Build luabind
- - mkdir -p luabind
- - wget -q http://http.debian.net/debian/pool/main/l/luabind/luabind_0.9.1+dfsg.orig.tar.gz -O luabind.tar.gz
- - wget -q http://http.debian.net/debian/pool/main/l/luabind/luabind_0.9.1+dfsg-11.debian.tar.xz -O luabind-debian.tar.xz
- - tar xvf luabind.tar.gz -C luabind --strip 1 || exit 2
- - tar xvf luabind-debian.tar.xz -C luabind || exit 2
- - cd luabind
- - for file in $(cat debian/patches/series); do patch -p1 < debian/patches/$file; done
- - export -p DEB_HOST_MULTIARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH); bjam -d2 release debug install cflags="-fPIC $(dpkg-buildflags --get CFLAGS)" cxxflags="-fPIC $(dpkg-buildflags --get CXXFLAGS) -Wno-deprecated-declarations" linkflags=" $(dpkg-buildflags --get LDFLAGS)"
- - export -p DEB_HOST_MULTIARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH); bjam -d2 release debug install link=static cflags="-fPIC $(dpkg-buildflags --get CFLAGS)" cxxflags="-fPIC $(dpkg-buildflags --get CXXFLAGS) -Wno-deprecated-declarations" linkflags=" $(dpkg-buildflags --get LDFLAGS)"
- - cd ..
- # Build libogg
- - mkdir -p libogg/build
- - wget -q http://http.debian.net/debian/pool/main/libo/libogg/libogg_1.3.2.orig.tar.gz -O libogg.tar.gz
- - wget -q http://http.debian.net/debian/pool/main/libo/libogg/libogg_1.3.2-1.diff.gz -O libogg.diff.gz
- - tar xvf libogg.tar.gz -C libogg --strip 1 || exit 2
- - gunzip libogg.diff.gz
- - cd libogg
- - patch -p1 < ../libogg.diff
- - cd build
- - ../configure --disable-maintainer-mode --host=$(dpkg-architecture -qDEB_HOST_GNU_TYPE) --build=$(dpkg-architecture -qDEB_BUILD_GNU_TYPE) --libdir=/usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH) --enable-static --prefix=/usr CPPFLAGS="-D_FORTIFY_SOURCE=2" CFLAGS="-Wformat=2 -g -fPIC" CXXFLAGS="-Wformat=2 -g -fPIC" LDFLAGS="-Wl,-z,now"
- - make
- - make install
- - cd ../..
- # Build libvorbis
- - mkdir -p libvorbis
- - wget -q http://security.debian.org/debian-security/pool/updates/main/libv/libvorbis/libvorbis_1.3.5.orig.tar.gz -O libvorbis.tar.gz
- - tar xvf libvorbis.tar.gz -C libvorbis --strip 1 || exit 2
- # Get list package
- - wget -q http://security.debian.org/debian-security/pool/updates/main/libv/libvorbis -O list_libvorbis
- # get last patch for our release
- - line=$(egrep '(libvorbis_1.3.5)(.*)(tar[.]xz)' list_libvorbis | tail -n 1)
- # get only name of the patch
- - tmp=${line#*href} ; tmp2=${tmp%%>*} ; tmp3=${tmp2#*\"} ; namepatch=${tmp3%\"*}
- # download this patch
- - wget -q http://security.debian.org/debian-security/pool/updates/main/libv/libvorbis/$namepatch -O libvorbis.debian.tar.xz
- - tar xvf libvorbis.debian.tar.xz -C libvorbis || exit 2
- - cd libvorbis
- - for file in $(cat debian/patches/series); do patch -p1 < debian/patches/$file; done
- - ./configure --enable-static --with-pic
- - make
- - make install
- - cd ..
- # Action
- - mkdir -p code/build
- - (cd code/build ; cmake -DWITH_NEL=ON -DWITH_STATIC=ON -DWITH_STATIC_DRIVERS=ON -DWITH_STATIC_EXTERNAL=ON -DWITH_LUA52=ON -DWITH_RYZOM_PATCH=ON -DWITH_RYZOM_CUSTOM_PATCH_SERVER=ON -DWITH_NEL_TESTS=OFF -DWITH_RYZOM_CLIENT=ON -DWITH_DRIVER_OPENGL=ON -DWITH_DRIVER_OPENAL=ON -DWITH_NEL_SAMPLES=ON -DWITH_SOUND=ON -DWITH_STATIC_CURL=ON -DWITH_SYMBOLS=ON ..)
- - (cd code/build; make khanat_client)
- - (cd code/build/bin; ls -lh)
- artifacts:
- name: "khanat-client_static_debug-debian_amd64_strech-$CI_COMMIT_REF_NAME"
- paths:
- - code/build/bin
-# expire_in: 2 week
-
-
-Linux server_static debian_amd64_strech build:
- stage: build
- except:
- - mac-ci-build
- tags:
- - Docker
- image: amd64/debian:9
- script:
- # Prepare environment
- - DEBIAN_FRONTEND=noninteractive apt-get update
- - DEBIAN_FRONTEND=noninteractive apt-get dist-upgrade -y
- - DEBIAN_FRONTEND=noninteractive apt-get install -y apache2 apache2-utils autoconf autogen automake bison build-essential cmake cpputest default-libmysqlclient-dev fakeroot git libapache2-mod-php libboost-all-dev libfreetype6-dev libgif-dev libgl1-mesa-dev libjpeg62-turbo-dev liblua5.2-0 liblua5.2-dev liblzma-dev libogg-dev libopenal-dev libpng-dev libssh2-1-dev libssl-dev libtool libtool-bin libvorbis-dev libx11-dev libxml2-dev libxmu-dev libxrandr-dev libxrender-dev libxxf86vm-dev mercurial mysql-server php php-gd php-imagick php-mysql python3 python3-pip python3-bcrypt python3-venv rrdtool unzip wget zlib1g-dev
- # Apply patch
- - (for patchfile in $(cat patch/series); do echo "patch patch/$patchfile"; patch -f -Z -t -p 1 -i patch/$patchfile || exit 2; done)
- # Build Curl
- - wget -q https://curl.haxx.se/download/curl-7.58.0.tar.gz -O curl.tar.gz
- - mkdir -p curl/build
- - tar xvf curl.tar.gz -C curl --strip 1
- - (cd curl/build; cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_CURL_TESTS=OFF -DCURL_ZLIB=ON -DBUILD_CURL_EXE=OFF -DCURL_STATICLIB=ON -DHTTP_ONLY=ON -DENABLE_IPV6=ON -DCMAKE_USE_OPENSSL=ON -DOPENSSL_SSL_LIBRARIES=/usr/lib/x86_64-linux-gnu/libssl.a -DOPENSSL_CRYPTO_LIBRARIES=/usr/lib/x86_64-linux-gnu/libcrypto.a -DCMAKE_USE_LIBSSH2=OFF -DZLIB_LIBRARY=/usr/lib/x86_64-linux-gnu/libz.a -DCMAKE_C_FLAGS='-fPIC' ..)
- - (cd curl/build; make)
- - (cd curl/build; make install)
- # Build luabind
- - mkdir -p luabind
- - wget -q http://http.debian.net/debian/pool/main/l/luabind/luabind_0.9.1+dfsg.orig.tar.gz -O luabind.tar.gz
- - wget -q http://http.debian.net/debian/pool/main/l/luabind/luabind_0.9.1+dfsg-11.debian.tar.xz -O luabind-debian.tar.xz
- - tar xvf luabind.tar.gz -C luabind --strip 1 || exit 2
- - tar xvf luabind-debian.tar.xz -C luabind || exit 2
- - cd luabind
- - for file in $(cat debian/patches/series); do patch -p1 < debian/patches/$file; done
- - export -p DEB_HOST_MULTIARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH); bjam -d2 release debug install cflags="-fPIC $(dpkg-buildflags --get CFLAGS)" cxxflags="-fPIC $(dpkg-buildflags --get CXXFLAGS) -Wno-deprecated-declarations" linkflags=" $(dpkg-buildflags --get LDFLAGS)"
- - export -p DEB_HOST_MULTIARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH); bjam -d2 release debug install link=static cflags="-fPIC $(dpkg-buildflags --get CFLAGS)" cxxflags="-fPIC $(dpkg-buildflags --get CXXFLAGS) -Wno-deprecated-declarations" linkflags=" $(dpkg-buildflags --get LDFLAGS)"
- - cd ..
- # Build libogg
- - mkdir -p libogg/build
- - wget -q http://http.debian.net/debian/pool/main/libo/libogg/libogg_1.3.2.orig.tar.gz -O libogg.tar.gz
- - wget -q http://http.debian.net/debian/pool/main/libo/libogg/libogg_1.3.2-1.diff.gz -O libogg.diff.gz
- - tar xvf libogg.tar.gz -C libogg --strip 1 || exit 2
- - gunzip libogg.diff.gz
- - cd libogg
- - patch -p1 < ../libogg.diff
- - cd build
- - ../configure --disable-maintainer-mode --host=$(dpkg-architecture -qDEB_HOST_GNU_TYPE) --build=$(dpkg-architecture -qDEB_BUILD_GNU_TYPE) --libdir=/usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH) --enable-static --prefix=/usr CPPFLAGS="-D_FORTIFY_SOURCE=2" CFLAGS="-Wformat=2 -g -fPIC" CXXFLAGS="-Wformat=2 -g -fPIC" LDFLAGS="-Wl,-z,now"
- - make
- - make install
- - cd ../..
- # Build libvorbis
- - mkdir -p libvorbis
- - wget -q http://security.debian.org/debian-security/pool/updates/main/libv/libvorbis/libvorbis_1.3.5.orig.tar.gz -O libvorbis.tar.gz
- - tar xvf libvorbis.tar.gz -C libvorbis --strip 1 || exit 2
- # Get list package
- - wget -q http://security.debian.org/debian-security/pool/updates/main/libv/libvorbis -O list_libvorbis
- # get last patch for our release
- - line=$(egrep '(libvorbis_1.3.5)(.*)(tar[.]xz)' list_libvorbis | tail -n 1)
- # get only name of the patch
- - tmp=${line#*href} ; tmp2=${tmp%%>*} ; tmp3=${tmp2#*\"} ; namepatch=${tmp3%\"*}
- # download this patch
- - wget -q http://security.debian.org/debian-security/pool/updates/main/libv/libvorbis/$namepatch -O libvorbis.debian.tar.xz
- - tar xvf libvorbis.debian.tar.xz -C libvorbis || exit 2
- - cd libvorbis
- - for file in $(cat debian/patches/series); do patch -p1 < debian/patches/$file; done
- - ./configure --enable-static --with-pic
- - make
- - make install
- - cd ..
- # Action
- - mkdir -p code/build
- - (cd code/build ; cmake -DWITH_NEL=ON -DWITH_STATIC=ON -DWITH_STATIC_DRIVERS=ON -DWITH_STATIC_EXTERNAL=ON -DWITH_LUA52=ON -DWITH_RYZOM_PATCH=ON -DWITH_RYZOM_CUSTOM_PATCH_SERVER=ON -DWITH_NEL_TESTS=OFF ..)
- - ls -l code
- - ls -l code/build
- - (cd code/build; make ryzom_admin_service ryzom_ai_service ryzom_backup_service ryzom_dynamic_scenario_service ryzom_entities_game_service ryzom_frontend_service ryzom_general_utilities_service ryzom_gpm_service ryzom_ios_service ryzom_log_analyser_service ryzom_logger_service ryzom_mail_forum_service ryzom_mirror_service ryzom_mission_compiler ryzom_monitor_service ryzom_naming_service ryzom_patchman_service ryzom_pd_support_service ryzom_persistant_data_service ryzom_reference_builder_service ryzom_session_browser_service ryzom_shard_unifier_service ryzom_tick_service ryzom_welcome_service sheets_packer bnp_make make_sheet_id patch_gen)
- - (cd code/build/bin; ls -lh)
- artifacts:
- name: "khanat-server_static-debian_amd64_strech-$CI_COMMIT_REF_NAME"
- paths:
- - code/build/bin
- - code/ryzom/server/shard.screen.rc
- - code/web
- - code/ryzom/server/*.cfg
- - code/ryzom/server/data_shard
- - code/ryzom/common/data_common
- - code/ryzom/common/data_leveldesign
- - code/ryzom/client/*.cfg
- - code/ryzom/client/cfg
- - code/ryzom/client/data
- - code/ryzom/client/macosx
- - code/ryzom/client/unix
- - code/ryzom/client/windows
- - code/ryzom/tools/scripts/linux
-# expire_in: 2 week
-
-
-Linux server_static_debug debian_amd64_strech build:
- stage: build
- except:
- - mac-ci-build
- tags:
- - Docker
- image: amd64/debian:9
- script:
- # Prepare environment
- - DEBIAN_FRONTEND=noninteractive apt-get update
- - DEBIAN_FRONTEND=noninteractive apt-get dist-upgrade -y
- - DEBIAN_FRONTEND=noninteractive apt-get install -y apache2 apache2-utils autoconf autogen automake bison build-essential cmake cpputest default-libmysqlclient-dev fakeroot git libapache2-mod-php libboost-all-dev libfreetype6-dev libgif-dev libgl1-mesa-dev libjpeg62-turbo-dev liblua5.2-0 liblua5.2-dev liblzma-dev libogg-dev libopenal-dev libpng-dev libssh2-1-dev libssl-dev libtool libtool-bin libvorbis-dev libx11-dev libxml2-dev libxmu-dev libxrandr-dev libxrender-dev libxxf86vm-dev mercurial mysql-server php php-gd php-imagick php-mysql python3 python3-pip python3-bcrypt python3-venv rrdtool unzip wget zlib1g-dev
- # Apply patch
- - (for patchfile in $(cat patch/series); do echo "patch patch/$patchfile"; patch -f -Z -t -p 1 -i patch/$patchfile || exit 2; done)
- # Build Curl
- - wget -q https://curl.haxx.se/download/curl-7.58.0.tar.gz -O curl.tar.gz
- - mkdir -p curl/build
- - tar xvf curl.tar.gz -C curl --strip 1
- - (cd curl/build; cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_CURL_TESTS=OFF -DCURL_ZLIB=ON -DBUILD_CURL_EXE=OFF -DCURL_STATICLIB=ON -DHTTP_ONLY=ON -DENABLE_IPV6=ON -DCMAKE_USE_OPENSSL=ON -DOPENSSL_SSL_LIBRARIES=/usr/lib/x86_64-linux-gnu/libssl.a -DOPENSSL_CRYPTO_LIBRARIES=/usr/lib/x86_64-linux-gnu/libcrypto.a -DCMAKE_USE_LIBSSH2=OFF -DZLIB_LIBRARY=/usr/lib/x86_64-linux-gnu/libz.a -DCMAKE_C_FLAGS='-fPIC' ..)
- - (cd curl/build; make)
- - (cd curl/build; make install)
- # Build luabind
- - mkdir -p luabind
- - wget -q http://http.debian.net/debian/pool/main/l/luabind/luabind_0.9.1+dfsg.orig.tar.gz -O luabind.tar.gz
- - wget -q http://http.debian.net/debian/pool/main/l/luabind/luabind_0.9.1+dfsg-11.debian.tar.xz -O luabind-debian.tar.xz
- - tar xvf luabind.tar.gz -C luabind --strip 1 || exit 2
- - tar xvf luabind-debian.tar.xz -C luabind || exit 2
- - cd luabind
- - for file in $(cat debian/patches/series); do patch -p1 < debian/patches/$file; done
- - export -p DEB_HOST_MULTIARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH); bjam -d2 release debug install cflags="-fPIC $(dpkg-buildflags --get CFLAGS)" cxxflags="-fPIC $(dpkg-buildflags --get CXXFLAGS) -Wno-deprecated-declarations" linkflags=" $(dpkg-buildflags --get LDFLAGS)"
- - export -p DEB_HOST_MULTIARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH); bjam -d2 release debug install link=static cflags="-fPIC $(dpkg-buildflags --get CFLAGS)" cxxflags="-fPIC $(dpkg-buildflags --get CXXFLAGS) -Wno-deprecated-declarations" linkflags=" $(dpkg-buildflags --get LDFLAGS)"
- - cd ..
- # Build libogg
- - mkdir -p libogg/build
- - wget -q http://http.debian.net/debian/pool/main/libo/libogg/libogg_1.3.2.orig.tar.gz -O libogg.tar.gz
- - wget -q http://http.debian.net/debian/pool/main/libo/libogg/libogg_1.3.2-1.diff.gz -O libogg.diff.gz
- - tar xvf libogg.tar.gz -C libogg --strip 1 || exit 2
- - gunzip libogg.diff.gz
- - cd libogg
- - patch -p1 < ../libogg.diff
- - cd build
- - ../configure --disable-maintainer-mode --host=$(dpkg-architecture -qDEB_HOST_GNU_TYPE) --build=$(dpkg-architecture -qDEB_BUILD_GNU_TYPE) --libdir=/usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH) --enable-static --prefix=/usr CPPFLAGS="-D_FORTIFY_SOURCE=2" CFLAGS="-Wformat=2 -g -fPIC" CXXFLAGS="-Wformat=2 -g -fPIC" LDFLAGS="-Wl,-z,now"
- - make
- - make install
- - cd ../..
- # Build libvorbis
- - mkdir -p libvorbis
- - wget -q http://security.debian.org/debian-security/pool/updates/main/libv/libvorbis/libvorbis_1.3.5.orig.tar.gz -O libvorbis.tar.gz
- - tar xvf libvorbis.tar.gz -C libvorbis --strip 1 || exit 2
- # Get list package
- - wget -q http://security.debian.org/debian-security/pool/updates/main/libv/libvorbis -O list_libvorbis
- # get last patch for our release
- - line=$(egrep '(libvorbis_1.3.5)(.*)(tar[.]xz)' list_libvorbis | tail -n 1)
- # get only name of the patch
- - tmp=${line#*href} ; tmp2=${tmp%%>*} ; tmp3=${tmp2#*\"} ; namepatch=${tmp3%\"*}
- # download this patch
- - wget -q http://security.debian.org/debian-security/pool/updates/main/libv/libvorbis/$namepatch -O libvorbis.debian.tar.xz
- - tar xvf libvorbis.debian.tar.xz -C libvorbis || exit 2
- - cd libvorbis
- - for file in $(cat debian/patches/series); do patch -p1 < debian/patches/$file; done
- - ./configure --enable-static --with-pic
- - make
- - make install
- - cd ..
- # Action
- - mkdir -p code/build
- - (cd code/build ; cmake -DWITH_NEL=ON -DWITH_STATIC=ON -DWITH_STATIC_DRIVERS=ON -DWITH_STATIC_EXTERNAL=ON -DWITH_LUA52=ON -DWITH_RYZOM_PATCH=ON -DWITH_RYZOM_CUSTOM_PATCH_SERVER=ON -DWITH_NEL_TESTS=OFF -DWITH_SYMBOLS=ON ..)
- - ls -l code
- - ls -l code/build
- - (cd code/build; make ryzom_admin_service ryzom_ai_service ryzom_backup_service ryzom_dynamic_scenario_service ryzom_entities_game_service ryzom_frontend_service ryzom_general_utilities_service ryzom_gpm_service ryzom_ios_service ryzom_log_analyser_service ryzom_logger_service ryzom_mail_forum_service ryzom_mirror_service ryzom_mission_compiler ryzom_monitor_service ryzom_naming_service ryzom_patchman_service ryzom_pd_support_service ryzom_persistant_data_service ryzom_reference_builder_service ryzom_session_browser_service ryzom_shard_unifier_service ryzom_tick_service ryzom_welcome_service sheets_packer bnp_make make_sheet_id patch_gen)
- - (cd code/build/bin; ls -lh)
- artifacts:
- name: "khanat-server_static_debug-debian_amd64_strech-$CI_COMMIT_REF_NAME"
- paths:
- - code/build/bin
- - code/ryzom/server/shard.screen.rc
- - code/web
- - code/ryzom/server/*.cfg
- - code/ryzom/server/data_shard
- - code/ryzom/common/data_common
- - code/ryzom/common/data_leveldesign
- - code/ryzom/client/*.cfg
- - code/ryzom/client/cfg
- - code/ryzom/client/data
- - code/ryzom/client/macosx
- - code/ryzom/client/unix
- - code/ryzom/client/windows
- - code/ryzom/tools/scripts/linux
-# expire_in: 2 week
-
-
-Linux client_static debian_i386_strech build:
- stage: build
- except:
- - mac-ci-build
- tags:
- - Docker
- image: i386/debian:9
- script:
- # Prepare environment
- - DEBIAN_FRONTEND=noninteractive apt-get update
- - DEBIAN_FRONTEND=noninteractive apt-get dist-upgrade -y
- - apt-get install -y autoconf autogen automake bison build-essential cmake cpputest fakeroot libboost-all-dev libfreetype6-dev libgif-dev libgl1-mesa-dev libjpeg62-turbo-dev liblzma-dev libopenal-dev libpng-dev libssh2-1-dev libssl-dev libtool libtool-bin libx11-dev libxml2-dev libxmu-dev libxrandr-dev libxrender-dev libxxf86vm-dev mercurial rrdtool unzip wget zlib1g-dev patch
- - apt-get install -y liblua5.2-0 liblua5.2-dev
- # Apply patch
- - (for patchfile in $(cat patch/series); do echo "patch patch/$patchfile"; patch -f -Z -t -p 1 -i patch/$patchfile || exit 2; done)
- # Build Curl
- - wget -q https://curl.haxx.se/download/curl-7.58.0.tar.gz -O curl.tar.gz
- - mkdir -p curl/build
- - tar xvf curl.tar.gz -C curl --strip 1
- - (cd curl/build; cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_CURL_TESTS=OFF -DCURL_ZLIB=ON -DBUILD_CURL_EXE=OFF -DCURL_STATICLIB=ON -DHTTP_ONLY=ON -DENABLE_IPV6=ON -DCMAKE_USE_OPENSSL=ON -DOPENSSL_SSL_LIBRARIES=/usr/lib/i386-linux-gnu/libssl.a -DOPENSSL_CRYPTO_LIBRARIES=/usr/lib/i386-linux-gnu/libcrypto.a -DCMAKE_USE_LIBSSH2=OFF -DZLIB_LIBRARY=/usr/lib/i386-linux-gnu/libz.a -DCMAKE_C_FLAGS='-fPIC' ..)
- - (cd curl/build; make)
- - (cd curl/build; make install)
- # Build luabind
- - mkdir -p luabind
- - wget -q http://http.debian.net/debian/pool/main/l/luabind/luabind_0.9.1+dfsg.orig.tar.gz -O luabind.tar.gz
- - wget -q http://http.debian.net/debian/pool/main/l/luabind/luabind_0.9.1+dfsg-11.debian.tar.xz -O luabind-debian.tar.xz
- - tar xvf luabind.tar.gz -C luabind --strip 1 || exit 2
- - tar xvf luabind-debian.tar.xz -C luabind || exit 2
- - cd luabind
- - for file in $(cat debian/patches/series); do patch -p1 < debian/patches/$file; done
- - export -p DEB_HOST_MULTIARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH); bjam -d2 release debug install cflags="-fPIC $(dpkg-buildflags --get CFLAGS)" cxxflags="-fPIC $(dpkg-buildflags --get CXXFLAGS) -Wno-deprecated-declarations" linkflags=" $(dpkg-buildflags --get LDFLAGS)"
- - export -p DEB_HOST_MULTIARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH); bjam -d2 release debug install link=static cflags="-fPIC $(dpkg-buildflags --get CFLAGS)" cxxflags="-fPIC $(dpkg-buildflags --get CXXFLAGS) -Wno-deprecated-declarations" linkflags=" $(dpkg-buildflags --get LDFLAGS)"
- - cd ..
- # Build libogg
- - mkdir -p libogg/build
- - wget -q http://http.debian.net/debian/pool/main/libo/libogg/libogg_1.3.2.orig.tar.gz -O libogg.tar.gz
- - wget -q http://http.debian.net/debian/pool/main/libo/libogg/libogg_1.3.2-1.diff.gz -O libogg.diff.gz
- - tar xvf libogg.tar.gz -C libogg --strip 1 || exit 2
- - gunzip libogg.diff.gz
- - cd libogg
- - patch -p1 < ../libogg.diff
- - cd build
- - ../configure --disable-maintainer-mode --host=$(dpkg-architecture -qDEB_HOST_GNU_TYPE) --build=$(dpkg-architecture -qDEB_BUILD_GNU_TYPE) --libdir=/usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH) --enable-static --prefix=/usr CPPFLAGS="-D_FORTIFY_SOURCE=2" CFLAGS="-Wformat=2 -g -fPIC" CXXFLAGS="-Wformat=2 -g -fPIC" LDFLAGS="-Wl,-z,now"
- - make
- - make install
- - cd ../..
- # Build libvorbis
- - mkdir -p libvorbis
- - wget -q http://security.debian.org/debian-security/pool/updates/main/libv/libvorbis/libvorbis_1.3.5.orig.tar.gz -O libvorbis.tar.gz
- - tar xvf libvorbis.tar.gz -C libvorbis --strip 1 || exit 2
- # Get list package
- - wget -q http://security.debian.org/debian-security/pool/updates/main/libv/libvorbis -O list_libvorbis
- # get last patch for our release
- - line=$(egrep '(libvorbis_1.3.5)(.*)(tar[.]xz)' list_libvorbis | tail -n 1)
- # get only name of the patch
- - tmp=${line#*href} ; tmp2=${tmp%%>*} ; tmp3=${tmp2#*\"} ; namepatch=${tmp3%\"*}
- # download this patch
- - wget -q http://security.debian.org/debian-security/pool/updates/main/libv/libvorbis/$namepatch -O libvorbis.debian.tar.xz
- - tar xvf libvorbis.debian.tar.xz -C libvorbis || exit 2
- - cd libvorbis
- - for file in $(cat debian/patches/series); do patch -p1 < debian/patches/$file; done
- - ./configure --enable-static --with-pic
- - make
- - make install
- - cd ..
- # Action
- - mkdir -p code/build
- - (cd code/build ; cmake -DWITH_NEL=ON -DWITH_STATIC=ON -DWITH_STATIC_DRIVERS=ON -DWITH_STATIC_EXTERNAL=ON -DWITH_LUA52=ON -DWITH_RYZOM_PATCH=ON -DWITH_RYZOM_CUSTOM_PATCH_SERVER=ON -DWITH_NEL_TESTS=OFF ..)
- - (cd code/build; make khanat_client)
- - (cd code/build/bin; ls -lh)
- artifacts:
- name: "khanat-client_static-debian_i386_strech-$CI_COMMIT_REF_NAME"
- paths:
- - code/build/bin
-# expire_in: 2 week
-
-
-
-Linux client_static_debug debian_i386_strech build:
- stage: build
- except:
- - mac-ci-build
- tags:
- - Docker
- image: i386/debian:9
- script:
- # Prepare environment
- - DEBIAN_FRONTEND=noninteractive apt-get update
- - DEBIAN_FRONTEND=noninteractive apt-get dist-upgrade -y
- - DEBIAN_FRONTEND=noninteractive apt-get install -y autoconf autogen automake bison build-essential cmake cpputest fakeroot libboost-all-dev libfreetype6-dev libgif-dev libgl1-mesa-dev libjpeg62-turbo-dev liblzma-dev libopenal-dev libpng-dev libssh2-1-dev libssl-dev libtool libtool-bin libx11-dev libxml2-dev libxmu-dev libxrandr-dev libxrender-dev libxxf86vm-dev mercurial rrdtool unzip wget zlib1g-dev patch
- - apt-get install -y liblua5.2-0 liblua5.2-dev
- # Apply patch
- - (for patchfile in $(cat patch/series); do echo "patch patch/$patchfile"; patch -f -Z -t -p 1 -i patch/$patchfile || exit 2; done)
- # Build Curl
- - wget -q https://curl.haxx.se/download/curl-7.58.0.tar.gz -O curl.tar.gz
- - mkdir -p curl/build
- - tar xvf curl.tar.gz -C curl --strip 1
- - (cd curl/build; cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_CURL_TESTS=OFF -DCURL_ZLIB=ON -DBUILD_CURL_EXE=OFF -DCURL_STATICLIB=ON -DHTTP_ONLY=ON -DENABLE_IPV6=ON -DCMAKE_USE_OPENSSL=ON -DOPENSSL_SSL_LIBRARIES=/usr/lib/i386-linux-gnu/libssl.a -DOPENSSL_CRYPTO_LIBRARIES=/usr/lib/i386-linux-gnu/libcrypto.a -DCMAKE_USE_LIBSSH2=OFF -DZLIB_LIBRARY=/usr/lib/i386-linux-gnu/libz.a -DCMAKE_C_FLAGS='-fPIC' ..)
- - (cd curl/build; make)
- - (cd curl/build; make install)
- # Build luabind
- - mkdir -p luabind
- - wget -q http://http.debian.net/debian/pool/main/l/luabind/luabind_0.9.1+dfsg.orig.tar.gz -O luabind.tar.gz
- - wget -q http://http.debian.net/debian/pool/main/l/luabind/luabind_0.9.1+dfsg-11.debian.tar.xz -O luabind-debian.tar.xz
- - tar xvf luabind.tar.gz -C luabind --strip 1 || exit 2
- - tar xvf luabind-debian.tar.xz -C luabind || exit 2
- - cd luabind
- - for file in $(cat debian/patches/series); do patch -p1 < debian/patches/$file; done
- - export -p DEB_HOST_MULTIARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH); bjam -d2 release debug install cflags="-fPIC $(dpkg-buildflags --get CFLAGS)" cxxflags="-fPIC $(dpkg-buildflags --get CXXFLAGS) -Wno-deprecated-declarations" linkflags=" $(dpkg-buildflags --get LDFLAGS)"
- - export -p DEB_HOST_MULTIARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH); bjam -d2 release debug install link=static cflags="-fPIC $(dpkg-buildflags --get CFLAGS)" cxxflags="-fPIC $(dpkg-buildflags --get CXXFLAGS) -Wno-deprecated-declarations" linkflags=" $(dpkg-buildflags --get LDFLAGS)"
- - cd ..
- # Build libogg
- - mkdir -p libogg/build
- - wget -q http://http.debian.net/debian/pool/main/libo/libogg/libogg_1.3.2.orig.tar.gz -O libogg.tar.gz
- - wget -q http://http.debian.net/debian/pool/main/libo/libogg/libogg_1.3.2-1.diff.gz -O libogg.diff.gz
- - tar xvf libogg.tar.gz -C libogg --strip 1 || exit 2
- - gunzip libogg.diff.gz
- - cd libogg
- - patch -p1 < ../libogg.diff
- - cd build
- - ../configure --disable-maintainer-mode --host=$(dpkg-architecture -qDEB_HOST_GNU_TYPE) --build=$(dpkg-architecture -qDEB_BUILD_GNU_TYPE) --libdir=/usr/lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH) --enable-static --prefix=/usr CPPFLAGS="-D_FORTIFY_SOURCE=2" CFLAGS="-Wformat=2 -g -fPIC" CXXFLAGS="-Wformat=2 -g -fPIC" LDFLAGS="-Wl,-z,now"
- - make
- - make install
- - cd ../..
- # Build libvorbis
- - mkdir -p libvorbis
- - wget -q http://security.debian.org/debian-security/pool/updates/main/libv/libvorbis/libvorbis_1.3.5.orig.tar.gz -O libvorbis.tar.gz
- - tar xvf libvorbis.tar.gz -C libvorbis --strip 1 || exit 2
- # Get list package
- - wget -q http://security.debian.org/debian-security/pool/updates/main/libv/libvorbis -O list_libvorbis
- # get last patch for our release
- - line=$(egrep '(libvorbis_1.3.5)(.*)(tar[.]xz)' list_libvorbis | tail -n 1)
- # get only name of the patch
- - tmp=${line#*href} ; tmp2=${tmp%%>*} ; tmp3=${tmp2#*\"} ; namepatch=${tmp3%\"*}
- # download this patch
- - wget -q http://security.debian.org/debian-security/pool/updates/main/libv/libvorbis/$namepatch -O libvorbis.debian.tar.xz
- - tar xvf libvorbis.debian.tar.xz -C libvorbis || exit 2
- - cd libvorbis
- - for file in $(cat debian/patches/series); do patch -p1 < debian/patches/$file; done
- - ./configure --enable-static --with-pic
- - make
- - make install
- - cd ..
- # Action
- - mkdir -p code/build
- - (cd code/build ; cmake -DWITH_NEL=ON -DWITH_STATIC=ON -DWITH_STATIC_DRIVERS=ON -DWITH_STATIC_EXTERNAL=ON -DWITH_SYMBOLS=ON -DWITH_LUA52=ON -DWITH_RYZOM_PATCH=ON -DWITH_RYZOM_CUSTOM_PATCH_SERVER=ON -DWITH_NEL_TESTS=OFF ..)
- - (cd code/build; make khanat_client)
- - (cd code/build/bin; ls -lh)
- artifacts:
- name: "khanat-client_static_debug-debian_i386_strech-$CI_COMMIT_REF_NAME"
- paths:
- - code/build/bin
-# expire_in: 2 week
-
-
-# Fedora Client
-Linux client fedora_amd64_27 build:
- stage: build
- except:
- - mac-ci-build
- tags:
- - Docker
- image: amd64/fedora:27
- script:
- # Prepare environment
- - yum update -y
- - yum install -y
- autoconf
- autogen
- automake
- bison
- boost-devel
- cmake
- fakeroot
- freetype-devel
- gcc
- gcc-c++
- giflib-devel
- libcurl-devel
- libjpeg-turbo-devel
- libogg-devel
- libpng-devel
- libssh2-devel
- libtool
- libvorbis-devel
- libX11-devel
- libxml2-devel
- libXmu
- libXrandr-devel
- libXrender-devel
- libXxf86vm-devel
- luabind-devel
- lua-devel
- lzma-devel
- make
- mercurial
- mesa-libGL-devel
- openal-soft-devel
- openssl-devel
- patch
- rrdtool
- unzip
- wget
- xz
- zlib-devel
- patch
- # Apply patch
- - (for patchfile in $(cat patch/series); do echo "patch patch/$patchfile"; patch -f -Z -t -p 1 -i patch/$patchfile || exit 2; done)
- # Action
- - mkdir -p code/build
- - (cd code/build ; export -p CPPFLAGS="-Wno-deprecated -Wno-deprecated-declarations"; cmake -G "Unix Makefiles" -DWITH_NEL=ON -DWITH_LUA52=ON -DWITH_RYZOM_PATCH=OFF -DWITH_RYZOM_CUSTOM_PATCH_SERVER=OFF -DWITH_NEL_TESTS=OFF -DWITH_RYZOM_CLIENT=ON -DWITH_DRIVER_OPENGL=ON -DWITH_DRIVER_OPENAL=ON -DWITH_NEL_SAMPLES=OFF -DWITH_SOUND=ON -DWITH_STATIC_CURL=OFF ..)
- - (cd code/build; make khanat_client)
- - (cd code/build/bin; ls -lh)
- artifacts:
- name: "khanat-client-fedora_27-$CI_COMMIT_REF_NAME"
- paths:
- - code/build/bin
-# expire_in: 2 week
- when: manual
-
-
-# Ubuntu Client
-Linux client ubuntu_amd64_17_10 build:
- stage: build
- except:
- - mac-ci-build
- tags:
- - Docker
- image: amd64/ubuntu:17.10
- script:
- # Prepare environment
- - DEBIAN_FRONTEND=noninteractive apt-get update
- - DEBIAN_FRONTEND=noninteractive apt-get dist-upgrade -y
- - DEBIAN_FRONTEND=noninteractive apt-get install -y autoconf
- autogen
- automake
- bison
- build-essential
- cmake
- cpputest
- fakeroot
- libboost-all-dev
- libcurl4-openssl-dev
- libfreetype6-dev
- libgif-dev
- libgl1-mesa-dev
- libjpeg62-dev
- liblzma-dev
- libopenal-dev
- libpng-dev
- libssh2-1-dev
- libssl-dev
- libtool
- libtool-bin
- libx11-dev
- libxml2-dev
- libxmu-dev
- libxrandr-dev
- libxrender-dev
- libxxf86vm-dev
- mercurial
- rrdtool
- unzip
- wget
- zlib1g-dev
- - apt-get install -y liblua5.2-0 liblua5.2-dev libluabind-dev libluabind0.9.1v5 libogg-dev libvorbis-dev
- # Apply patch
- - (for patchfile in $(cat patch/series); do echo "patch patch/$patchfile"; patch -f -Z -t -p 1 -i patch/$patchfile || exit 2; done)
- # Action
- - mkdir -p code/build
- - (cd code/build ; export -p CPPFLAGS="-Wno-deprecated -Wno-deprecated-declarations"; cmake -G "Unix Makefiles" -DWITH_NEL=ON -DWITH_LUA52=ON -DWITH_RYZOM_PATCH=OFF -DWITH_RYZOM_CUSTOM_PATCH_SERVER=OFF -DWITH_NEL_TESTS=OFF -DWITH_RYZOM_CLIENT=ON -DWITH_DRIVER_OPENGL=ON -DWITH_DRIVER_OPENAL=ON -DWITH_NEL_SAMPLES=OFF -DWITH_SOUND=ON -DWITH_STATIC_CURL=OFF ..)
- - (cd code/build; make khanat_client)
- - (cd code/build/bin; ls -lh)
- artifacts:
- name: "khanat-client-ubuntu_17_10-$(echo $CI_BUILD_REF | head -c 7 )-$CI_PIPELINE_ID"
- paths:
- - code/build/bin
-# expire_in: 2 week
- when: manual
-
-
-# Archlinux Client
-Linux client archlinux build:
- stage: build
- except:
- - mac-ci-build
- tags:
- - Docker
- image: base/archlinux
- script:
- # Prepare environment
- - pacman -Syyu --noconfirm pacman-contrib
- - cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup
- - curl -o /etc/pacman.d/mirrorlist.new https://www.archlinux.org/mirrorlist/all/
- - sed -i 's/^#Server/Server/' /etc/pacman.d/mirrorlist.new
- - rankmirrors -n 6 /etc/pacman.d/mirrorlist.new > /etc/pacman.d/mirrorlist
- - pacman -Syyu
- - pacman -S --noconfirm
- autoconf
- autogen
- automake
- binutils
- boost
- boost-libs
- cmake
- fakeroot
- gcc
- giflib
- git
- glu
- libjpeg-turbo
- libogg
- libpng
- libssh
- libtool
- libvorbis
- libx11
- libxml2
- libxmu
- libxrandr
- libxrender
- libxxf86vm
- lua
- make
- mesa
- openal
- openssl
- patch
- pkg-config
- sed
- unzip
- wget
- xorg-xfd
- xz
- zlib
- > pacman.log
- # Install Yaourt
- # Disable check root (never do that on real server)
- - sed -i 's/EUID == 0/EUID == 12345/g' /usr/sbin/makepkg
- - mkdir -p build
- - cd build
- - git clone https://aur.archlinux.org/package-query.git
- - cd package-query
- - yes | makepkg -si || echo $?
- - cd ..
- - git clone https://aur.archlinux.org/yaourt.git
- - cd yaourt
- - yes | makepkg -si || echo $?
- - cd ../..
- - yaourt -Syyu --noconfirm --aur boost-build
- # Apply patch
- - (for patchfile in $(cat patch/series); do echo "patch patch/$patchfile"; patch -f -Z -t -p 1 -i patch/$patchfile || exit 2; done)
- - patch -f -Z -t -p 1 -i patch/02_archlinux_allocator_static_assert_error.patch
- # Build
- - mkdir -p luabind
- - wget -q http://http.debian.net/debian/pool/main/l/luabind/luabind_0.9.1+dfsg.orig.tar.gz -O luabind.tar.gz
- - wget -q http://http.debian.net/debian/pool/main/l/luabind/luabind_0.9.1+dfsg-11.debian.tar.xz -O luabind-debian.tar.xz
- - tar xvf luabind.tar.gz -C luabind --strip 1 || exit 2
- - tar xvf luabind-debian.tar.xz -C luabind || exit 2
- - cd luabind
- - for file in $(cat debian/patches/series); do patch -p1 < debian/patches/$file; done
- - export -p DEB_HOST_MULTIARCH="/"; bjam -d2 release debug install cxxflags="-fPIC -Wno-deprecated -Wno-deprecated-declarations"
- - export -p DEB_HOST_MULTIARCH="/"; bjam -d2 release debug install link=static cxxflags="-fPIC -Wno-deprecated -Wno-deprecated-declarations"
- - cd ..
- # Action
- - mkdir -p code/build
- - (cd code/build ; export -p CPPFLAGS="-Wno-deprecated -Wno-deprecated-declarations"; cmake -G "Unix Makefiles" -DWITH_NEL=ON -DWITH_STATIC=ON -DWITH_STATIC_DRIVERS=ON -DWITH_STATIC_EXTERNAL=ON -DWITH_LUA52=ON -DWITH_RYZOM_PATCH=OFF -DWITH_RYZOM_CUSTOM_PATCH_SERVER=OFF -DWITH_NEL_TESTS=OFF -DWITH_RYZOM_CLIENT=ON -DWITH_DRIVER_OPENGL=ON -DWITH_DRIVER_OPENAL=ON -DWITH_NEL_SAMPLES=OFF -DWITH_SOUND=ON -DWITH_STATIC_CURL=ON /opt/code ..)
- - (cd code/build; make khanat_client)
- - (cd code/build/bin; ls -lh)
- artifacts:
- name: "khanat-client-archlinux-$CI_COMMIT_REF_NAME"
- paths:
- - code/build/bin
-# expire_in: 2 week
- when: manual
-
-
-# Windows Client
-Windows client build:
- stage: build
- except:
- - mac-ci-build
- tags:
- - Docker
- image: amd64/debian:9
- script:
- # Prepare environment
- - dpkg --add-architecture i386
- - DEBIAN_FRONTEND=noninteractive apt-get update
- - DEBIAN_FRONTEND=noninteractive apt-get dist-upgrade -y
- - DEBIAN_FRONTEND=noninteractive apt-get install -y
- p7zip-full
- binfmt-support
- libc6-i386
- libncurses5:i386
- libfreetype6:i386
- bzip2
- wget
- dos2unix
- # Action
- - mkdir -p wincross
- - source builder/cross_win32.sh
- - mkdir -p codebis
- - cp -r code/* codebis/.
- - find codebis -type f -name "*.h*" -exec unix2dos {} \;
- - find codebis -type f -name "*.c*" -exec unix2dos {} \;
- - find codebis -type f -name "*.txt" -exec unix2dos {} \;
- - find codebis -type f -name "*.rc" -exec unix2dos {} \;
- - mkdir -p build
- - cd build
- - wine cmake.exe -DWITH_RYZOM_CUSTOM_PATCH_SERVER=ON -DWITH_RYZOM_SERVER=OFF -DWITH_RYZOM_TOOLS=OFF -DWITH_RYZOM_CLIENT=ON -DWITH_RYZOM_PATCH=ON -DWITH_NEL_TESTS=OFF -DWITH_NEL_TOOLS=OFF -DWITH_TOOLS=OFF -DWITH_NEL_SAMPLES=OFF -DWITH_LUA53=ON -DWITH_LUA51=OFF -DWITH_STLPORT=OFF -DWITH_DRIVER_DSOUND=ON -G "NMake Makefiles JOM" -DWITH_STATIC=ON -DWITH_STATIC_DRIVERS=ON -DWITH_DRIVER_OPENAL=OFF -DWITH_DRIVER_DSOUND=ON -DWITH_DRIVER_XAUDIO2=ON -DWITH_DRIVER_FMOD=ON -DWITH_DRIVER_DIRECT3D=ON ../codebis
- - wine jom.exe
- artifacts:
- name: "khanat-client-windows-$CI_COMMIT_REF_NAME"
- paths:
- - build/bin
-# expire_in: 2 week
-
-
-# Job de compilation pour OSX
-OSX client build:
- stage: build
- only:
- - tags
- - mac-ci-build
- tags:
- - OSX
- variables:
- # Éviter de cloner tout le dépot à chaque fois, à la place juste récuperer les changements
- GIT_STRATEGY: fetch
- script:
- # Création de l'environnement de compilation
- - mkdir -p BUILD/x86_64
- - cd BUILD/x86_64
- # 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=OFF -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
- 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
- - mac-ci-build
- tags:
- - Docker
- image: ubuntu:18.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
- only:
- - tags
- - mac-ci-build
- 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:18.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:18.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
diff --git a/.hgeol b/.hgeol
new file mode 100644
index 000000000..a9766f577
--- /dev/null
+++ b/.hgeol
@@ -0,0 +1,28 @@
+[patterns]
+**.h = native
+**.cpp = native
+
+**/database.xml = BIN
+**/msg.xml = BIN
+
+**.txt = native
+**.xml = native
+
+**.layout = native
+**.looknfeel = native
+**.imageset = native
+**.font = native
+**.scheme = native
+
+**.tpl = native
+
+**.xsd = native
+**.dox = native
+
+**.py = native
+**.lua = native
+
+**.pkg = native
+
+[repository]
+native = LF
diff --git a/.hgignore b/.hgignore
index 990487a2a..41a0e58cf 100644
--- a/.hgignore
+++ b/.hgignore
@@ -242,9 +242,6 @@ external_stlport
nel_tools*
ryzom_tools*
-#personal projects
-personal/
-
#Dumps
*.dmp
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 000000000..c3835f23b
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,53 @@
+sudo: false
+language: cpp
+
+compiler:
+ - gcc
+
+os:
+ - linux
+matrix:
+ fast_finish: true
+env:
+ - CMAKE_CONFIGURE_OPTIONS="-DWITH_NEL_TESTS:BOOL=off -DWITH_LUA51:BOOL=on -DWITH_LUA52:BOOL=off -DWITH_LUA53:BOOL=off"
+ - CMAKE_CONFIGURE_OPTIONS="-DWITH_NEL_TESTS:BOOL=off -DWITH_LUA51:BOOL=off -DWITH_LUA52:BOOL=on -DWITH_LUA53:BOOL=off"
+ - CMAKE_CONFIGURE_OPTIONS="-DWITH_NEL_TESTS:BOOL=off -DWITH_LUA51:BOOL=off -DWITH_LUA52:BOOL=off -DWITH_LUA53:BOOL=on"
+ - CMAKE_CONFIGURE_OPTIONS="-DCPPTEST_LIBRARY_DEBUG:STRING=/usr/lib/libcpptest.so"
+ CMAKE_BUILD_OPTIONS="--target nel_unit_test -- -j 2"
+ RUN="build/bin/nel_unit_test"
+
+addons:
+ apt:
+ packages:
+ - liblua5.1-0-dev
+ - liblua5.1-0-dbg
+ - liblua5.2-0-dev
+ - liblua5.2-0-dbg
+ - libluabind-dev
+ - libcpptest-dev
+ - libogg-dev
+ - libvorbis-dev
+ - libopenal-dev
+ - libgif-dev
+ - libfreetype6-dev
+ - libxml2-dev
+
+before_script:
+ - mkdir build
+ - cmake --version
+ - cmake -Hcode -Bbuild $CMAKE_CONFIGURE_OPTIONS
+ - cat build/CMakeCache.txt
+
+script:
+ - cmake --build build $CMAKE_BUILD_OPTIONS
+ - $RUN
+
+notifications:
+ irc:
+ channels:
+ - $NOTIFICATION_IRC_CHANNEL
+ template:
+ - "%{repository}#%{build_number} (%{branch} - %{commit} : %{author}): %{message}"
+ - "Description : %{commit_message}"
+ - "Change view : %{compare_url}"
+ - "Build details : %{build_url}"
diff --git a/LICENSE b/LICENSE
deleted file mode 100644
index 0c2a91a54..000000000
--- a/LICENSE
+++ /dev/null
@@ -1,661 +0,0 @@
- GNU AFFERO GENERAL PUBLIC LICENSE
- Version 3, 19 November 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc.
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The GNU Affero General Public License is a free, copyleft license for
-software and other kinds of works, specifically designed to ensure
-cooperation with the community in the case of network server software.
-
- The licenses for most software and other practical works are designed
-to take away your freedom to share and change the works. By contrast,
-our General Public Licenses are intended to guarantee your freedom to
-share and change all versions of a program--to make sure it remains free
-software for all its users.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-them if you wish), that you receive source code or can get it if you
-want it, that you can change the software or use pieces of it in new
-free programs, and that you know you can do these things.
-
- Developers that use our General Public Licenses protect your rights
-with two steps: (1) assert copyright on the software, and (2) offer
-you this License which gives you legal permission to copy, distribute
-and/or modify the software.
-
- A secondary benefit of defending all users' freedom is that
-improvements made in alternate versions of the program, if they
-receive widespread use, become available for other developers to
-incorporate. Many developers of free software are heartened and
-encouraged by the resulting cooperation. However, in the case of
-software used on network servers, this result may fail to come about.
-The GNU General Public License permits making a modified version and
-letting the public access it on a server without ever releasing its
-source code to the public.
-
- The GNU Affero General Public License is designed specifically to
-ensure that, in such cases, the modified source code becomes available
-to the community. It requires the operator of a network server to
-provide the source code of the modified version running there to the
-users of that server. Therefore, public use of a modified version, on
-a publicly accessible server, gives the public access to the source
-code of the modified version.
-
- An older license, called the Affero General Public License and
-published by Affero, was designed to accomplish similar goals. This is
-a different license, not a version of the Affero GPL, but Affero has
-released a new version of the Affero GPL which permits relicensing under
-this license.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- TERMS AND CONDITIONS
-
- 0. Definitions.
-
- "This License" refers to version 3 of the GNU Affero General Public License.
-
- "Copyright" also means copyright-like laws that apply to other kinds of
-works, such as semiconductor masks.
-
- "The Program" refers to any copyrightable work licensed under this
-License. Each licensee is addressed as "you". "Licensees" and
-"recipients" may be individuals or organizations.
-
- To "modify" a work means to copy from or adapt all or part of the work
-in a fashion requiring copyright permission, other than the making of an
-exact copy. The resulting work is called a "modified version" of the
-earlier work or a work "based on" the earlier work.
-
- A "covered work" means either the unmodified Program or a work based
-on the Program.
-
- To "propagate" a work means to do anything with it that, without
-permission, would make you directly or secondarily liable for
-infringement under applicable copyright law, except executing it on a
-computer or modifying a private copy. Propagation includes copying,
-distribution (with or without modification), making available to the
-public, and in some countries other activities as well.
-
- To "convey" a work means any kind of propagation that enables other
-parties to make or receive copies. Mere interaction with a user through
-a computer network, with no transfer of a copy, is not conveying.
-
- An interactive user interface displays "Appropriate Legal Notices"
-to the extent that it includes a convenient and prominently visible
-feature that (1) displays an appropriate copyright notice, and (2)
-tells the user that there is no warranty for the work (except to the
-extent that warranties are provided), that licensees may convey the
-work under this License, and how to view a copy of this License. If
-the interface presents a list of user commands or options, such as a
-menu, a prominent item in the list meets this criterion.
-
- 1. Source Code.
-
- The "source code" for a work means the preferred form of the work
-for making modifications to it. "Object code" means any non-source
-form of a work.
-
- A "Standard Interface" means an interface that either is an official
-standard defined by a recognized standards body, or, in the case of
-interfaces specified for a particular programming language, one that
-is widely used among developers working in that language.
-
- The "System Libraries" of an executable work include anything, other
-than the work as a whole, that (a) is included in the normal form of
-packaging a Major Component, but which is not part of that Major
-Component, and (b) serves only to enable use of the work with that
-Major Component, or to implement a Standard Interface for which an
-implementation is available to the public in source code form. A
-"Major Component", in this context, means a major essential component
-(kernel, window system, and so on) of the specific operating system
-(if any) on which the executable work runs, or a compiler used to
-produce the work, or an object code interpreter used to run it.
-
- The "Corresponding Source" for a work in object code form means all
-the source code needed to generate, install, and (for an executable
-work) run the object code and to modify the work, including scripts to
-control those activities. However, it does not include the work's
-System Libraries, or general-purpose tools or generally available free
-programs which are used unmodified in performing those activities but
-which are not part of the work. For example, Corresponding Source
-includes interface definition files associated with source files for
-the work, and the source code for shared libraries and dynamically
-linked subprograms that the work is specifically designed to require,
-such as by intimate data communication or control flow between those
-subprograms and other parts of the work.
-
- The Corresponding Source need not include anything that users
-can regenerate automatically from other parts of the Corresponding
-Source.
-
- The Corresponding Source for a work in source code form is that
-same work.
-
- 2. Basic Permissions.
-
- All rights granted under this License are granted for the term of
-copyright on the Program, and are irrevocable provided the stated
-conditions are met. This License explicitly affirms your unlimited
-permission to run the unmodified Program. The output from running a
-covered work is covered by this License only if the output, given its
-content, constitutes a covered work. This License acknowledges your
-rights of fair use or other equivalent, as provided by copyright law.
-
- You may make, run and propagate covered works that you do not
-convey, without conditions so long as your license otherwise remains
-in force. You may convey covered works to others for the sole purpose
-of having them make modifications exclusively for you, or provide you
-with facilities for running those works, provided that you comply with
-the terms of this License in conveying all material for which you do
-not control copyright. Those thus making or running the covered works
-for you must do so exclusively on your behalf, under your direction
-and control, on terms that prohibit them from making any copies of
-your copyrighted material outside their relationship with you.
-
- Conveying under any other circumstances is permitted solely under
-the conditions stated below. Sublicensing is not allowed; section 10
-makes it unnecessary.
-
- 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
-
- No covered work shall be deemed part of an effective technological
-measure under any applicable law fulfilling obligations under article
-11 of the WIPO copyright treaty adopted on 20 December 1996, or
-similar laws prohibiting or restricting circumvention of such
-measures.
-
- When you convey a covered work, you waive any legal power to forbid
-circumvention of technological measures to the extent such circumvention
-is effected by exercising rights under this License with respect to
-the covered work, and you disclaim any intention to limit operation or
-modification of the work as a means of enforcing, against the work's
-users, your or third parties' legal rights to forbid circumvention of
-technological measures.
-
- 4. Conveying Verbatim Copies.
-
- You may convey verbatim copies of the Program's source code as you
-receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice;
-keep intact all notices stating that this License and any
-non-permissive terms added in accord with section 7 apply to the code;
-keep intact all notices of the absence of any warranty; and give all
-recipients a copy of this License along with the Program.
-
- You may charge any price or no price for each copy that you convey,
-and you may offer support or warranty protection for a fee.
-
- 5. Conveying Modified Source Versions.
-
- You may convey a work based on the Program, or the modifications to
-produce it from the Program, in the form of source code under the
-terms of section 4, provided that you also meet all of these conditions:
-
- a) The work must carry prominent notices stating that you modified
- it, and giving a relevant date.
-
- b) The work must carry prominent notices stating that it is
- released under this License and any conditions added under section
- 7. This requirement modifies the requirement in section 4 to
- "keep intact all notices".
-
- c) You must license the entire work, as a whole, under this
- License to anyone who comes into possession of a copy. This
- License will therefore apply, along with any applicable section 7
- additional terms, to the whole of the work, and all its parts,
- regardless of how they are packaged. This License gives no
- permission to license the work in any other way, but it does not
- invalidate such permission if you have separately received it.
-
- d) If the work has interactive user interfaces, each must display
- Appropriate Legal Notices; however, if the Program has interactive
- interfaces that do not display Appropriate Legal Notices, your
- work need not make them do so.
-
- A compilation of a covered work with other separate and independent
-works, which are not by their nature extensions of the covered work,
-and which are not combined with it such as to form a larger program,
-in or on a volume of a storage or distribution medium, is called an
-"aggregate" if the compilation and its resulting copyright are not
-used to limit the access or legal rights of the compilation's users
-beyond what the individual works permit. Inclusion of a covered work
-in an aggregate does not cause this License to apply to the other
-parts of the aggregate.
-
- 6. Conveying Non-Source Forms.
-
- You may convey a covered work in object code form under the terms
-of sections 4 and 5, provided that you also convey the
-machine-readable Corresponding Source under the terms of this License,
-in one of these ways:
-
- a) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by the
- Corresponding Source fixed on a durable physical medium
- customarily used for software interchange.
-
- b) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by a
- written offer, valid for at least three years and valid for as
- long as you offer spare parts or customer support for that product
- model, to give anyone who possesses the object code either (1) a
- copy of the Corresponding Source for all the software in the
- product that is covered by this License, on a durable physical
- medium customarily used for software interchange, for a price no
- more than your reasonable cost of physically performing this
- conveying of source, or (2) access to copy the
- Corresponding Source from a network server at no charge.
-
- c) Convey individual copies of the object code with a copy of the
- written offer to provide the Corresponding Source. This
- alternative is allowed only occasionally and noncommercially, and
- only if you received the object code with such an offer, in accord
- with subsection 6b.
-
- d) Convey the object code by offering access from a designated
- place (gratis or for a charge), and offer equivalent access to the
- Corresponding Source in the same way through the same place at no
- further charge. You need not require recipients to copy the
- Corresponding Source along with the object code. If the place to
- copy the object code is a network server, the Corresponding Source
- may be on a different server (operated by you or a third party)
- that supports equivalent copying facilities, provided you maintain
- clear directions next to the object code saying where to find the
- Corresponding Source. Regardless of what server hosts the
- Corresponding Source, you remain obligated to ensure that it is
- available for as long as needed to satisfy these requirements.
-
- e) Convey the object code using peer-to-peer transmission, provided
- you inform other peers where the object code and Corresponding
- Source of the work are being offered to the general public at no
- charge under subsection 6d.
-
- A separable portion of the object code, whose source code is excluded
-from the Corresponding Source as a System Library, need not be
-included in conveying the object code work.
-
- A "User Product" is either (1) a "consumer product", which means any
-tangible personal property which is normally used for personal, family,
-or household purposes, or (2) anything designed or sold for incorporation
-into a dwelling. In determining whether a product is a consumer product,
-doubtful cases shall be resolved in favor of coverage. For a particular
-product received by a particular user, "normally used" refers to a
-typical or common use of that class of product, regardless of the status
-of the particular user or of the way in which the particular user
-actually uses, or expects or is expected to use, the product. A product
-is a consumer product regardless of whether the product has substantial
-commercial, industrial or non-consumer uses, unless such uses represent
-the only significant mode of use of the product.
-
- "Installation Information" for a User Product means any methods,
-procedures, authorization keys, or other information required to install
-and execute modified versions of a covered work in that User Product from
-a modified version of its Corresponding Source. The information must
-suffice to ensure that the continued functioning of the modified object
-code is in no case prevented or interfered with solely because
-modification has been made.
-
- If you convey an object code work under this section in, or with, or
-specifically for use in, a User Product, and the conveying occurs as
-part of a transaction in which the right of possession and use of the
-User Product is transferred to the recipient in perpetuity or for a
-fixed term (regardless of how the transaction is characterized), the
-Corresponding Source conveyed under this section must be accompanied
-by the Installation Information. But this requirement does not apply
-if neither you nor any third party retains the ability to install
-modified object code on the User Product (for example, the work has
-been installed in ROM).
-
- The requirement to provide Installation Information does not include a
-requirement to continue to provide support service, warranty, or updates
-for a work that has been modified or installed by the recipient, or for
-the User Product in which it has been modified or installed. Access to a
-network may be denied when the modification itself materially and
-adversely affects the operation of the network or violates the rules and
-protocols for communication across the network.
-
- Corresponding Source conveyed, and Installation Information provided,
-in accord with this section must be in a format that is publicly
-documented (and with an implementation available to the public in
-source code form), and must require no special password or key for
-unpacking, reading or copying.
-
- 7. Additional Terms.
-
- "Additional permissions" are terms that supplement the terms of this
-License by making exceptions from one or more of its conditions.
-Additional permissions that are applicable to the entire Program shall
-be treated as though they were included in this License, to the extent
-that they are valid under applicable law. If additional permissions
-apply only to part of the Program, that part may be used separately
-under those permissions, but the entire Program remains governed by
-this License without regard to the additional permissions.
-
- When you convey a copy of a covered work, you may at your option
-remove any additional permissions from that copy, or from any part of
-it. (Additional permissions may be written to require their own
-removal in certain cases when you modify the work.) You may place
-additional permissions on material, added by you to a covered work,
-for which you have or can give appropriate copyright permission.
-
- Notwithstanding any other provision of this License, for material you
-add to a covered work, you may (if authorized by the copyright holders of
-that material) supplement the terms of this License with terms:
-
- a) Disclaiming warranty or limiting liability differently from the
- terms of sections 15 and 16 of this License; or
-
- b) Requiring preservation of specified reasonable legal notices or
- author attributions in that material or in the Appropriate Legal
- Notices displayed by works containing it; or
-
- c) Prohibiting misrepresentation of the origin of that material, or
- requiring that modified versions of such material be marked in
- reasonable ways as different from the original version; or
-
- d) Limiting the use for publicity purposes of names of licensors or
- authors of the material; or
-
- e) Declining to grant rights under trademark law for use of some
- trade names, trademarks, or service marks; or
-
- f) Requiring indemnification of licensors and authors of that
- material by anyone who conveys the material (or modified versions of
- it) with contractual assumptions of liability to the recipient, for
- any liability that these contractual assumptions directly impose on
- those licensors and authors.
-
- All other non-permissive additional terms are considered "further
-restrictions" within the meaning of section 10. If the Program as you
-received it, or any part of it, contains a notice stating that it is
-governed by this License along with a term that is a further
-restriction, you may remove that term. If a license document contains
-a further restriction but permits relicensing or conveying under this
-License, you may add to a covered work material governed by the terms
-of that license document, provided that the further restriction does
-not survive such relicensing or conveying.
-
- If you add terms to a covered work in accord with this section, you
-must place, in the relevant source files, a statement of the
-additional terms that apply to those files, or a notice indicating
-where to find the applicable terms.
-
- Additional terms, permissive or non-permissive, may be stated in the
-form of a separately written license, or stated as exceptions;
-the above requirements apply either way.
-
- 8. Termination.
-
- You may not propagate or modify a covered work except as expressly
-provided under this License. Any attempt otherwise to propagate or
-modify it is void, and will automatically terminate your rights under
-this License (including any patent licenses granted under the third
-paragraph of section 11).
-
- However, if you cease all violation of this License, then your
-license from a particular copyright holder is reinstated (a)
-provisionally, unless and until the copyright holder explicitly and
-finally terminates your license, and (b) permanently, if the copyright
-holder fails to notify you of the violation by some reasonable means
-prior to 60 days after the cessation.
-
- Moreover, your license from a particular copyright holder is
-reinstated permanently if the copyright holder notifies you of the
-violation by some reasonable means, this is the first time you have
-received notice of violation of this License (for any work) from that
-copyright holder, and you cure the violation prior to 30 days after
-your receipt of the notice.
-
- Termination of your rights under this section does not terminate the
-licenses of parties who have received copies or rights from you under
-this License. If your rights have been terminated and not permanently
-reinstated, you do not qualify to receive new licenses for the same
-material under section 10.
-
- 9. Acceptance Not Required for Having Copies.
-
- You are not required to accept this License in order to receive or
-run a copy of the Program. Ancillary propagation of a covered work
-occurring solely as a consequence of using peer-to-peer transmission
-to receive a copy likewise does not require acceptance. However,
-nothing other than this License grants you permission to propagate or
-modify any covered work. These actions infringe copyright if you do
-not accept this License. Therefore, by modifying or propagating a
-covered work, you indicate your acceptance of this License to do so.
-
- 10. Automatic Licensing of Downstream Recipients.
-
- Each time you convey a covered work, the recipient automatically
-receives a license from the original licensors, to run, modify and
-propagate that work, subject to this License. You are not responsible
-for enforcing compliance by third parties with this License.
-
- An "entity transaction" is a transaction transferring control of an
-organization, or substantially all assets of one, or subdividing an
-organization, or merging organizations. If propagation of a covered
-work results from an entity transaction, each party to that
-transaction who receives a copy of the work also receives whatever
-licenses to the work the party's predecessor in interest had or could
-give under the previous paragraph, plus a right to possession of the
-Corresponding Source of the work from the predecessor in interest, if
-the predecessor has it or can get it with reasonable efforts.
-
- You may not impose any further restrictions on the exercise of the
-rights granted or affirmed under this License. For example, you may
-not impose a license fee, royalty, or other charge for exercise of
-rights granted under this License, and you may not initiate litigation
-(including a cross-claim or counterclaim in a lawsuit) alleging that
-any patent claim is infringed by making, using, selling, offering for
-sale, or importing the Program or any portion of it.
-
- 11. Patents.
-
- A "contributor" is a copyright holder who authorizes use under this
-License of the Program or a work on which the Program is based. The
-work thus licensed is called the contributor's "contributor version".
-
- A contributor's "essential patent claims" are all patent claims
-owned or controlled by the contributor, whether already acquired or
-hereafter acquired, that would be infringed by some manner, permitted
-by this License, of making, using, or selling its contributor version,
-but do not include claims that would be infringed only as a
-consequence of further modification of the contributor version. For
-purposes of this definition, "control" includes the right to grant
-patent sublicenses in a manner consistent with the requirements of
-this License.
-
- Each contributor grants you a non-exclusive, worldwide, royalty-free
-patent license under the contributor's essential patent claims, to
-make, use, sell, offer for sale, import and otherwise run, modify and
-propagate the contents of its contributor version.
-
- In the following three paragraphs, a "patent license" is any express
-agreement or commitment, however denominated, not to enforce a patent
-(such as an express permission to practice a patent or covenant not to
-sue for patent infringement). To "grant" such a patent license to a
-party means to make such an agreement or commitment not to enforce a
-patent against the party.
-
- If you convey a covered work, knowingly relying on a patent license,
-and the Corresponding Source of the work is not available for anyone
-to copy, free of charge and under the terms of this License, through a
-publicly available network server or other readily accessible means,
-then you must either (1) cause the Corresponding Source to be so
-available, or (2) arrange to deprive yourself of the benefit of the
-patent license for this particular work, or (3) arrange, in a manner
-consistent with the requirements of this License, to extend the patent
-license to downstream recipients. "Knowingly relying" means you have
-actual knowledge that, but for the patent license, your conveying the
-covered work in a country, or your recipient's use of the covered work
-in a country, would infringe one or more identifiable patents in that
-country that you have reason to believe are valid.
-
- If, pursuant to or in connection with a single transaction or
-arrangement, you convey, or propagate by procuring conveyance of, a
-covered work, and grant a patent license to some of the parties
-receiving the covered work authorizing them to use, propagate, modify
-or convey a specific copy of the covered work, then the patent license
-you grant is automatically extended to all recipients of the covered
-work and works based on it.
-
- A patent license is "discriminatory" if it does not include within
-the scope of its coverage, prohibits the exercise of, or is
-conditioned on the non-exercise of one or more of the rights that are
-specifically granted under this License. You may not convey a covered
-work if you are a party to an arrangement with a third party that is
-in the business of distributing software, under which you make payment
-to the third party based on the extent of your activity of conveying
-the work, and under which the third party grants, to any of the
-parties who would receive the covered work from you, a discriminatory
-patent license (a) in connection with copies of the covered work
-conveyed by you (or copies made from those copies), or (b) primarily
-for and in connection with specific products or compilations that
-contain the covered work, unless you entered into that arrangement,
-or that patent license was granted, prior to 28 March 2007.
-
- Nothing in this License shall be construed as excluding or limiting
-any implied license or other defenses to infringement that may
-otherwise be available to you under applicable patent law.
-
- 12. No Surrender of Others' Freedom.
-
- If conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot convey a
-covered work so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you may
-not convey it at all. For example, if you agree to terms that obligate you
-to collect a royalty for further conveying from those to whom you convey
-the Program, the only way you could satisfy both those terms and this
-License would be to refrain entirely from conveying the Program.
-
- 13. Remote Network Interaction; Use with the GNU General Public License.
-
- Notwithstanding any other provision of this License, if you modify the
-Program, your modified version must prominently offer all users
-interacting with it remotely through a computer network (if your version
-supports such interaction) an opportunity to receive the Corresponding
-Source of your version by providing access to the Corresponding Source
-from a network server at no charge, through some standard or customary
-means of facilitating copying of software. This Corresponding Source
-shall include the Corresponding Source for any work covered by version 3
-of the GNU General Public License that is incorporated pursuant to the
-following paragraph.
-
- Notwithstanding any other provision of this License, you have
-permission to link or combine any covered work with a work licensed
-under version 3 of the GNU General Public License into a single
-combined work, and to convey the resulting work. The terms of this
-License will continue to apply to the part which is the covered work,
-but the work with which it is combined will remain governed by version
-3 of the GNU General Public License.
-
- 14. Revised Versions of this License.
-
- The Free Software Foundation may publish revised and/or new versions of
-the GNU Affero General Public License from time to time. Such new versions
-will be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
- Each version is given a distinguishing version number. If the
-Program specifies that a certain numbered version of the GNU Affero General
-Public License "or any later version" applies to it, you have the
-option of following the terms and conditions either of that numbered
-version or of any later version published by the Free Software
-Foundation. If the Program does not specify a version number of the
-GNU Affero General Public License, you may choose any version ever published
-by the Free Software Foundation.
-
- If the Program specifies that a proxy can decide which future
-versions of the GNU Affero General Public License can be used, that proxy's
-public statement of acceptance of a version permanently authorizes you
-to choose that version for the Program.
-
- Later license versions may give you additional or different
-permissions. However, no additional obligations are imposed on any
-author or copyright holder as a result of your choosing to follow a
-later version.
-
- 15. Disclaimer of Warranty.
-
- THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
-APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
-HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
-OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
-THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
-IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
-ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. Limitation of Liability.
-
- IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
-THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
-GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
-USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
-DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
-PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
-EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGES.
-
- 17. Interpretation of Sections 15 and 16.
-
- If the disclaimer of warranty and limitation of liability provided
-above cannot be given local legal effect according to their terms,
-reviewing courts shall apply local law that most closely approximates
-an absolute waiver of all civil liability in connection with the
-Program, unless a warranty or assumption of liability accompanies a
-copy of the Program in return for a fee.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-state the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- Khanat
- Copyright (C) 2016 Khaganat
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published
- by the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see .
-
-Also add information on how to contact you by electronic and paper mail.
-
- If your software can interact with users remotely through a computer
-network, you should also make sure that it provides a way for users to
-get its source. For example, if your program is a web application, its
-interface could display a "Source" link that leads users to an archive
-of the code. There are many ways you could offer source, and different
-solutions will be better for different programs; see section 13 for the
-specific requirements.
-
- You should also get your employer (if you work as a programmer) or school,
-if any, to sign a "copyright disclaimer" for the program, if necessary.
-For more information on this, and how to apply and follow the GNU AGPL, see
-.
diff --git a/README.md b/README.md
index 1fa4cc8ef..c60d1bc0b 100644
--- a/README.md
+++ b/README.md
@@ -1,9 +1,7 @@
-# Ryzom Core [![Build Status](https://travis-ci.org/ryzom/ryzomcore.svg)](https://travis-ci.org/ryzom/ryzomcore)
-
-Ryzom Core is the open-source project related to Ryzom Game. Written in C++, Ryzom Core contains the whole code (client, server, tools) used to make the commercial MMORPG Ryzom. Ryzom Core is a toolkit for the development of massively multiplayer online universes. It provides the base technologies and a set of development methodologies for the development of both client and server code.
-
-
-
-Ryzom Core is open source and released under the terms of the GNU Affero General Public License 3.0 (GNU/AGPLv3) for the source code and the Creative Commons Attributions-ShareAlike 3.0 (CC-BY-SA) for the art assets. Which means you can create your own game using Ryzom Core, for more information on doing so check out Creating Your Own Game Using Ryzom Core.
-
-Modification par la Team Khaganat
+# Ryzom Core [![Build Status](https://travis-ci.org/ryzom/ryzomcore.svg)](https://travis-ci.org/ryzom/ryzomcore)
+
+Ryzom Core is the open-source project related to Ryzom Game. Written in C++, Ryzom Core contains the whole code (client, server, tools) used to make the commercial MMORPG Ryzom. Ryzom Core is a toolkit for the development of massively multiplayer online universes. It provides the base technologies and a set of development methodologies for the development of both client and server code.
+
+
+
+Ryzom Core is open source and released under the terms of the GNU Affero General Public License 3.0 (GNU/AGPLv3) for the source code and the Creative Commons Attributions-ShareAlike 3.0 (CC-BY-SA) for the art assets. Which means you can create your own game using Ryzom Core, for more information on doing so check out Creating Your Own Game Using Ryzom Core.
diff --git a/azure-pipelines.yml b/azure-pipelines.yml
deleted file mode 100644
index cfb8b4696..000000000
--- a/azure-pipelines.yml
+++ /dev/null
@@ -1,40 +0,0 @@
-jobs:
- - job: ubuntu16
- pool:
- vmImage: 'Ubuntu-16.04'
- steps:
- - script: |
- sudo apt-get update
- sudo apt-get install -y software-properties-common
- sudo add-apt-repository ppa:ubuntu-toolchain-r/test
- sudo apt-get update
- sudo apt-get install cmake build-essential -y
- sudo apt-get install gcc-8 g++-8 -y
- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 60
- sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 60
- sudo apt-get install bison autoconf automake -y
- sudo apt-get install libpng12-dev -y
- sudo apt-get install libjpeg-dev -y
- sudo apt-get install libgif-dev libfreetype6-dev -y
- sudo apt-get install freeglut3-dev -y
- sudo apt-get install liblua5.1-dev libluabind-dev libcpptest-dev -y
- sudo apt-get install libogg-dev libvorbis-dev libopenal-dev -y
- sudo apt-get install libavcodec-dev libavformat-dev libavdevice-dev libswscale-dev libpostproc-dev -y
- sudo apt-get install libmysqlclient-dev -y
- sudo apt-get install libxml2-dev -y
- sudo apt-get install libcurl4-openssl-dev libssl-dev -y
- sudo apt-get install libsquish-dev -y
- sudo apt-get install liblzma-dev -y
- sudo apt-get install libgsf-1-dev -y
- displayName: 'Dependencies'
- - script: |
- mkdir build
- cmake --version
- cd build
- cmake -DWITH_STATIC=ON -DWITH_NEL_TESTS=OFF -DWITH_NEL_SAMPLES=ON -DWITH_LUA51=ON -DWITH_RYZOM_SERVER=ON -DWITH_RYZOM_TOOLS=OFF -DWITH_NEL_TOOLS=ON -DWITH_LIBGSF=ON ../code
- cat CMakeCache.txt
- displayName: 'CMake'
- - script: |
- cd build
- make -j`nproc`
- displayName: 'Make'
\ No newline at end of file
diff --git a/builder/cross_win32.sh b/builder/cross_win32.sh
deleted file mode 100755
index 3f116f723..000000000
--- a/builder/cross_win32.sh
+++ /dev/null
@@ -1,242 +0,0 @@
-## Début script windows ##
-#!/bin/sh
-# variables à changer :
-export BASEDIR=$PWD/wincross
-
-COMPILER=vc12
-ARCH=amd64
-WINEVERSION=1.9.1
-
-URL="http://kervala.net/download/"
-URLPREFIX="win32_cross_"
-URLSUFFIX=".7z"
-
-download()
-{
- PACK=$1
-
- if [ ! -e $URLPREFIX$PACK$URLSUFFIX ]
- then
- echo "Downloading $PACK... [$URL$URLPREFIX$PACK$URLSUFFIX]"
- wget -q $URL$URLPREFIX$PACK$URLSUFFIX || exit 2
- fi
-
- echo "Extracting $PACK..."
- 7z -y -o$BASEDIR x $URLPREFIX$PACK$URLSUFFIX 1> /dev/null || exit 2
-
- RET=$?
-
- if [ -d $BASEDIR/$PACK/bin ]
- then
- chmod +x $BASEDIR/$PACK/bin/*.exe
- fi
-
- return $RET
-}
-
-
-
-
-
-if [ "$COMPILER" = "vc8" ]
-then
- echo "Using VC++ 2005 compilers"
-elif [ "$COMPILER" = "vc9" ]
-then
- echo "Using VC++ 2008 compilers"
-elif [ "$COMPILER" = "vc10" ]
-then
- echo "Using VC++ 2010 compilers"
-elif [ "$COMPILER" = "vc11" ]
-then
- echo "Using VC++ 2012 compilers"
-elif [ "$COMPILER" = "vc12" ]
-then
- echo "Using VC++ 2013 compilers"
-elif [ "$COMPILER" = "vc14" ]
-then
- echo "Using VC++ 2015 compilers"
-else
- echo "Bad compiler $COMPILER"
- return 1
-fi
-
-if [ ! -d "tools" ]
-then
- download tools
-fi
-
-if [ ! -d $COMPILER ]
-then
- download $COMPILER
-
- ARCHS="amd64 ia64 x86 x86_amd64 x86_ia64"
-
- for TARCH in $ARCHS
- do
- CDIR=$COMPILER/bin/$TARCH
-
- if [ -d "$CDIR" ]
- then
- chmod +x $CDIR/*.exe
- fi
- done
-fi
-
-if [ ! -d "winsdk" ]
-then
- download winsdk
-fi
-
-if [ ! -d "dxsdk" ]
-then
- download dxsdk
-fi
-
-if [ ! -d "$COMPILER/external" ]
-then
- download $COMPILER"_external"
-fi
-
-export BASEDIRDOS=Z:$(echo "$BASEDIR" | sed 's/\//\\/g')
-
-export TOOLSDIR=$BASEDIR/tools
-export TOOLSBINDIR=$TOOLSDIR/bin
-
-export VCDIR=$BASEDIR/$COMPILER
-export VCBINDIR=$VCDIR/bin
-
-export WINSDKDIR=$BASEDIR/winsdk
-export WINSDKBINDIR=$WINSDKDIR/bin
-
-# wine
-if [ ! -z $WINEVERSION ]
-then
- export BASEWINEDIR=$BASEDIR/wineversion
- export WINEDIR=$BASEWINEDIR/$WINEVERSION/bin
- if [ ! -d $WINEDIR ]
- then
- echo "Downloading WINE $WINEVERSION... [http://www.playonlinux.com/wine/binaries/linux-amd64/PlayOnLinux-wine-$WINEVERSION-linux-amd64.pol]"
- wget -q http://www.playonlinux.com/wine/binaries/linux-amd64/PlayOnLinux-wine-$WINEVERSION-linux-amd64.pol
- echo "Extracting WINE $WINEVERSION... ($BASEDIR)"
- tar xjf PlayOnLinux-wine-$WINEVERSION-linux-amd64.pol --directory=$BASEDIR
- fi
-fi
-
-# remove previous win32 pathes af any
-export PATH=$(echo $PATH | sed 's|:'$BASEDIR'/[a-z0-9./_-]*||g')
-
-
-export PATH=$PATH:$WINEDIR
-
-
-# add wine to path
-export CURRENT_CPU=x86
-export Configuration=Release
-export TARGET_PLATFORM=WIN7
-export APPVER=6.1
-export DEBUGMSG=Release
-export INCLUDE=$BASEDIRDOS"\\"$COMPILER"\\include;"$BASEDIRDOS"\\winsdk\\include"
-export LIB=
-export LIBPATH=$BASEDIRDOS"\\"$COMPILER"\\lib"
-
-export PATH=$PATH:$TOOLSBINDIR:$WINSDKBINDIR
-
-if [ $ARCH = "x86" ]
-then
- export PATH=$PATH:$VCBINDIR/x86
- export WINEPATH=$BASEDIRDOS"\\"$COMPILER"\\bin\\x86;"
- export TARGET_CPU=x86
- export LIB=$BASEDIRDOS"\\"$COMPILER"\\lib;"$BASEDIRDOS"\\winsdk\\lib;"$BASEDIRDOS"\\dxsdk\\lib"
-elif [ $ARCH = "amd64" ]
-then
- export PATH=$PATH:$VCBINDIR/x86_amd64
- export WINEPATH=$BASEDIRDOS"\\"$COMPILER"\\bin\\x86_amd64;"
- export TARGET_CPU=x64
- export LIB=$BASEDIRDOS"\\"$COMPILER"\\lib\\amd64;"$BASEDIRDOS"\\winsdk\\lib\\amd64;"$BASEDIRDOS"\\dxsdk\\lib\\amd64"
-elif [ $ARCH = "ia64" ]
-then
- export PATH=$PATH:$VCBINDIR/x86_ia64
- export WINEPATH=$BASEDIRDOS"\\"$COMPILER"\\bin\\x86_ia64;"
- export TARGET_CPU=IA64
- export LIB=$BASEDIRDOS"\\"$COMPILER"\\lib\\ia64;"$BASEDIRDOS"\\winsdk\\lib\\ia64"
-else
- echo "Bad arch $ARCH"
- return 1
-fi
-
-export LIBPATH=$LIB
-export PATH=$PATH:$VCBINDIR
-
-# PATH environment variable for Wine
-export WINEPATH=".;"$WINEPATH$BASEDIRDOS"\\"$COMPILER"\\bin;"$BASEDIRDOS"\\winsdk\\bin;"$BASEDIRDOS"\\bin;"$BASEDIRDOS"\\tools\\bin;"$BASEDIRDOS"\\perl\\perl\\bin"
-
-export WINEPREFIX=$BASEDIR/wine/$WINEVERSION
-
-mkdir -p $WINEPREFIX
-
-# launch WINE for the first time
-wine ping
-
-# Copy winemenubuilder.exe to wine to avoid missing X11 warnings
-#if [ -f $TOOLSBINDIR/winemenubuilder.exe ] && [ -d $WINEPREFIX/drive_c/windows/system32 ]
-#then
-# rm -f $WINEPREFIX/drive_c/windows/system32/winemenubuilder.exe
-# rm -f $WINEPREFIX/drive_c/windows/syswow64/winemenubuilder.exe
-# export WINEDLLOVERRIDES=winemenubuilder.exe=n
-#fi
-
-# delete fake manifests for VC++ 2008 runtimes
-#rm -rf $WINEPREFIX/drive_c/windows/winsxs/x86_microsoft.vc80*
-#rm -rf $WINEPREFIX/drive_c/windows/winsxs/manifests/x86_microsoft.vc80*
-#rm -f $WINEPREFIX/drive_c/windows/system32/msvcr80.dll
-#rm -rf $WINEPREFIX/drive_c/windows/winsxs/x86_microsoft.vc90*
-#rm -rf $WINEPREFIX/drive_c/windows/winsxs/manifests/x86_microsoft.vc90*
-#rm -f $WINEPREFIX/drive_c/windows/system32/msvcr90.dll
-#rm -f $WINEPREFIX/drive_c/windows/system32/msvcr100.dll
-#rm -f $WINEPREFIX/drive_c/windows/system32/msvcp100.dll
-
-# Remove all WINE warnings
-export WINEDEBUG=-all
-
-# Setting misc environment variables
-export QTDIR=Z:$BASEDIR/$COMPILER/qt
-export DXSDK_DIR=Z:$BASEDIR/dxsdk
-export VC_DIR=Z:$BASEDIR/$COMPILER
-#export MT_OPTIONS="-log /tmp/mt/log -verbose"
-
-echo "TARGET_CPU=$TARGET_CPU"
-echo "PATH=$PATH"
-echo "WINEPATH=$WINEPATH"
-echo "LIB=$LIB"
-echo "INCLUDE=$INCLUDE"
-
-export EXTERNAL_MSVC80_PATH=Z:$BASEDIR/vc8/external
-export EXTERNAL_MSVC90_PATH=Z:$BASEDIR/vc9/external
-export EXTERNAL_MSVC10_PATH=Z:$BASEDIR/vc10/external
-export EXTERNAL_MSVC11_PATH=Z:$BASEDIR/vc11/external
-export EXTERNAL_MSVC12_PATH=Z:$BASEDIR/vc12/external
-export EXTERNAL_MSVC14_PATH=Z:$BASEDIR/vc14/external
-
-if [ "$COMPILER" = "vc8" ]
-then
- export EXTERNAL_PATH=$EXTERNAL_MSVC80_PATH
-elif [ "$COMPILER" = "vc9" ]
-then
- export EXTERNAL_PATH=$EXTERNAL_MSVC90_PATH
-elif [ "$COMPILER" = "vc10" ]
-then
- export EXTERNAL_PATH=$EXTERNAL_MSVC10_PATH
-elif [ "$COMPILER" = "vc11" ]
-then
- export EXTERNAL_PATH=$EXTERNAL_MSVC11_PATH
-elif [ "$COMPILER" = "vc12" ]
-then
- export EXTERNAL_PATH=$EXTERNAL_MSVC12_PATH
- export WINEDLLOVERRIDES="msvcr120.dll=n"
-elif [ "$COMPILER" = "vc14" ]
-then
- export EXTERNAL_PATH=$EXTERNAL_MSVC14_PATH
-fi
-
-## Fin script windows ##
diff --git a/code/.clang-format b/code/.clang-format
deleted file mode 100644
index 90f4ab553..000000000
--- a/code/.clang-format
+++ /dev/null
@@ -1,24 +0,0 @@
----
-BasedOnStyle: WebKit
-AllowShortFunctionsOnASingleLine: All
-BraceWrapping:
- AfterClass: true
- AfterControlStatement: true
- AfterEnum: true
- AfterFunction: true
- AfterNamespace: true
- AfterObjCDeclaration: true
- AfterStruct: true
- AfterUnion: true
- BeforeCatch: true
- BeforeElse: true
- IndentBraces: false
-BreakBeforeBraces: Custom
-BreakConstructorInitializersBeforeComma: 'false'
-NamespaceIndentation: None
-PointerAlignment: Right
-SortIncludes: 'false'
-TabWidth: '4'
-UseTab: ForIndentation
-
-...
diff --git a/code/.editorconfig b/code/.editorconfig
deleted file mode 100644
index e4aef2c53..000000000
--- a/code/.editorconfig
+++ /dev/null
@@ -1,23 +0,0 @@
-; Top-most EditorConfig file
-root = true
-
-; 4-column tab indentation
-[*.cpp]
-indent_style = tab
-indent_size = 4
-
-[*.c]
-indent_style = tab
-indent_size = 4
-
-[*.h]
-indent_style = tab
-indent_size = 4
-
-[*.py]
-indent_style = tab
-indent_size = 4
-
-[*.config]
-indent_style = space
-indent_size = 2
diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt
index 4e5292f2a..67076ffa8 100644
--- a/code/CMakeLists.txt
+++ b/code/CMakeLists.txt
@@ -28,11 +28,15 @@ IF(COMMAND cmake_policy)
# have absolute paths (e.g. -lpthread)
cmake_policy(SET CMP0003 NEW)
+ # Works around warnings about escaped quotes in ADD_DEFINITIONS
+ # statements
+ cmake_policy(SET CMP0005 OLD)
+
# allow to link to qtmain automatically under Windows
IF(POLICY CMP0020)
CMAKE_POLICY(SET CMP0020 NEW)
ENDIF()
-ENDIF()
+ENDIF(COMMAND cmake_policy)
INCLUDE(nel)
INCLUDE(ConfigureChecks)
@@ -53,17 +57,12 @@ ENDIF()
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(RyzomCore CXX C)
-SET(NL_VERSION_MAJOR 1)
-SET(NL_VERSION_MINOR 0)
+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(RYZOM_VERSION_MAJOR 3)
-SET(RYZOM_VERSION_MINOR 2)
-SET(RYZOM_VERSION_PATCH 1)
-SET(REVISION 0)
-
#-----------------------------------------------------------------------------
# Redirect output files
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
@@ -72,15 +71,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
@@ -91,12 +90,14 @@ NL_SETUP_NELNS_DEFAULT_OPTIONS()
NL_SETUP_RYZOM_DEFAULT_OPTIONS()
NL_SETUP_SNOWBALLS_DEFAULT_OPTIONS()
-NL_SETUP_BUILD()
-NL_SETUP_BUILD_FLAGS()
-
NL_SETUP_PREFIX_PATHS()
RYZOM_SETUP_PREFIX_PATHS()
+NL_CONFIGURE_CHECKS()
+
+NL_SETUP_BUILD()
+NL_SETUP_BUILD_FLAGS()
+
#-----------------------------------------------------------------------------
#Platform specifics
@@ -107,8 +108,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)
@@ -117,29 +118,15 @@ FIND_PACKAGE(OpenSSL REQUIRED)
FIND_PACKAGE(GIF)
FIND_PACKAGE(Jpeg)
-IF(WIN32)
- SET(OPENSSL_LIBRARIES ${OPENSSL_LIBRARIES} Crypt32.lib)
-ENDIF()
-
-IF(WITH_LIBOVR)
- FIND_PACKAGE(LibOVR)
-ENDIF()
-
-IF(WITH_LIBVR)
- FIND_PACKAGE(LibVR)
-ENDIF()
-
-NL_CONFIGURE_CHECKS()
-
IF(WITH_STATIC_LIBXML2)
SET(LIBXML2_DEFINITIONS ${LIBXML2_DEFINITIONS} -DLIBXML_STATIC)
-ENDIF()
+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,53 +141,253 @@ 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(WITH_SSE3)
+ENDIF(WITH_SSE2)
+
+IF(APPLE_CERTIFICATE)
+ # Find codesign_allocate
+
+ # Xcode 7.0 and later versions
+ SET(CODESIGN_ALLOCATE ${OSX_DEVELOPER_ROOT}/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate)
+
+ IF(NOT EXISTS "${CODESIGN_ALLOCATE}")
+ # Xcode 6.4 and previous versions
+ SET(CODESIGN_ALLOCATE ${CMAKE_OSX_SYSROOT}/usr/bin/codesign_allocate)
+ ENDIF()
+
+ IF(NOT EXISTS "${CODESIGN_ALLOCATE}")
+ # System path
+ SET(CODESIGN_ALLOCATE /usr/bin/codesign_allocate)
+ ENDIF()
+
+ IF(NOT EXISTS "${CODESIGN_ALLOCATE}")
+ MESSAGE(WARNING "Unable to find codesign_allocate in standard directories")
+ SET(CODESIGN_ALLOCATE)
ENDIF()
ENDIF()
-IF(APPLE)
- FIND_LIBRARY(CARBON_FRAMEWORK Carbon)
- FIND_LIBRARY(FOUNDATION_FRAMEWORK Foundation)
- FIND_LIBRARY(SECURITY_FRAMEWORK Security)
-
- IF(APPLE_CERTIFICATE)
- # Find codesign_allocate
-
- # Xcode 7.0 and later versions
- SET(CODESIGN_ALLOCATE ${OSX_DEVELOPER_ROOT}/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate)
-
- IF(NOT EXISTS "${CODESIGN_ALLOCATE}")
- # Xcode 6.4 and previous versions
- SET(CODESIGN_ALLOCATE ${CMAKE_OSX_SYSROOT}/usr/bin/codesign_allocate)
- ENDIF()
-
- IF(NOT EXISTS "${CODESIGN_ALLOCATE}")
- # System path
- SET(CODESIGN_ALLOCATE /usr/bin/codesign_allocate)
- ENDIF()
-
- IF(NOT EXISTS "${CODESIGN_ALLOCATE}")
- MESSAGE(WARNING "Unable to find codesign_allocate in standard directories")
- SET(CODESIGN_ALLOCATE)
- ENDIF()
+MACRO(ADD_QT_LIBRARY _NAME)
+ IF(WIN32)
+ SET(_PREFIX "Qt5")
+ SET(_EXT "lib")
+ ELSE()
+ SET(_PREFIX "libQt5")
+ SET(_EXT "a")
ENDIF()
-ENDIF()
+ SET(_LIB "${QT_LIBRARY_DIR}/${_PREFIX}${_NAME}.${_EXT}")
+ IF(EXISTS ${_LIB})
+ SET(QT_LIBRARIES ${QT_LIBRARIES} optimized ${_LIB})
+ ENDIF()
+ SET(_LIB "${QT_LIBRARY_DIR}/${_PREFIX}${_NAME}d.${_EXT}")
+ IF(EXISTS ${_LIB})
+ SET(QT_LIBRARIES ${QT_LIBRARIES} debug ${_LIB})
+ ENDIF()
+ENDMACRO()
-INCLUDE(FindHelpers)
+MACRO(ADD_QT_PLUGIN _TYPE _NAME)
+ IF(WIN32)
+ SET(_PREFIX "")
+ SET(_EXT "lib")
+ ELSE()
+ SET(_PREFIX "lib")
+ SET(_EXT "a")
+ ENDIF()
+ SET(_LIB "${QT_PLUGINS_DIR}/${_TYPE}/${_PREFIX}${_NAME}.${_EXT}")
+ IF(EXISTS ${_LIB})
+ SET(QT_LIBRARIES ${QT_LIBRARIES} optimized ${_LIB})
+ ENDIF()
+ SET(_LIB "${QT_PLUGINS_DIR}/${_TYPE}/${_PREFIX}${_NAME}d.${_EXT}")
+ IF(EXISTS ${_LIB})
+ SET(QT_LIBRARIES ${QT_LIBRARIES} debug ${_LIB})
+ ENDIF()
+ENDMACRO()
IF(WITH_QT5)
- FIND_QT5()
+ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11 FATAL_ERROR)
+
+ SET(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ${QTDIR} $ENV{QTDIR})
+
+ FIND_PACKAGE(Qt5Core QUIET)
+
+ IF(Qt5Core_FOUND)
+ # Check if we are using Qt static or shared libraries
+ GET_TARGET_PROPERTY(_FILE Qt5::Core IMPORTED_LOCATION_RELEASE)
+
+ SET(QT_VERSION "${Qt5Core_VERSION_STRING}")
+ SET(_VERSION "${QT_VERSION}")
+
+ IF(_FILE MATCHES "\\.(lib|a)$")
+ SET(QT_STATIC ON)
+ SET(_VERSION "${_VERSION} static version")
+ ELSE()
+ SET(QT_STATIC OFF)
+ SET(_VERSION "${_VERSION} shared version")
+ ENDIF()
+
+ MESSAGE(STATUS "Found Qt ${_VERSION}")
+
+ # These variables are not defined with Qt5 CMake modules
+ SET(QT_BINARY_DIR "${_qt5Core_install_prefix}/bin")
+ SET(QT_LIBRARY_DIR "${_qt5Core_install_prefix}/lib")
+ SET(QT_PLUGINS_DIR "${_qt5Core_install_prefix}/plugins")
+ SET(QT_TRANSLATIONS_DIR "${_qt5Core_install_prefix}/translations")
+
+ # Fix wrong include directories with Qt 5 under Mac OS X
+ INCLUDE_DIRECTORIES("${_qt5Core_install_prefix}/include")
+
+ FIND_PACKAGE(Qt5Gui)
+ FIND_PACKAGE(Qt5Widgets)
+ FIND_PACKAGE(Qt5OpenGL)
+ FIND_PACKAGE(Qt5Xml)
+ FIND_PACKAGE(Qt5LinguistTools)
+ FIND_PACKAGE(Qt5Network)
+
+ IF(QT_STATIC)
+ ADD_DEFINITIONS(-DQT_STATICPLUGIN)
+
+ SET(QT_LIBRARIES Qt5::Widgets)
+
+ # Gui
+ SET(QT_LIBRARIES ${QT_LIBRARIES} Qt5::Gui Qt5::OpenGL)
+
+ ADD_QT_LIBRARY(PrintSupport)
+
+ IF(WIN32)
+ SET(QT_LIBRARIES ${QT_LIBRARIES}
+ ${WINSDK_LIBRARY_DIR}/Imm32.lib
+ ${WINSDK_LIBRARY_DIR}/OpenGL32.lib
+ ${WINSDK_LIBRARY_DIR}/WinMM.Lib)
+ ADD_QT_PLUGIN(platforms qwindows)
+ ADD_QT_LIBRARY(PlatformSupport)
+ ELSEIF(APPLE)
+ # Cups needs .dylib
+ SET(OLD_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
+ SET(CMAKE_FIND_LIBRARY_SUFFIXES .dylib)
+ FIND_LIBRARY(CUPS_LIBRARY cups)
+ SET(CMAKE_FIND_LIBRARY_SUFFIXES ${OLD_CMAKE_FIND_LIBRARY_SUFFIXES})
+
+ FIND_LIBRARY(IOKIT_FRAMEWORK IOKit)
+ FIND_LIBRARY(COCOA_FRAMEWORK Cocoa)
+ FIND_LIBRARY(SYSTEMCONFIGURATION_FRAMEWORK SystemConfiguration)
+ FIND_LIBRARY(OPENGL_FRAMEWORK NAMES OpenGL)
+
+ SET(QT_LIBRARIES ${QT_LIBRARIES}
+ ${CUPS_LIBRARY}
+ ${COCOA_FRAMEWORK}
+ ${SYSTEMCONFIGURATION_FRAMEWORK}
+ ${IOKIT_FRAMEWORK}
+ ${OPENGL_FRAMEWORK})
+
+ ADD_QT_PLUGIN(printsupport cocoaprintersupport)
+ ADD_QT_PLUGIN(platforms qcocoa)
+ ADD_QT_LIBRARY(PlatformSupport)
+ ELSE()
+ # order is very important there
+ ADD_QT_PLUGIN(platforms qxcb)
+ ADD_QT_PLUGIN(xcbglintegrations qxcb-glx-integration)
+
+ ADD_QT_LIBRARY(XcbQpa)
+ ADD_QT_LIBRARY(PlatformSupport)
+ 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()
+ SET(QT_LIBRARIES ${QT_LIBRARIES} -lfontconfig)
+ ADD_QT_LIBRARY(DBus)
+ ENDIF()
+
+ ADD_QT_PLUGIN(imageformats qgif)
+ ADD_QT_PLUGIN(imageformats qicns)
+ ADD_QT_PLUGIN(imageformats qico)
+ ADD_QT_PLUGIN(imageformats qjpeg)
+
+ # harfbuzz is needed since Qt 5.3
+ IF(UNIX)
+ SET(HB_LIB "${QT_LIBRARY_DIR}/libqtharfbuzzng.a")
+ ELSEIF(WIN32)
+ SET(HB_LIB "${QT_LIBRARY_DIR}/qtharfbuzzng.lib")
+ ENDIF()
+ IF(EXISTS ${HB_LIB})
+ SET(QT_LIBRARIES ${QT_LIBRARIES} ${HB_LIB})
+ ENDIF()
+
+ # freetype is needed since Qt 5.5
+ FIND_PACKAGE(FreeType)
+
+ IF(FREETYPE_FOUND)
+ SET(QT_LIBRARIES ${QT_LIBRARIES} ${FREETYPE_LIBRARIES})
+ ELSE()
+ IF(UNIX)
+ SET(FREETYPE_LIB "${QT_LIBRARY_DIR}/libqtfreetype.a")
+ ELSEIF(WIN32)
+ SET(FREETYPE_LIB "${QT_LIBRARY_DIR}/qtfreetype.lib")
+ ENDIF()
+ IF(EXISTS ${FREETYPE_LIB})
+ SET(QT_LIBRARIES ${QT_LIBRARIES} ${FREETYPE_LIB})
+ ENDIF()
+ ENDIF()
+
+ ADD_QT_PLUGIN(accessible qtaccessiblewidgets)
+
+ SET(QT_LIBRARIES ${QT_LIBRARIES} ${PNG_LIBRARIES} ${JPEG_LIBRARY})
+
+ # Network
+ SET(QT_LIBRARIES ${QT_LIBRARIES} Qt5::Network Qt5::Xml)
+ SET(QT_LIBRARIES ${QT_LIBRARIES} ${OPENSSL_LIBRARIES} ${ZLIB_LIBRARIES})
+
+ IF(WIN32)
+ SET(QT_LIBRARIES ${QT_LIBRARIES}
+ ${WINSDK_LIBRARY_DIR}/Crypt32.lib
+ ${WINSDK_LIBRARY_DIR}/WS2_32.Lib
+ ${WINSDK_LIBRARY_DIR}/IPHlpApi.Lib)
+ ENDIF()
+
+ # Core
+ SET(QT_LIBRARIES ${QT_LIBRARIES} Qt5::Core)
+
+ # pcre is needed since Qt 5.5
+ IF(UNIX)
+ SET(PCRE_LIB "${QT_LIBRARY_DIR}/libqtpcre.a")
+ ELSEIF(WIN32)
+ SET(PCRE_LIB "${QT_LIBRARY_DIR}/qtpcre.lib")
+ ENDIF()
+ IF(EXISTS ${PCRE_LIB})
+ SET(QT_LIBRARIES ${QT_LIBRARIES} ${PCRE_LIB})
+ ENDIF()
+
+ IF(APPLE)
+ FIND_LIBRARY(PCRE_LIBRARY pcre16 pcre)
+
+ FIND_LIBRARY(FOUNDATION_FRAMEWORK Foundation)
+ FIND_LIBRARY(CARBON_FRAMEWORK Carbon)
+ FIND_LIBRARY(SECURITY_FRAMEWORK Security)
+
+ SET(QT_LIBRARIES ${QT_LIBRARIES}
+ ${PCRE_LIBRARY}
+ ${FOUNDATION_FRAMEWORK}
+ ${CARBON_FRAMEWORK}
+ ${SECURITY_FRAMEWORK})
+ ELSEIF(UNIX)
+ SET(QT_LIBRARIES ${QT_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} -ldl -lrt)
+ ENDIF()
+ ELSE()
+ SET(QT_LIBRARIES Qt5::Widgets Qt5::Network Qt5::Xml Qt5::Gui Qt5::OpenGL Qt5::Core)
+ ENDIF()
+ ELSE()
+ MESSAGE(WARNING "Unable to find Qt 5")
+ ENDIF()
ENDIF()
IF(WITH_QT)
@@ -208,16 +395,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)
@@ -232,41 +419,22 @@ IF(WITH_NEL)
IF(CURL_STATIC)
SET(CURL_DEFINITIONS -DCURL_STATICLIB)
- LIST(APPEND CURL_INCLUDE_DIRS ${OPENSSL_INCLUDE_DIR})
- LIST(APPEND CURL_LIBRARIES ${OPENSSL_LIBRARIES})
+ SET(CURL_INCLUDE_DIRS ${CURL_INCLUDE_DIRS} ${OPENSSL_INCLUDE_DIR})
+ SET(CURL_LIBRARIES ${CURL_LIBRARIES} ${OPENSSL_LIBRARIES})
- IF(WIN32)
- LIST(APPEND CURL_LIBRARIES Crypt32 Cryptui)
- ELSE()
+ IF(UNIX)
# CURL depends on libidn
FIND_LIBRARY(IDN_LIBRARY idn)
IF(IDN_LIBRARY)
- LIST(APPEND CURL_LIBRARIES ${IDN_LIBRARY})
+ SET(CURL_LIBRARIES ${CURL_LIBRARIES} ${IDN_LIBRARY})
ENDIF()
- # CURL Macports version can depend on libidn, libidn2, libintl, libpsl and libiconv too
+ # CURL Macports version depends on libidn, libintl and libiconv too
IF(APPLE)
FIND_LIBRARY(INTL_LIBRARY intl)
IF(INTL_LIBRARY)
- LIST(APPEND CURL_LIBRARIES ${INTL_LIBRARY})
+ SET(CURL_LIBRARIES ${CURL_LIBRARIES} ${INTL_LIBRARY})
ENDIF()
-
- FIND_LIBRARY(IDN2_LIBRARY idn2)
- IF(IDN2_LIBRARY)
- LIST(APPEND CURL_LIBRARIES ${IDN2_LIBRARY})
- ENDIF()
-
- FIND_LIBRARY(PSL_LIBRARY psl)
- IF(PSL_LIBRARY)
- LIST(APPEND CURL_LIBRARIES ${PSL_LIBRARY})
- ENDIF()
-
- FIND_LIBRARY(UNISTRING_LIBRARY unistring)
- IF(UNISTRING_LIBRARY)
- LIST(APPEND CURL_LIBRARIES ${UNISTRING_LIBRARY})
- ENDIF()
-
- LIST(APPEND CURL_LIBRARIES ${SECURITY_FRAMEWORK})
ENDIF()
ENDIF()
ENDIF()
@@ -274,32 +442,19 @@ IF(WITH_NEL)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/nel/include)
ADD_SUBDIRECTORY(nel)
-
- # Aliases for targets
- SET(NELMISC_LIBRARIES nelmisc)
- SET(NELNET_LIBRARIES nelnet)
- SET(NELLIGO_LIBRARIES nelligo)
- SET(NELGEORGES_LIBRARIES nelgeorges)
- SET(NEL3D_LIBRARIES nel3d)
- SET(NELGUI_LIBRARIES nelgui)
- SET(NELSOUND_LIBRARIES nelsound)
-ELSE()
-# FIND_PACKAGE(NeL COMPONENTS 3d misc pacs sound nimp REQUIRED)
- FIND_PACKAGE(NeL REQUIRED)
- INCLUDE_DIRECTORIES(${NEL_INCLUDE_DIRS})
-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)
@@ -307,26 +462,22 @@ ENDIF()
IF(WITH_STUDIO)
ADD_SUBDIRECTORY(studio)
-ENDIF()
-
-IF(WITH_PERSONAL)
- ADD_SUBDIRECTORY(personal)
-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()
@@ -336,8 +487,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")
@@ -369,10 +520,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$"
@@ -390,8 +541,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
@@ -399,8 +550,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)
@@ -410,14 +561,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)
@@ -427,4 +578,4 @@ INCLUDE(CMakePackaging.txt)
#INCLUDE(UseDebian)
#IF(DEBIAN_FOUND)
# ADD_DEBIAN_TARGETS(nel)
-#ENDIF()
+#ENDIF(DEBIAN_FOUND)
diff --git a/code/CMakeModules/AndroidToolChain.cmake b/code/CMakeModules/AndroidToolChain.cmake
index 4ca702295..7135400e2 100644
--- a/code/CMakeModules/AndroidToolChain.cmake
+++ b/code/CMakeModules/AndroidToolChain.cmake
@@ -28,14 +28,14 @@ IF(TARGET_CPU STREQUAL "armv7")
SET(TOOLCHAIN_ARCH "arm")
SET(GCC_TOOLCHAIN_PREFIX "arm-linux-androideabi")
SET(TOOLCHAIN_BIN_PREFIX "arm-linux-androideabi")
- SET(MINIMUM_NDK_TARGET 9)
+ SET(MINIMUM_NDK_TARGET 4)
ELSEIF(TARGET_CPU STREQUAL "armv5")
SET(LIBRARY_ARCHITECTURE "armeabi")
SET(CMAKE_SYSTEM_PROCESSOR "armv5")
SET(TOOLCHAIN_ARCH "arm")
SET(GCC_TOOLCHAIN_PREFIX "arm-linux-androideabi")
SET(TOOLCHAIN_BIN_PREFIX "arm-linux-androideabi")
- SET(MINIMUM_NDK_TARGET 9)
+ SET(MINIMUM_NDK_TARGET 4)
ELSEIF(TARGET_CPU STREQUAL "arm64")
SET(LIBRARY_ARCHITECTURE "arm64-v8a")
SET(CMAKE_SYSTEM_PROCESSOR "arm64")
@@ -76,9 +76,14 @@ ELSE()
ENDIF()
SET(CLANG_TOOLCHAIN_PREFIX "llvm")
-SET(ANDROID_COMPILER "clang")
-SET(ANDROID_COMPILER "clang")
-SET(CLANG ON)
+SET(ANDROID_COMPILER "GCC")
+
+IF(NDK_TOOLCHAIN_VERSION STREQUAL "clang")
+ SET(ANDROID_COMPILER "clang")
+ SET(CLANG ON)
+ELSE()
+ SET(GCC_TOOLCHAIN_VERSION ${NDK_TOOLCHAIN_VERSION})
+ENDIF()
IF(NOT NDK_TARGET)
SET(NDK_TARGET ${MINIMUM_NDK_TARGET})
@@ -89,71 +94,88 @@ ELSE()
ENDIF()
IF(CMAKE_HOST_WIN32)
- SET(TOOLCHAIN_HOST "windows-x86_64")
+ SET(TOOLCHAIN_HOST "windows")
SET(TOOLCHAIN_BIN_SUFFIX ".exe")
ELSEIF(CMAKE_HOST_APPLE)
SET(TOOLCHAIN_HOST "apple")
SET(TOOLCHAIN_BIN_SUFFIX "")
ELSEIF(CMAKE_HOST_UNIX)
- SET(TOOLCHAIN_HOST "linux-x86_64")
+ SET(TOOLCHAIN_HOST "linux")
SET(TOOLCHAIN_BIN_SUFFIX "")
ENDIF()
-# clang
-SET(CLANG_TOOLCHAIN_ROOT "${NDK_ROOT}/toolchains/${CLANG_TOOLCHAIN_PREFIX}/prebuilt/${TOOLCHAIN_HOST}")
+MACRO(SEARCH_TOOLCHAIN _COMPILER)
+ SET(${_COMPILER}_TOOLCHAIN_VERSIONS)
+ FILE(GLOB _TOOLCHAIN_VERSIONS "${NDK_ROOT}/toolchains/${${_COMPILER}_TOOLCHAIN_PREFIX}-*")
+ IF(_TOOLCHAIN_VERSIONS)
+ LIST(SORT _TOOLCHAIN_VERSIONS)
+ LIST(REVERSE _TOOLCHAIN_VERSIONS)
+ FOREACH(_TOOLCHAIN_VERSION ${_TOOLCHAIN_VERSIONS})
+ STRING(REGEX REPLACE ".+${_PREFIX}-([0-9.]+)" "\\1" _TOOLCHAIN_VERSION "${_TOOLCHAIN_VERSION}")
+ IF(_TOOLCHAIN_VERSION MATCHES "^([0-9.]+)$")
+ LIST(APPEND ${_COMPILER}_TOOLCHAIN_VERSIONS ${_TOOLCHAIN_VERSION})
+ ENDIF()
+ ENDFOREACH()
+ ENDIF()
-IF(EXISTS ${CLANG_TOOLCHAIN_ROOT})
- MESSAGE(STATUS "Found LLVM toolchain in ${CLANG_TOOLCHAIN_ROOT}")
-ELSE()
- MESSAGE(FATAL_ERROR "No LLVM toolchain found in default search path ${CLANG_TOOLCHAIN_ROOT}")
-ENDIF()
+ # 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()
-# gcc
-SET(GCC_TOOLCHAIN_VERSIONS)
-FILE(GLOB _TOOLCHAIN_VERSIONS "${NDK_ROOT}/toolchains/${GCC_TOOLCHAIN_PREFIX}-*")
-IF(_TOOLCHAIN_VERSIONS)
- LIST(SORT _TOOLCHAIN_VERSIONS)
- LIST(REVERSE _TOOLCHAIN_VERSIONS)
- FOREACH(_TOOLCHAIN_VERSION ${_TOOLCHAIN_VERSIONS})
- STRING(REGEX REPLACE ".+${_PREFIX}-([0-9.]+)" "\\1" _TOOLCHAIN_VERSION "${_TOOLCHAIN_VERSION}")
- IF(_TOOLCHAIN_VERSION MATCHES "^([0-9.]+)$")
- LIST(APPEND GCC_TOOLCHAIN_VERSIONS ${_TOOLCHAIN_VERSION})
+ IF(NOT ${_COMPILER}_TOOLCHAIN_VERSIONS)
+ MESSAGE(FATAL_ERROR "No Android ${_COMPILER} toolchain found in default search path ${NDK_ROOT}/toolchains")
+ ENDIF()
+
+ IF(${_COMPILER}_TOOLCHAIN_VERSIONS)
+ LIST(FIND ${_COMPILER}_TOOLCHAIN_VERSIONS "${${_COMPILER}_TOOLCHAIN_VERSION}" _INDEX)
+ IF(_INDEX EQUAL -1)
+ LIST(GET ${_COMPILER}_TOOLCHAIN_VERSIONS 0 ${_COMPILER}_TOOLCHAIN_VERSION)
ENDIF()
- ENDFOREACH()
-ENDIF()
-
-IF(NOT GCC_TOOLCHAIN_VERSIONS)
- MESSAGE(FATAL_ERROR "No GCC version found in default search path ${NDK_ROOT}/toolchains")
-ENDIF()
-
-IF(GCC_TOOLCHAIN_VERSIONS)
- LIST(FIND GCC_TOOLCHAIN_VERSIONS "${GCC_TOOLCHAIN_VERSION}" _INDEX)
- IF(_INDEX EQUAL -1)
- LIST(GET GCC_TOOLCHAIN_VERSIONS 0 GCC_TOOLCHAIN_VERSION)
+ ELSE()
+ LIST(GET ${_COMPILER}_TOOLCHAIN_VERSIONS 0 ${_COMPILER}_TOOLCHAIN_VERSION)
ENDIF()
-ELSE()
- LIST(GET GCC_TOOLCHAIN_VERSIONS 0 GCC_TOOLCHAIN_VERSION)
-ENDIF()
-SET(GCC_TOOLCHAIN_ROOT "${NDK_ROOT}/toolchains/${GCC_TOOLCHAIN_PREFIX}-${GCC_TOOLCHAIN_VERSION}/prebuilt/${TOOLCHAIN_HOST}")
+ MESSAGE(STATUS "TOOLCHAIN_PREFIX = ${${_COMPILER}_TOOLCHAIN_VERSION}")
-IF(NOT EXISTS "${GCC_TOOLCHAIN_ROOT}")
- FILE(GLOB _TOOLCHAIN_PREFIXES "${GCC_TOOLCHAIN_ROOT}*")
- IF(_TOOLCHAIN_PREFIXES)
- LIST(GET _TOOLCHAIN_PREFIXES 0 GCC_TOOLCHAIN_ROOT)
+ IF("${${_COMPILER}_TOOLCHAIN_VERSION}" STREQUAL "default")
+ MESSAGE(STATUS "default")
+ SET(${_COMPILER}_TOOLCHAIN_ROOT "${NDK_ROOT}/toolchains/${${_COMPILER}_TOOLCHAIN_PREFIX}/prebuilt/${TOOLCHAIN_HOST}")
+ ELSE()
+ MESSAGE(STATUS "not default")
+ SET(${_COMPILER}_TOOLCHAIN_ROOT "${NDK_ROOT}/toolchains/${${_COMPILER}_TOOLCHAIN_PREFIX}-${${_COMPILER}_TOOLCHAIN_VERSION}/prebuilt/${TOOLCHAIN_HOST}")
ENDIF()
+
+ IF(NOT EXISTS "${${_COMPILER}_TOOLCHAIN_ROOT}")
+ FILE(GLOB _TOOLCHAIN_PREFIXES "${${_COMPILER}_TOOLCHAIN_ROOT}*")
+ IF(_TOOLCHAIN_PREFIXES)
+ LIST(GET _TOOLCHAIN_PREFIXES 0 ${_COMPILER}_TOOLCHAIN_ROOT)
+ ENDIF()
+ ENDIF()
+ENDMACRO()
+
+IF(CLANG)
+ SEARCH_TOOLCHAIN(CLANG)
+
+ MESSAGE(STATUS "Target Android NDK ${NDK_TARGET} and use clang ${CLANG_TOOLCHAIN_VERSION}")
ENDIF()
-IF(EXISTS "${GCC_TOOLCHAIN_ROOT}")
- MESSAGE(STATUS "Found GCC toolchain in ${GCC_TOOLCHAIN_ROOT}")
-ELSE()
- MESSAGE(FATAL_ERROR "No GCC toolchain found in default search path ${GCC_TOOLCHAIN_ROOT}")
+SEARCH_TOOLCHAIN(GCC)
+
+MESSAGE(STATUS "Target Android NDK ${NDK_TARGET} and use GCC ${GCC_TOOLCHAIN_VERSION}")
+
+IF(CLANG_TOOLCHAIN_ROOT)
+ MESSAGE(STATUS "Found Android LLVM toolchain in ${CLANG_TOOLCHAIN_ROOT}")
+ENDIF()
+
+IF(GCC_TOOLCHAIN_ROOT)
+ MESSAGE(STATUS "Found Android GCC toolchain in ${GCC_TOOLCHAIN_ROOT}")
ENDIF()
-# NDK
SET(PLATFORM_ROOT "${NDK_ROOT}/platforms/android-${NDK_TARGET}/arch-${TOOLCHAIN_ARCH}")
-MESSAGE(STATUS "Target Android NDK ${NDK_TARGET} found in ${PLATFORM_ROOT}")
+MESSAGE(STATUS "Found Android platform in ${PLATFORM_ROOT}")
# include dirs
SET(PLATFORM_INCLUDE_DIR "${PLATFORM_ROOT}/usr/include")
@@ -186,29 +208,41 @@ MACRO(SET_TOOLCHAIN_BINARY_GCC _NAME _BINARY)
SET(${_NAME} ${GCC_TOOLCHAIN_ROOT}/bin/${TOOLCHAIN_BIN_PREFIX}-${_BINARY}${TOOLCHAIN_BIN_SUFFIX} CACHE PATH "" FORCE)
ENDMACRO()
-SET(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
+# Force the compilers to GCC for Android
+include (CMakeForceCompiler)
-SET_TOOLCHAIN_BINARY_LLVM(CMAKE_C_COMPILER clang)
-SET_TOOLCHAIN_BINARY_LLVM(CMAKE_CXX_COMPILER clang++)
+IF(CLANG)
+ MESSAGE(STATUS "Using clang compiler")
-SET(CMAKE_C_COMPILER ${CMAKE_C_COMPILER})
-SET(CMAKE_C_COMPILER_TARGET ${TOOLCHAIN_BIN_PREFIX})
-SET(CMAKE_C_COMPILER_FORCED TRUE)
+ SET_TOOLCHAIN_BINARY_LLVM(CMAKE_C_COMPILER clang)
+ SET_TOOLCHAIN_BINARY_LLVM(CMAKE_CXX_COMPILER clang++)
-SET(CMAKE_CXX_COMPILER ${CMAKE_CXX_COMPILER})
-SET(CMAKE_CXX_COMPILER_TARGET ${TOOLCHAIN_BIN_PREFIX})
-SET(CMAKE_CXX_COMPILER_FORCED TRUE)
+ CMAKE_FORCE_C_COMPILER(${CMAKE_C_COMPILER} clang)
+ CMAKE_FORCE_CXX_COMPILER(${CMAKE_CXX_COMPILER} 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++)
+ SET_TOOLCHAIN_BINARY_LLVM(CMAKE_ASM_COMPILER llvm-as)
+ SET_TOOLCHAIN_BINARY_LLVM(CMAKE_AR llvm-ar)
+ SET_TOOLCHAIN_BINARY_LLVM(CMAKE_LINKER clang++)
+
+ IF(NOT EXISTS "${CMAKE_ASM_COMPILER}")
+ SET_TOOLCHAIN_BINARY_GCC(CMAKE_ASM_COMPILER as)
+ ENDIF()
+
+ IF(NOT EXISTS "${CMAKE_AR}")
+ SET_TOOLCHAIN_BINARY_GCC(CMAKE_AR ar)
+ ENDIF()
+ELSE()
+ MESSAGE(STATUS "Using GCC compiler")
+
+ SET_TOOLCHAIN_BINARY_GCC(CMAKE_C_COMPILER gcc)
+ SET_TOOLCHAIN_BINARY_GCC(CMAKE_CXX_COMPILER g++)
+
+ CMAKE_FORCE_C_COMPILER(${CMAKE_C_COMPILER} GNU)
+ CMAKE_FORCE_CXX_COMPILER(${CMAKE_CXX_COMPILER} GNU)
-IF(NOT EXISTS "${CMAKE_ASM_COMPILER}")
SET_TOOLCHAIN_BINARY_GCC(CMAKE_ASM_COMPILER as)
-ENDIF()
-
-IF(NOT EXISTS "${CMAKE_AR}")
SET_TOOLCHAIN_BINARY_GCC(CMAKE_AR ar)
+ SET_TOOLCHAIN_BINARY_GCC(CMAKE_LINKER ld)
ENDIF()
SET_TOOLCHAIN_BINARY_GCC(CMAKE_STRIP strip)
diff --git a/code/CMakeModules/CheckDepends.cmake b/code/CMakeModules/CheckDepends.cmake
index 701dcd48b..d2fbe06e1 100644
--- a/code/CMakeModules/CheckDepends.cmake
+++ b/code/CMakeModules/CheckDepends.cmake
@@ -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)
diff --git a/code/CMakeModules/ConfigureChecks.cmake b/code/CMakeModules/ConfigureChecks.cmake
index cab7a08c1..3929d65c9 100644
--- a/code/CMakeModules/ConfigureChecks.cmake
+++ b/code/CMakeModules/ConfigureChecks.cmake
@@ -40,15 +40,14 @@ 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)
SET(COPYRIGHT "${YEAR} ${AUTHOR}")
IF(NOT RYZOM_CLIENT_ICON)
- SET(RYZOM_CLIENT_ICON "khanat_client")
+ SET(RYZOM_CLIENT_ICON "ryzom_client")
ENDIF()
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/config.h.cmake ${CMAKE_BINARY_DIR}/config.h)
diff --git a/code/CMakeModules/Find3dsMaxSDK.cmake b/code/CMakeModules/Find3dsMaxSDK.cmake
index cb00df78e..bde126208 100644
--- a/code/CMakeModules/Find3dsMaxSDK.cmake
+++ b/code/CMakeModules/Find3dsMaxSDK.cmake
@@ -11,56 +11,17 @@ if(MAXSDK_INCLUDE_DIR)
SET(MAXSDK_FIND_QUIETLY TRUE)
endif()
-set(_pf_x86 "PROGRAMFILES(x86)")
-
FIND_PATH(MAXSDK_DIR
"include/maxversion.h"
HINTS
"$ENV{MAXSDK_DIR}"
PATHS
- "$ENV{ADSK_3DSMAX_SDK_2021}/maxsdk"
- "$ENV{ADSK_3DSMAX_SDK_2020}/maxsdk"
- "$ENV{ADSK_3DSMAX_SDK_2019}/maxsdk"
- "$ENV{ADSK_3DSMAX_SDK_2018}/maxsdk"
- "$ENV{ADSK_3DSMAX_SDK_2017}/maxsdk"
- "$ENV{ADSK_3DSMAX_SDK_2016}/maxsdk"
- "$ENV{ADSK_3DSMAX_SDK_2015}/maxsdk"
- "$ENV{ADSK_3DSMAX_SDK_2014}/maxsdk"
- "$ENV{ADSK_3DSMAX_SDK_2013}/maxsdk"
"$ENV{ADSK_3DSMAX_SDK_2012}/maxsdk"
"$ENV{3DSMAX_2011_SDK_PATH}/maxsdk"
- "$ENV{${_pf_x86}}/Autodesk/3ds Max 2021 SDK/maxsdk"
- "$ENV{${_pf_x86}}/Autodesk/3ds Max 2020 SDK/maxsdk"
- "$ENV{${_pf_x86}}/Autodesk/3ds Max 2019 SDK/maxsdk"
- "$ENV{${_pf_x86}}/Autodesk/3ds Max 2018 SDK/maxsdk"
- "$ENV{${_pf_x86}}/Autodesk/3ds Max 2017 SDK/maxsdk"
- "$ENV{${_pf_x86}}/Autodesk/3ds Max 2016 SDK/maxsdk"
- "$ENV{${_pf_x86}}/Autodesk/3ds Max 2015 SDK/maxsdk"
- "$ENV{${_pf_x86}}/Autodesk/3ds Max 2014 SDK/maxsdk"
- "$ENV{${_pf_x86}}/Autodesk/3ds Max 2013 SDK/maxsdk"
- "$ENV{${_pf_x86}}/Autodesk/3ds Max 2012 SDK/maxsdk"
- "$ENV{${_pf_x86}}/Autodesk/3ds Max 2011 SDK/maxsdk"
- "$ENV{${_pf_x86}}/Autodesk/3ds Max 2010 SDK/maxsdk"
- "$ENV{${_pf_x86}}/Autodesk/3ds Max 2009 SDK/maxsdk"
- "$ENV{${_pf_x86}}/Autodesk/3ds Max 2008 SDK/maxsdk"
- "$ENV{${_pf_x86}}/Autodesk/3ds Max 9 SDK/maxsdk"
- "$ENV{${_pf_x86}}/Autodesk/3dsMax8/maxsdk"
- "$ENV{PROGRAMFILES}/Autodesk/3ds Max 2021 SDK/maxsdk"
- "$ENV{PROGRAMFILES}/Autodesk/3ds Max 2020 SDK/maxsdk"
- "$ENV{PROGRAMFILES}/Autodesk/3ds Max 2019 SDK/maxsdk"
- "$ENV{PROGRAMFILES}/Autodesk/3ds Max 2018 SDK/maxsdk"
- "$ENV{PROGRAMFILES}/Autodesk/3ds Max 2017 SDK/maxsdk"
- "$ENV{PROGRAMFILES}/Autodesk/3ds Max 2016 SDK/maxsdk"
- "$ENV{PROGRAMFILES}/Autodesk/3ds Max 2015 SDK/maxsdk"
- "$ENV{PROGRAMFILES}/Autodesk/3ds Max 2014 SDK/maxsdk"
- "$ENV{PROGRAMFILES}/Autodesk/3ds Max 2013 SDK/maxsdk"
- "$ENV{PROGRAMFILES}/Autodesk/3ds Max 2012 SDK/maxsdk"
- "$ENV{PROGRAMFILES}/Autodesk/3ds Max 2011 SDK/maxsdk"
"$ENV{PROGRAMFILES}/Autodesk/3ds Max 2010 SDK/maxsdk"
"$ENV{PROGRAMFILES}/Autodesk/3ds Max 2009 SDK/maxsdk"
"$ENV{PROGRAMFILES}/Autodesk/3ds Max 2008 SDK/maxsdk"
"$ENV{PROGRAMFILES}/Autodesk/3ds Max 9 SDK/maxsdk"
- "$ENV{PROGRAMFILES}/Autodesk/3dsMax8/maxsdk"
)
FIND_PATH(MAXSDK_INCLUDE_DIR
@@ -75,12 +36,12 @@ FIND_PATH(MAXSDK_CS_INCLUDE_DIR bipexp.h
)
IF(TARGET_X64)
- SET(MAXSDK_LIBRARY_DIRS ${MAXSDK_DIR}/x64/lib ${MAXSDK_DIR}/lib/x64/Release)
+ SET(MAXSDK_LIBRARY_DIRS ${MAXSDK_DIR}/x64/lib)
ELSE()
SET(MAXSDK_LIBRARY_DIRS ${MAXSDK_DIR}/lib)
ENDIF()
-MACRO(FIND_3DS_LIBRARY MYLIBRARY MYLIBRARYNAME)
+MACRO(FIND_3DS_LIBRARY MYLIBRARY MYLIBRARYNAME)
FIND_LIBRARY(${MYLIBRARY}
NAMES ${MYLIBRARYNAME}
HINTS
@@ -112,28 +73,10 @@ if(MAXSDK_FOUND)
${MAXSDK_MAXUTIL_LIBRARY}
${MAXSDK_MAXSCRIPT_LIBRARY}
${MAXSDK_PARAMBLK2_LIBRARY}
- ${MAXSDK_BMM_LIBRARY})
+ ${MAXSDK_BMM_LIBRARY} )
- # parse maxversion.h to determine SDK version
- IF(EXISTS "${MAXSDK_DIR}/include/maxversion.h")
- FILE(STRINGS "${MAXSDK_DIR}/include/maxversion.h" LINES REGEX "#define MAX_PRODUCT_YEAR_NUMBER ([0-9]+)")
-
- STRING(REGEX REPLACE ".+MAX_PRODUCT_YEAR_NUMBER ([0-9]+)" "\\1" MAXSDK_VERSION "${LINES}")
- UNSET(LINES)
- ELSE()
- SET(MAXSDK_VERSION "Unknown")
- ENDIF()
-
- MESSAGE(STATUS "Found 3dsmax version ${MAXSDK_VERSION} in ${MAXSDK_DIR}")
-
- # 3ds Max 2013 and later are always Unicode
- IF(MAXSDK_VERSION VERSION_GREATER 2012)
- SET(MAXSDK_DEFINITIONS -DUNICODE -D_UNICODE)
- ELSE()
- SET(MAXSDK_DEFINITIONS)
- ENDIF()
-ELSE()
+else(MAXSDK_FOUND)
set(MAXSDK_LIBRARIES)
-ENDIF()
+endif(MAXSDK_FOUND)
mark_as_advanced(MAXSDK_INCLUDE_DIR MAXSDK_LIBRARY)
diff --git a/code/CMakeModules/FindCEGUI.cmake b/code/CMakeModules/FindCEGUI.cmake
index 3259574fc..a939ebfb7 100644
--- a/code/CMakeModules/FindCEGUI.cmake
+++ b/code/CMakeModules/FindCEGUI.cmake
@@ -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)
diff --git a/code/CMakeModules/FindCppTest.cmake b/code/CMakeModules/FindCppTest.cmake
index 7dc2aa35d..f5f823f69 100644
--- a/code/CMakeModules/FindCppTest.cmake
+++ b/code/CMakeModules/FindCppTest.cmake
@@ -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)
diff --git a/code/CMakeModules/FindCustomMFC.cmake b/code/CMakeModules/FindCustomMFC.cmake
index b71e4a8d8..45d5b8cce 100644
--- a/code/CMakeModules/FindCustomMFC.cmake
+++ b/code/CMakeModules/FindCustomMFC.cmake
@@ -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,15 +33,15 @@ 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})
# Set definitions for using MFC in DLL
- SET(MFC_DEFINITIONS -D_AFXDLL -DUNICODE -D_UNICODE)
+ SET(MFC_DEFINITIONS -D_AFXDLL)
# Set CMake flag to use MFC DLL
SET(CMAKE_MFC_FLAG 2)
diff --git a/code/CMakeModules/FindDSound.cmake b/code/CMakeModules/FindDSound.cmake
index dde5212ab..beddf7f99 100644
--- a/code/CMakeModules/FindDSound.cmake
+++ b/code/CMakeModules/FindDSound.cmake
@@ -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)
diff --git a/code/CMakeModules/FindDirectXSDK.cmake b/code/CMakeModules/FindDirectXSDK.cmake
index 4519ef16d..847a6d596 100644
--- a/code/CMakeModules/FindDirectXSDK.cmake
+++ b/code/CMakeModules/FindDirectXSDK.cmake
@@ -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"
diff --git a/code/CMakeModules/FindEFXUtil.cmake b/code/CMakeModules/FindEFXUtil.cmake
index 628a0eba5..5e2f410b0 100644
--- a/code/CMakeModules/FindEFXUtil.cmake
+++ b/code/CMakeModules/FindEFXUtil.cmake
@@ -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)
diff --git a/code/CMakeModules/FindExternal.cmake b/code/CMakeModules/FindExternal.cmake
index 8364026cd..80b3eda0c 100644
--- a/code/CMakeModules/FindExternal.cmake
+++ b/code/CMakeModules/FindExternal.cmake
@@ -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}
diff --git a/code/CMakeModules/FindFFmpeg.cmake b/code/CMakeModules/FindFFmpeg.cmake
deleted file mode 100644
index 96cbb6ed0..000000000
--- a/code/CMakeModules/FindFFmpeg.cmake
+++ /dev/null
@@ -1,173 +0,0 @@
-# vim: ts=2 sw=2
-# - Try to find the required ffmpeg components(default: AVFORMAT, AVUTIL, AVCODEC)
-#
-# Once done this will define
-# FFMPEG_FOUND - System has the all required components.
-# FFMPEG_INCLUDE_DIRS - Include directory necessary for using the required components headers.
-# FFMPEG_LIBRARIES - Link these to use the required ffmpeg components.
-# FFMPEG_DEFINITIONS - Compiler switches required for using the required ffmpeg components.
-#
-# For each of the components it will additionaly set.
-# - AVCODEC
-# - AVDEVICE
-# - AVFORMAT
-# - AVUTIL
-# - POSTPROC
-# - SWSCALE
-# - SWRESAMPLE
-# the following variables will be defined
-# _FOUND - System has
-# _INCLUDE_DIRS - Include directory necessary for using the headers
-# _LIBRARIES - Link these to use
-# _DEFINITIONS - Compiler switches required for using
-# _VERSION - The components version
-#
-# Copyright (c) 2006, Matthias Kretz,
-# Copyright (c) 2008, Alexander Neundorf,
-# Copyright (c) 2011, Michael Jansen,
-#
-# Redistribution and use is allowed according to the terms of the BSD license.
-
-include(FindPackageHandleStandardArgs)
-
-if(NOT FFmpeg_FIND_COMPONENTS)
- set(FFmpeg_FIND_COMPONENTS AVFORMAT AVCODEC AVUTIL)
-endif()
-
-#
-### Macro: set_component_found
-#
-# Marks the given component as found if both *_LIBRARIES AND *_INCLUDE_DIRS is present.
-#
-macro(set_component_found _component)
- if(${_component}_LIBRARIES AND ${_component}_INCLUDE_DIRS)
- # message(STATUS " - ${_component} found.")
- set(${_component}_FOUND TRUE)
- else()
- # message(STATUS " - ${_component} not found.")
- endif()
-endmacro()
-
-#
-### Macro: find_component
-#
-# Checks for the given component by invoking pkgconfig and then looking up the libraries and
-# include directories.
-#
-macro(find_component _component _pkgconfig _library _header)
- if(NOT WIN32)
- # use pkg-config to get the directories and then use these values
- # in the FIND_PATH() and FIND_LIBRARY() calls
- find_package(PkgConfig)
- if(PKG_CONFIG_FOUND)
- pkg_check_modules(PC_${_component} ${_pkgconfig})
- endif()
- endif()
-
- find_path(${_component}_INCLUDE_DIRS ${_header}
- HINTS
- ${FFMPEGSDK_INC}
- ${PC_LIB${_component}_INCLUDEDIR}
- ${PC_LIB${_component}_INCLUDE_DIRS}
- PATH_SUFFIXES
- ffmpeg
- )
-
- find_library(${_component}_LIBRARIES NAMES ${_library}
- HINTS
- ${FFMPEGSDK_LIB}
- ${PC_LIB${_component}_LIBDIR}
- ${PC_LIB${_component}_LIBRARY_DIRS}
- )
-
- STRING(REGEX REPLACE "/.*" "/version.h" _ver_header ${_header})
- if(EXISTS "${${_component}_INCLUDE_DIRS}/${_ver_header}")
- file(STRINGS "${${_component}_INCLUDE_DIRS}/${_ver_header}" version_str REGEX "^#define[\t ]+LIB${_component}_VERSION_M.*")
-
- foreach(_str "${version_str}")
- if(NOT version_maj)
- string(REGEX REPLACE "^.*LIB${_component}_VERSION_MAJOR[\t ]+([0-9]*).*$" "\\1" version_maj "${_str}")
- endif()
- if(NOT version_min)
- string(REGEX REPLACE "^.*LIB${_component}_VERSION_MINOR[\t ]+([0-9]*).*$" "\\1" version_min "${_str}")
- endif()
- if(NOT version_mic)
- string(REGEX REPLACE "^.*LIB${_component}_VERSION_MICRO[\t ]+([0-9]*).*$" "\\1" version_mic "${_str}")
- endif()
- endforeach()
- unset(version_str)
-
- set(${_component}_VERSION "${version_maj}.${version_min}.${version_mic}" CACHE STRING "The ${_component} version number.")
- unset(version_maj)
- unset(version_min)
- unset(version_mic)
- endif(EXISTS "${${_component}_INCLUDE_DIRS}/${_ver_header}")
- set(${_component}_VERSION ${PC_${_component}_VERSION} CACHE STRING "The ${_component} version number.")
- set(${_component}_DEFINITIONS ${PC_${_component}_CFLAGS_OTHER} CACHE STRING "The ${_component} CFLAGS.")
-
- set_component_found(${_component})
-
- mark_as_advanced(
- ${_component}_INCLUDE_DIRS
- ${_component}_LIBRARIES
- ${_component}_DEFINITIONS
- ${_component}_VERSION)
-endmacro()
-
-
-set(FFMPEGSDK $ENV{FFMPEG_HOME})
-if(FFMPEGSDK)
- set(FFMPEGSDK_INC "${FFMPEGSDK}/include")
- set(FFMPEGSDK_LIB "${FFMPEGSDK}/lib")
-endif()
-
-# Check for all possible components.
-find_component(AVCODEC libavcodec avcodec libavcodec/avcodec.h)
-find_component(AVFORMAT libavformat avformat libavformat/avformat.h)
-find_component(AVDEVICE libavdevice avdevice libavdevice/avdevice.h)
-find_component(AVUTIL libavutil avutil libavutil/avutil.h)
-find_component(SWSCALE libswscale swscale libswscale/swscale.h)
-find_component(SWRESAMPLE libswresample swresample libswresample/swresample.h)
-find_component(POSTPROC libpostproc postproc libpostproc/postprocess.h)
-
-# Check if the required components were found and add their stuff to the FFMPEG_* vars.
-foreach(_component ${FFmpeg_FIND_COMPONENTS})
- if(${_component}_FOUND)
- # message(STATUS "Required component ${_component} present.")
- set(FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} ${${_component}_LIBRARIES})
- set(FFMPEG_DEFINITIONS ${FFMPEG_DEFINITIONS} ${${_component}_DEFINITIONS})
- list(APPEND FFMPEG_INCLUDE_DIRS ${${_component}_INCLUDE_DIRS})
- else()
- # message(STATUS "Required component ${_component} missing.")
- endif()
-endforeach()
-
-# Build the include path and library list with duplicates removed.
-if(FFMPEG_INCLUDE_DIRS)
- list(REMOVE_DUPLICATES FFMPEG_INCLUDE_DIRS)
-endif()
-
-if(FFMPEG_LIBRARIES)
- list(REMOVE_DUPLICATES FFMPEG_LIBRARIES)
-endif()
-
-# cache the vars.
-set(FFMPEG_INCLUDE_DIRS ${FFMPEG_INCLUDE_DIRS} CACHE STRING "The FFmpeg include directories." FORCE)
-set(FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} CACHE STRING "The FFmpeg libraries." FORCE)
-set(FFMPEG_DEFINITIONS ${FFMPEG_DEFINITIONS} CACHE STRING "The FFmpeg cflags." FORCE)
-
-mark_as_advanced(FFMPEG_INCLUDE_DIRS FFMPEG_LIBRARIES FFMPEG_DEFINITIONS)
-
-# Now set the noncached _FOUND vars for the components.
-foreach(_component AVCODEC AVDEVICE AVFORMAT AVUTIL POSTPROCESS SWRESAMPLE SWSCALE)
- set_component_found(${_component})
-endforeach ()
-
-# Compile the list of required vars
-set(_FFmpeg_REQUIRED_VARS FFMPEG_LIBRARIES FFMPEG_INCLUDE_DIRS)
-foreach(_component ${FFmpeg_FIND_COMPONENTS})
- list(APPEND _FFmpeg_REQUIRED_VARS ${_component}_LIBRARIES ${_component}_INCLUDE_DIRS)
-endforeach()
-
-# Give a nice error message if some of the required vars are missing.
-find_package_handle_standard_args(FFmpeg DEFAULT_MSG ${_FFmpeg_REQUIRED_VARS})
diff --git a/code/CMakeModules/FindFMOD.cmake b/code/CMakeModules/FindFMOD.cmake
index b28f77b1e..f85795142 100644
--- a/code/CMakeModules/FindFMOD.cmake
+++ b/code/CMakeModules/FindFMOD.cmake
@@ -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)
diff --git a/code/CMakeModules/FindFreeType.cmake b/code/CMakeModules/FindFreeType.cmake
index d101607b4..f6b827899 100644
--- a/code/CMakeModules/FindFreeType.cmake
+++ b/code/CMakeModules/FindFreeType.cmake
@@ -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)
diff --git a/code/CMakeModules/FindGLIB2.cmake b/code/CMakeModules/FindGLIB2.cmake
deleted file mode 100644
index 942b04530..000000000
--- a/code/CMakeModules/FindGLIB2.cmake
+++ /dev/null
@@ -1,217 +0,0 @@
-# - Try to find GLib2
-# Once done this will define
-#
-# GLIB2_FOUND - system has GLib2
-# GLIB2_INCLUDE_DIRS - the GLib2 include directory
-# GLIB2_LIBRARIES - Link these to use GLib2
-#
-# HAVE_GLIB_GREGEX_H glib has gregex.h header and
-# supports g_regex_match_simple
-#
-# Copyright (c) 2006 Andreas Schneider
-# Copyright (c) 2006 Philippe Bernery
-# Copyright (c) 2007 Daniel Gollub
-# Copyright (c) 2007 Alban Browaeys
-# Copyright (c) 2008 Michael Bell
-# Copyright (c) 2008 Bjoern Ricks
-#
-# Redistribution and use is allowed according to the terms of the New
-# BSD license.
-# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
-#
-
-
-IF (GLIB2_LIBRARIES AND GLIB2_INCLUDE_DIRS )
- # in cache already
- SET(GLIB2_FOUND TRUE)
-ELSE (GLIB2_LIBRARIES AND GLIB2_INCLUDE_DIRS )
-
- INCLUDE(FindPkgConfig)
-
- ## Glib
- IF ( GLIB2_FIND_REQUIRED )
- SET( _pkgconfig_REQUIRED "REQUIRED" )
- ELSE ( GLIB2_FIND_REQUIRED )
- SET( _pkgconfig_REQUIRED "" )
- ENDIF ( GLIB2_FIND_REQUIRED )
-
- IF ( GLIB2_MIN_VERSION )
- PKG_SEARCH_MODULE( GLIB2 ${_pkgconfig_REQUIRED} glib-2.0>=${GLIB2_MIN_VERSION} )
- ELSE ( GLIB2_MIN_VERSION )
- PKG_SEARCH_MODULE( GLIB2 ${_pkgconfig_REQUIRED} glib-2.0 )
- ENDIF ( GLIB2_MIN_VERSION )
- IF ( PKG_CONFIG_FOUND )
- IF ( GLIB2_FOUND )
- SET ( GLIB2_CORE_FOUND TRUE )
- ELSE ( GLIB2_FOUND )
- SET ( GLIB2_CORE_FOUND FALSE )
- ENDIF ( GLIB2_FOUND )
- ENDIF ( PKG_CONFIG_FOUND )
-
- # Look for glib2 include dir and libraries w/o pkgconfig
- IF ( NOT GLIB2_FOUND AND NOT PKG_CONFIG_FOUND )
- FIND_PATH(
- _glibconfig_include_DIR
- NAMES
- glibconfig.h
- PATHS
- /opt/gnome/lib64
- /opt/gnome/lib
- /opt/lib/
- /opt/local/lib
- /sw/lib/
- /usr/lib64
- /usr/lib
- /usr/local/include
- ${CMAKE_LIBRARY_PATH}
- PATH_SUFFIXES
- glib-2.0/include
- )
-
- FIND_PATH(
- _glib2_include_DIR
- NAMES
- glib.h
- PATHS
- /opt/gnome/include
- /opt/local/include
- /sw/include
- /usr/include
- /usr/local/include
- PATH_SUFFIXES
- glib-2.0
- )
-
- #MESSAGE(STATUS "Glib headers: ${_glib2_include_DIR}")
-
- FIND_LIBRARY(
- _glib2_link_DIR
- NAMES
- glib-2.0
- glib
- PATHS
- /opt/gnome/lib
- /opt/local/lib
- /sw/lib
- /usr/lib
- /usr/local/lib
- )
- IF ( _glib2_include_DIR AND _glib2_link_DIR )
- SET ( _glib2_FOUND TRUE )
- ENDIF ( _glib2_include_DIR AND _glib2_link_DIR )
-
-
- IF ( _glib2_FOUND )
- SET ( GLIB2_INCLUDE_DIRS ${_glib2_include_DIR} ${_glibconfig_include_DIR} )
- SET ( GLIB2_LIBRARIES ${_glib2_link_DIR} )
- SET ( GLIB2_CORE_FOUND TRUE )
- ELSE ( _glib2_FOUND )
- SET ( GLIB2_CORE_FOUND FALSE )
- ENDIF ( _glib2_FOUND )
-
- # Handle dependencies
- # libintl
- IF ( NOT LIBINTL_FOUND )
- FIND_PATH(LIBINTL_INCLUDE_DIR
- NAMES
- libintl.h
- PATHS
- /opt/gnome/include
- /opt/local/include
- /sw/include
- /usr/include
- /usr/local/include
- )
-
- FIND_LIBRARY(LIBINTL_LIBRARY
- NAMES
- intl
- PATHS
- /opt/gnome/lib
- /opt/local/lib
- /sw/lib
- /usr/local/lib
- /usr/lib
- )
-
- IF (LIBINTL_LIBRARY AND LIBINTL_INCLUDE_DIR)
- SET (LIBINTL_FOUND TRUE)
- ENDIF (LIBINTL_LIBRARY AND LIBINTL_INCLUDE_DIR)
- ENDIF ( NOT LIBINTL_FOUND )
-
- # libiconv
- IF ( NOT LIBICONV_FOUND )
- FIND_PATH(LIBICONV_INCLUDE_DIR
- NAMES
- iconv.h
- PATHS
- /opt/gnome/include
- /opt/local/include
- /opt/local/include
- /sw/include
- /sw/include
- /usr/local/include
- /usr/include
- PATH_SUFFIXES
- glib-2.0
- )
-
- FIND_LIBRARY(LIBICONV_LIBRARY
- NAMES
- iconv
- PATHS
- /opt/gnome/lib
- /opt/local/lib
- /sw/lib
- /usr/lib
- /usr/local/lib
- )
-
- IF (LIBICONV_LIBRARY AND LIBICONV_INCLUDE_DIR)
- SET (LIBICONV_FOUND TRUE)
- ENDIF (LIBICONV_LIBRARY AND LIBICONV_INCLUDE_DIR)
- ENDIF ( NOT LIBICONV_FOUND )
-
- IF (LIBINTL_FOUND)
- SET (GLIB2_LIBRARIES ${GLIB2_LIBRARIES} ${LIBINTL_LIBRARY})
- SET (GLIB2_INCLUDE_DIRS ${GLIB2_INCLUDE_DIRS} ${LIBINTL_INCLUDE_DIR})
- ENDIF (LIBINTL_FOUND)
-
- IF (LIBICONV_FOUND)
- SET (GLIB2_LIBRARIES ${GLIB2_LIBRARIES} ${LIBICONV_LIBRARY})
- SET (GLIB2_INCLUDE_DIRS ${GLIB2_INCLUDE_DIRS} ${LIBICONV_INCLUDE_DIR})
- ENDIF (LIBICONV_FOUND)
-
- ENDIF ( NOT GLIB2_FOUND AND NOT PKG_CONFIG_FOUND )
- ##
-
- IF (GLIB2_CORE_FOUND AND GLIB2_INCLUDE_DIRS AND GLIB2_LIBRARIES)
- SET (GLIB2_FOUND TRUE)
- ENDIF (GLIB2_CORE_FOUND AND GLIB2_INCLUDE_DIRS AND GLIB2_LIBRARIES)
-
- IF (GLIB2_FOUND)
- IF (NOT GLIB2_FIND_QUIETLY)
- MESSAGE (STATUS "Found GLib2: ${GLIB2_LIBRARIES} ${GLIB2_INCLUDE_DIRS}")
- ENDIF (NOT GLIB2_FIND_QUIETLY)
- ELSE (GLIB2_FOUND)
- IF (GLIB2_FIND_REQUIRED)
- MESSAGE (SEND_ERROR "Could not find GLib2")
- ENDIF (GLIB2_FIND_REQUIRED)
- ENDIF (GLIB2_FOUND)
-
- # show the GLIB2_INCLUDE_DIRS and GLIB2_LIBRARIES variables only in the advanced view
- MARK_AS_ADVANCED(GLIB2_INCLUDE_DIRS GLIB2_LIBRARIES)
- MARK_AS_ADVANCED(LIBICONV_INCLUDE_DIR LIBICONV_LIBRARY)
- MARK_AS_ADVANCED(LIBINTL_INCLUDE_DIR LIBINTL_LIBRARY)
-
-ENDIF (GLIB2_LIBRARIES AND GLIB2_INCLUDE_DIRS)
-
-IF ( GLIB2_FOUND )
- # Check if system has a newer version of glib
- # which supports g_regex_match_simple
- INCLUDE( CheckIncludeFiles )
- SET( CMAKE_REQUIRED_INCLUDES ${GLIB2_INCLUDE_DIRS} )
- CHECK_INCLUDE_FILES ( glib/gregex.h HAVE_GLIB_GREGEX_H )
- # Reset CMAKE_REQUIRED_INCLUDES
- SET( CMAKE_REQUIRED_INCLUDES "" )
-ENDIF( GLIB2_FOUND )
diff --git a/code/CMakeModules/FindGOBJECT2.cmake b/code/CMakeModules/FindGOBJECT2.cmake
deleted file mode 100644
index d0d4cda0d..000000000
--- a/code/CMakeModules/FindGOBJECT2.cmake
+++ /dev/null
@@ -1,51 +0,0 @@
-# - Try to find GObject2
-# Find GObject2 headers, libraries and the answer to all questions.
-#
-# GOBJECT2_FOUND True if GOBJECT2 got found
-# GOBJECT2_INCLUDE_DIRS Location of GOBJECT2 headers
-# GOBJECT2_LIBRARIES List of libraries to use GOBJECT2
-#
-# Copyright (c) 2008 Bjoern Ricks
-#
-# Redistribution and use is allowed according to the terms of the New
-# BSD license.
-# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
-#
-
-INCLUDE( FindPkgConfig )
-
-IF ( GOBJECT2_FIND_REQUIRED )
- SET( _pkgconfig_REQUIRED "REQUIRED" )
-ELSE( GOBJECT2_FIND_REQUIRED )
- SET( _pkgconfig_REQUIRED "" )
-ENDIF ( GOBJECT2_FIND_REQUIRED )
-
-IF ( GOBJECT2_MIN_VERSION )
- PKG_SEARCH_MODULE( GOBJECT2 ${_pkgconfig_REQUIRED} gobject-2.0>=${GOBJECT2_MIN_VERSION} )
-ELSE ( GOBJECT2_MIN_VERSION )
- PKG_SEARCH_MODULE( GOBJECT2 ${_pkgconfig_REQUIRED} gobject-2.0 )
-ENDIF ( GOBJECT2_MIN_VERSION )
-
-
-IF( NOT GOBJECT2_FOUND AND NOT PKG_CONFIG_FOUND )
- FIND_PATH( GOBJECT2_INCLUDE_DIRS gobject/gobject.h PATH_SUFFIXES glib-2.0)
- FIND_LIBRARY( GOBJECT2_LIBRARIES gobject-2.0 )
-
- # Report results
- IF ( GOBJECT2_LIBRARIES AND GOBJECT2_INCLUDE_DIRS )
- SET( GOBJECT2_FOUND 1 )
- IF ( NOT GOBJECT2_FIND_QUIETLY )
- MESSAGE( STATUS "Found GOBJECT2: ${GOBJECT2_LIBRARIES}" )
- ENDIF ( NOT GOBJECT2_FIND_QUIETLY )
- ELSE ( GOBJECT2_LIBRARIES AND GOBJECT2_INCLUDE_DIRS )
- IF ( GOBJECT2_FIND_REQUIRED )
- MESSAGE( SEND_ERROR "Could NOT find GOBJECT2" )
- ELSE ( GOBJECT2_FIND_REQUIRED )
- IF ( NOT GOBJECT2_FIND_QUIETLY )
- MESSAGE( STATUS "Could NOT find GOBJECT2" )
- ENDIF ( NOT GOBJECT2_FIND_QUIETLY )
- ENDIF ( GOBJECT2_FIND_REQUIRED )
- ENDIF ( GOBJECT2_LIBRARIES AND GOBJECT2_INCLUDE_DIRS )
-ENDIF( NOT GOBJECT2_FOUND AND NOT PKG_CONFIG_FOUND )
-
-MARK_AS_ADVANCED( GOBJECT2_LIBRARIES GOBJECT2_INCLUDE_DIRS )
diff --git a/code/CMakeModules/FindGit.cmake b/code/CMakeModules/FindGit.cmake
deleted file mode 100644
index 883357d79..000000000
--- a/code/CMakeModules/FindGit.cmake
+++ /dev/null
@@ -1,106 +0,0 @@
-# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
-# file Copyright.txt or https://cmake.org/licensing for details.
-
-#.rst:
-# FindGit
-# -------
-#
-# The module defines the following variables:
-#
-# ``GIT_EXECUTABLE``
-# Path to Git command-line client.
-# ``Git_FOUND``, ``GIT_FOUND``
-# True if the Git command-line client was found.
-# ``GIT_VERSION_STRING``
-# The version of Git found.
-#
-# Example usage:
-#
-# .. code-block:: cmake
-#
-# find_package(Git)
-# if(Git_FOUND)
-# message("Git found: ${GIT_EXECUTABLE}")
-# endif()
-
-# Look for 'git' or 'eg' (easy git)
-#
-set(git_names git eg)
-
-# Prefer .cmd variants on Windows unless running in a Makefile
-# in the MSYS shell.
-#
-if(CMAKE_HOST_WIN32)
- if(NOT CMAKE_GENERATOR MATCHES "MSYS")
- set(git_names git.cmd git eg.cmd eg)
- # GitHub search path for Windows
- file(GLOB github_path
- "$ENV{LOCALAPPDATA}/Github/PortableGit*/cmd"
- "$ENV{LOCALAPPDATA}/Github/PortableGit*/bin"
- )
- # SourceTree search path for Windows
- set(_git_sourcetree_path "$ENV{LOCALAPPDATA}/Atlassian/SourceTree/git_local/bin")
- endif()
-endif()
-
-# First search the PATH and specific locations.
-find_program(GIT_EXECUTABLE
- NAMES ${git_names}
- PATHS ${github_path} ${_git_sourcetree_path}
- DOC "Git command line client"
- )
-
-if(CMAKE_HOST_WIN32)
- # Now look for installations in Git/ directories under typical installation
- # prefixes on Windows. Exclude PATH from this search because VS 2017's
- # command prompt happens to have a PATH entry with a Git/ subdirectory
- # containing a minimal git not meant for general use.
- find_program(GIT_EXECUTABLE
- NAMES ${git_names}
- PATH_SUFFIXES Git/cmd Git/bin
- NO_SYSTEM_ENVIRONMENT_PATH
- DOC "Git command line client"
- )
-endif()
-
-mark_as_advanced(GIT_EXECUTABLE)
-
-MACRO(Git_WC_INFO dir prefix)
- EXECUTE_PROCESS(COMMAND ${Git_EXECUTABLE} log -r --pretty=format:"%d;%H;%an" .
- WORKING_DIRECTORY ${dir}
- OUTPUT_VARIABLE ${prefix}_WC_INFO
- ERROR_VARIABLE Git_info_error
- RESULT_VARIABLE Git_info_result
- OUTPUT_STRIP_TRAILING_WHITESPACE)
-
- IF(NOT ${Git_info_result} EQUAL 0)
- MESSAGE(SEND_ERROR "Command \"${GIT_EXECUTABLE} log\" failed with output:\n${Git_info_error}")
- ELSE()
- LIST(LENGTH ${prefix}_WC_INFO _COUNT)
- IF(_COUNT EQUAL 4)
- LIST(GET ${prefix}_WC_INFO 0 ${prefix}_WC_REVISION)
- LIST(GET ${prefix}_WC_INFO 1 ${prefix}_WC_CHANGESET)
- LIST(GET ${prefix}_WC_INFO 3 ${prefix}_WC_LAST_CHANGED_AUTHOR)
- ELSE()
- MESSAGE(STATUS "Bad output from HG")
- SET(${prefix}_WC_REVISION "unknown")
- SET(${prefix}_WC_CHANGESET "unknown")
- SET(${prefix}_WC_BRANCH "unknown")
- ENDIF()
- ENDIF()
-
- ENDMACRO()
-
-unset(git_names)
-unset(_git_sourcetree_path)
-
-if(GIT_EXECUTABLE)
- execute_process(COMMAND ${GIT_EXECUTABLE} --version
- OUTPUT_VARIABLE git_version
- ERROR_QUIET
- OUTPUT_STRIP_TRAILING_WHITESPACE)
- if (git_version MATCHES "^git version [0-9]")
- string(REPLACE "git version " "" GIT_VERSION_STRING "${git_version}")
- endif()
- unset(git_version)
-endif()
diff --git a/code/CMakeModules/FindHelpers.cmake b/code/CMakeModules/FindHelpers.cmake
deleted file mode 100644
index bc38354f4..000000000
--- a/code/CMakeModules/FindHelpers.cmake
+++ /dev/null
@@ -1,959 +0,0 @@
-MACRO(CONVERT_NUMBER_VERSION _VERSION_NUMBER _BASE _OUT)
- SET(${_OUT})
- SET(_NUMBER ${_VERSION_NUMBER})
- WHILE(_NUMBER GREATER 0)
- MATH(EXPR _TEMP "${_NUMBER} % ${_BASE}")
- LIST(APPEND ${_OUT} ${_TEMP})
- MATH(EXPR _NUMBER "${_NUMBER} / ${_BASE}")
- ENDWHILE()
-ENDMACRO(CONVERT_NUMBER_VERSION)
-
-FUNCTION(JOIN VALUES GLUE OUTPUT)
- STRING(REGEX REPLACE "([^\\]|^);" "\\1${GLUE}" _TMP_STR "${VALUES}")
- STRING(REGEX REPLACE "[\\](.)" "\\1" _TMP_STR "${_TMP_STR}") #fixes escaping
- SET(${OUTPUT} "${_TMP_STR}" PARENT_SCOPE)
-ENDFUNCTION()
-
-MACRO(PARSE_VERSION_OTHER FILENAME)
- IF(EXISTS ${FILENAME})
- SET(_FILTER_ARRAY ${ARGN})
- JOIN("${_FILTER_ARRAY}" "|" _FILTER_REGEX)
- FILE(STRINGS ${FILENAME} _FILE REGEX "(${_FILTER_REGEX})[: \t=\(\)\"]+([0-9.]+)")
-
- IF(_FILE)
- FOREACH(_LINE ${_FILE})
- FOREACH(_VAR ${_FILTER_ARRAY})
- IF("${${_VAR}}" STREQUAL "")
- STRING(REGEX REPLACE "^.*${_VAR}[: \t=\(\)\"]+([0-9.]+).*$" "\\1" ${_VAR} "${_LINE}")
- IF(${_VAR} STREQUAL "${_LINE}")
- SET(${_VAR})
- ENDIF()
- IF(NOT ${_VAR} AND NOT STREQUAL "0")
- SET(${_VAR} 0)
- ENDIF()
- ENDIF()
- ENDFOREACH()
- ENDFOREACH()
- ENDIF()
- ENDIF()
-ENDMACRO()
-
-# macro to define FIND_PACKAGE options with a different package name
-MACRO(FIX_PACKAGE_OPTIONS OLDNAME NEWNAME)
- # append other options if needed
- SET(_OPTIONS COMPONENTS REQUIRED QUIETLY)
-
- # process each options
- FOREACH(_OPTION ${_OPTIONS})
- SET(OLD_OPTION ${OLDNAME}_FIND_${_OPTION})
- IF(DEFINED )
- SET(NEW_OPTION ${NEWNAME}_FIND_${_OPTION})
- SET(${NEW_OPTION} ${OLD_OPTION})
- ENDIF()
- ENDFOREACH()
-ENDMACRO()
-
-MACRO(FIND_PACKAGE_HELPER NAME INCLUDE)
- # Looks for a directory containing NAME.
- #
- # NAME is the name of the library, lowercase and uppercase can be mixed
- # It should be EXACTLY (same case) the same part as XXXX in FindXXXX.cmake
- #
- # INCLUDE is the file to check for includes
- #
- # Following parameters are optional variables and must be prefixed by:
- #
- # RELEASE is the list of libraries to check in release mode
- # DEBUG is the list of libraries to check in debug mode
- # SUFFIXES is the PATH_SUFFIXES to check for include file
- # QUIET don't display anything
- # VERBOSE display more details if not found
- # REQUIRED throw an error if not found
- # DIR is the base directory where to look for
- #
- # The first match will be used in the specified order and next matches will be ignored
- #
- # The following values are defined
- # NAME_INCLUDE_DIR - where to find NAME
- # NAME_LIBRARIES - link against these to use NAME
- # NAME_FOUND - True if NAME is available.
-
- SET(_PARAMS ${ARGN})
-
- SET(_RELEASE_LIBRARIES)
- SET(_DEBUG_LIBRARIES)
- SET(_SUFFIXES)
- SET(_BASE_DIRECTORIES)
-
- SET(_IS_RELEASE OFF)
- SET(_IS_DEBUG OFF)
- SET(_IS_SUFFIXES OFF)
- SET(_IS_VERBOSE OFF)
- SET(_IS_DIR OFF)
-
- IF(_PARAMS)
- FOREACH(_PARAM ${_PARAMS})
- IF(_PARAM STREQUAL "RELEASE")
- SET(_IS_RELEASE ON)
- SET(_IS_DEBUG OFF)
- SET(_IS_SUFFIXES OFF)
- SET(_IS_DIR OFF)
- ELSEIF(_PARAM STREQUAL "DEBUG")
- SET(_IS_RELEASE OFF)
- SET(_IS_DEBUG ON)
- SET(_IS_SUFFIXES OFF)
- SET(_IS_DIR OFF)
- ELSEIF(_PARAM STREQUAL "SUFFIXES")
- SET(_IS_RELEASE OFF)
- SET(_IS_DEBUG OFF)
- SET(_IS_DIR OFF)
- SET(_IS_SUFFIXES ON)
- ELSEIF(_PARAM STREQUAL "QUIET")
- SET(_IS_RELEASE OFF)
- SET(_IS_DEBUG OFF)
- SET(_IS_SUFFIXES OFF)
- SET(_IS_DIR OFF)
- SET(${NAME}_FIND_QUIETLY ON)
- ELSEIF(_PARAM STREQUAL "VERBOSE")
- SET(_IS_RELEASE OFF)
- SET(_IS_DEBUG OFF)
- SET(_IS_SUFFIXES OFF)
- SET(_IS_DIR OFF)
- SET(_IS_VERBOSE ON)
- ELSEIF(_PARAM STREQUAL "REQUIRED")
- SET(_IS_RELEASE OFF)
- SET(_IS_DEBUG OFF)
- SET(_IS_SUFFIXES OFF)
- SET(_IS_DIR OFF)
- SET(${NAME}_FIND_REQUIRED ON)
- ELSEIF(_PARAM STREQUAL "DIR")
- SET(_IS_RELEASE OFF)
- SET(_IS_DEBUG OFF)
- SET(_IS_SUFFIXES OFF)
- SET(_IS_DIR ON)
- ELSE()
- IF(_IS_RELEASE)
- LIST(APPEND _RELEASE_LIBRARIES ${_PARAM})
- ELSEIF(_IS_DEBUG)
- LIST(APPEND _DEBUG_LIBRARIES ${_PARAM})
- ELSEIF(_IS_SUFFIXES)
- LIST(APPEND _SUFFIXES ${_PARAM})
- ELSEIF(_IS_DIR)
- LIST(APPEND _BASE_DIRECTORIES ${_PARAM})
- ELSE()
- MESSAGE(STATUS "parameter ${_PARAM} with no prefix")
- ENDIF()
- ENDIF()
- ENDFOREACH()
- ENDIF()
-
- # Fixes names if invalid characters are found
- IF("${NAME}" MATCHES "^[a-zA-Z0-9]+$")
- SET(_NAME_FIXED ${NAME})
- ELSE()
- # if invalid characters are detected, replace them by valid ones
- STRING(REPLACE "+" "p" _NAME_FIXED ${NAME})
- ENDIF()
-
- # Create uppercase and lowercase versions of NAME
- STRING(TOUPPER ${NAME} _UPNAME)
- STRING(TOLOWER ${NAME} _LOWNAME)
-
- STRING(TOUPPER ${_NAME_FIXED} _UPNAME_FIXED)
- STRING(TOLOWER ${_NAME_FIXED} _LOWNAME_FIXED)
-
- SET(_SUFFIXES ${_SUFFIXES} ${_LOWNAME} ${_LOWNAME_FIXED} ${NAME})
-
-# Don't use pkg-config
-# IF(NOT WIN32 AND NOT IOS)
-# FIND_PACKAGE(PkgConfig QUIET)
-# SET(_MODULES ${_LOWNAME} ${_RELEASE_LIBRARIES})
-# LIST(REMOVE_DUPLICATES _MODULES)
-# IF(PKG_CONFIG_EXECUTABLE)
-# PKG_SEARCH_MODULE(PKG_${_NAME_FIXED} QUIET ${_MODULES})
-# ENDIF()
-# ENDIF()
-
- SET(_INCLUDE_PATHS)
- SET(_LIBRARY_PATHS)
-
- # Check for root directories passed to CMake with -DXXX_DIR=...
- IF(DEFINED ${_UPNAME_FIXED}_DIR)
- SET(_TMP ${${_UPNAME_FIXED}_DIR})
- GET_FILENAME_COMPONENT(_TMP ${_TMP} ABSOLUTE)
- LIST(APPEND _INCLUDE_PATHS ${_TMP}/include ${_TMP})
- LIST(APPEND _LIBRARY_PATHS ${_TMP}/lib${LIB_SUFFIX})
-
- IF(_IS_VERBOSE)
- MESSAGE(STATUS "Using ${_UPNAME_FIXED}_DIR as root directory ${_TMP}")
- ENDIF()
- ENDIF()
-
- IF(DEFINED ${_UPNAME}_DIR)
- SET(_TMP ${${_UPNAME}_DIR})
- LIST(APPEND _INCLUDE_PATHS ${_TMP}/include ${_TMP})
- LIST(APPEND _LIBRARY_PATHS ${_TMP}/lib${LIB_SUFFIX})
-
- IF(_IS_VERBOSE)
- MESSAGE(STATUS "Using ${_UPNAME_FIXED}_DIR as root directory ${_TMP}")
- ENDIF()
- ENDIF()
-
- IF(_BASE_DIRECTORIES)
- FOREACH(_DIR ${_BASE_DIRECTORIES})
- IF(_DIR)
- LIST(APPEND _INCLUDE_PATHS ${_DIR}/include ${_DIR})
- LIST(APPEND _LIBRARY_PATHS ${_DIR}/lib${LIB_SUFFIX})
-
- IF(_IS_VERBOSE)
- MESSAGE(STATUS "Using ${_DIR} as root directory")
- ENDIF()
- ENDIF()
- ENDFOREACH()
- ENDIF()
-
- IF(UNIX)
- # Append UNIX standard include paths
- SET(_UNIX_INCLUDE_PATHS)
-
- # Append multiarch include paths
- IF(CMAKE_LIBRARY_ARCHITECTURE)
- LIST(APPEND _UNIX_INCLUDE_PATHS
- /usr/local/include/${CMAKE_LIBRARY_ARCHITECTURE}
- /usr/include/${CMAKE_LIBRARY_ARCHITECTURE})
- ENDIF()
-
- LIST(APPEND _UNIX_INCLUDE_PATHS
- /usr/local/include
- /usr/include
- /sw/include
- /opt/local/include
- /opt/csw/include
- /opt/include)
- ENDIF()
-
- IF(_IS_VERBOSE)
- MESSAGE(STATUS "Searching header ${INCLUDE} in: ${_INCLUDE_PATHS} with suffixes ${_SUFFIXES}")
- ENDIF()
-
- # Search for include directory
- FIND_PATH(${_UPNAME_FIXED}_INCLUDE_DIR
- NAMES ${INCLUDE}
- HINTS
- ${PKG_${_NAME_FIXED}_INCLUDE_DIRS}
- ${_INCLUDE_PATHS}
- $ENV{${_UPNAME}_DIR}/include
- $ENV{${_UPNAME_FIXED}_DIR}/include
- $ENV{${_UPNAME}_DIR}
- $ENV{${_UPNAME_FIXED}_DIR}
- PATHS
- ${_UNIX_INCLUDE_PATHS}
- PATH_SUFFIXES
- ${_SUFFIXES}
- DOC "Include path for ${NAME}"
- )
-
- IF(_IS_VERBOSE)
- IF(${_UPNAME_FIXED}_INCLUDE_DIR)
- MESSAGE(STATUS "${INCLUDE} found in ${${_UPNAME_FIXED}_INCLUDE_DIR}")
- ELSE()
- MESSAGE(STATUS "${INCLUDE} not found")
- ENDIF()
- ENDIF()
-
- # Append environment variables XXX_DIR
- LIST(APPEND _LIBRARY_PATHS
- $ENV{${_UPNAME}_DIR}/lib${LIB_SUFFIX}
- $ENV{${_UPNAME_FIXED}_DIR}/lib${LIB_SUFFIX})
-
- IF(UNIX)
- SET(_UNIX_LIBRARY_PATHS)
-
- # Append multiarch libraries paths
- IF(CMAKE_LIBRARY_ARCHITECTURE)
- LIST(APPEND _UNIX_LIBRARY_PATHS
- /usr/local/lib/${CMAKE_LIBRARY_ARCHITECTURE}
- /lib/${CMAKE_LIBRARY_ARCHITECTURE}
- /usr/lib/${CMAKE_LIBRARY_ARCHITECTURE})
- ENDIF()
-
- # Append UNIX standard libraries paths
- LIST(APPEND _UNIX_LIBRARY_PATHS
- /usr/local/lib
- /usr/lib
- /lib
- /usr/local/X11R6/lib
- /usr/X11R6/lib
- /sw/lib
- /opt/local/lib
- /opt/csw/lib
- /opt/lib
- /usr/freeware/lib${LIB_SUFFIX})
- ENDIF()
-
- LIST(APPEND _RELEASE_LIBRARIES ${_LOWNAME} ${_LOWNAME_FIXED} ${NAME} ${_NAME_FIXED})
- LIST(APPEND _DEBUG_LIBRARIES ${_LOWNAME}d ${_LOWNAME_FIXED}d ${NAME}d ${_NAME_FIXED}d)
-
- # Under Windows, some libs may need the lib prefix
- IF(WIN32)
- SET(_LIBS ${_RELEASE_LIBRARIES})
- FOREACH(_LIB ${_LIBS})
- LIST(APPEND _RELEASE_LIBRARIES lib${_LIB})
- ENDFOREACH()
-
- SET(_LIBS ${_DEBUG_LIBRARIES})
- FOREACH(_LIB ${_LIBS})
- LIST(APPEND _DEBUG_LIBRARIES lib${_LIB})
- ENDFOREACH()
- ENDIF()
-
- LIST(REMOVE_DUPLICATES _RELEASE_LIBRARIES)
- LIST(REMOVE_DUPLICATES _DEBUG_LIBRARIES)
-
- # Search for release library
- FIND_LIBRARY(${_UPNAME_FIXED}_LIBRARY_RELEASE
- NAMES
- ${_RELEASE_LIBRARIES}
- HINTS ${PKG_${_NAME_FIXED}_LIBRARY_DIRS}
- PATHS
- ${_LIBRARY_PATHS}
- ${_UNIX_LIBRARY_PATHS}
- NO_CMAKE_SYSTEM_PATH
- )
-
- IF(_IS_VERBOSE)
- IF(${_UPNAME_FIXED}_LIBRARY_RELEASE)
- MESSAGE(STATUS "${NAME} release library found: ${${_UPNAME_FIXED}_LIBRARY_RELEASE}")
- ELSE()
- MESSAGE(STATUS "${NAME} release library not found in ${_LIBRARY_PATHS};${_UNIX_LIBRARY_PATHS}")
- ENDIF()
- ENDIF()
-
- # Search for debug library
- FIND_LIBRARY(${_UPNAME_FIXED}_LIBRARY_DEBUG
- NAMES
- ${_DEBUG_LIBRARIES}
- HINTS ${PKG_${_NAME_FIXED}_LIBRARY_DIRS}
- PATHS
- ${_LIBRARY_PATHS}
- ${_UNIX_LIBRARY_PATHS}
- NO_CMAKE_SYSTEM_PATH
- )
-
- IF(_IS_VERBOSE)
- IF(${_UPNAME_FIXED}_LIBRARY_DEBUG)
- MESSAGE(STATUS "${NAME} debug library found: ${${_UPNAME_FIXED}_LIBRARY_DEBUG}")
- ELSE()
- MESSAGE(STATUS "${NAME} debug library not found")
- ENDIF()
- ENDIF()
-
- SET(${_UPNAME_FIXED}_FOUND OFF)
-
- IF(${_UPNAME_FIXED}_INCLUDE_DIR)
- # Set also _INCLUDE_DIRS
- SET(${_UPNAME_FIXED}_INCLUDE_DIRS ${${_UPNAME_FIXED}_INCLUDE_DIR})
- ENDIF()
-
- # Library has been found if at least only one library and include are found
- IF(${_UPNAME_FIXED}_LIBRARY_RELEASE AND ${_UPNAME_FIXED}_LIBRARY_DEBUG)
- # Release and debug libraries found
- SET(${_UPNAME_FIXED}_FOUND ON)
- SET(${_UPNAME_FIXED}_LIBRARIES optimized ${${_UPNAME_FIXED}_LIBRARY_RELEASE} debug ${${_UPNAME_FIXED}_LIBRARY_DEBUG})
- SET(${_UPNAME_FIXED}_LIBRARY ${${_UPNAME_FIXED}_LIBRARY_RELEASE})
- ELSEIF(${_UPNAME_FIXED}_LIBRARY_RELEASE)
- # Release library found
- SET(${_UPNAME_FIXED}_FOUND ON)
- SET(${_UPNAME_FIXED}_LIBRARIES ${${_UPNAME_FIXED}_LIBRARY_RELEASE})
- SET(${_UPNAME_FIXED}_LIBRARY ${${_UPNAME_FIXED}_LIBRARY_RELEASE})
- ELSEIF(${_UPNAME_FIXED}_LIBRARY_DEBUG)
- # Debug library found
- SET(${_UPNAME_FIXED}_FOUND ON)
- SET(${_UPNAME_FIXED}_LIBRARIES ${${_UPNAME_FIXED}_LIBRARY_DEBUG})
- SET(${_UPNAME_FIXED}_LIBRARY ${${_UPNAME_FIXED}_LIBRARY_DEBUG})
- ENDIF()
-
- IF(${_UPNAME_FIXED}_FOUND)
- IF(NOT ${NAME}_FIND_QUIETLY)
- MESSAGE(STATUS "Found ${NAME}: ${${_UPNAME_FIXED}_LIBRARIES}")
- ENDIF()
- ELSE()
- IF(${NAME}_FIND_REQUIRED)
- MESSAGE(FATAL_ERROR "Error: Unable to find ${NAME}!")
- ENDIF()
- IF(NOT ${NAME}_FIND_QUIETLY)
- MESSAGE(STATUS "Warning: Unable to find ${NAME}!")
- ENDIF()
- ENDIF()
-
- MARK_AS_ADVANCED(${_UPNAME_FIXED}_LIBRARY_RELEASE ${_UPNAME_FIXED}_LIBRARY_DEBUG)
-ENDMACRO()
-
-MACRO(MESSAGE_VERSION_PACKAGE_HELPER NAME VERSION)
- MESSAGE(STATUS "Found ${NAME} ${VERSION}: ${ARGN}")
-ENDMACRO()
-
-MACRO(FIND_LIBRARY_HELPER NAME)
- # Looks for libraries.
- #
- # NAME is the name of the library, lowercase and uppercase can be mixed
- #
- # Following parameters are optional variables and must be prefixed by:
- #
- # RELEASE is the list of libraries to check in release mode
- # DEBUG is the list of libraries to check in debug mode
- # VERBOSE display more details if not found
- # REQUIRED throw an error if not found
- # DIR is the base directory where to look for
- #
- # The first match will be used in the specified order and next matches will be ignored
- #
- # The following values are defined
- # NAME_LIBRARIES - link against these to use NAME
-
- SET(_PARAMS ${ARGN})
-
- SET(_RELEASE_LIBRARIES)
- SET(_DEBUG_LIBRARIES)
- SET(_BASE_DIRECTORIES)
-
- SET(_IS_RELEASE OFF)
- SET(_IS_DEBUG OFF)
- SET(_IS_VERBOSE OFF)
- SET(_IS_DIR OFF)
-
- IF(_PARAMS)
- FOREACH(_PARAM ${_PARAMS})
- IF(_PARAM STREQUAL "RELEASE")
- SET(_IS_RELEASE ON)
- SET(_IS_DEBUG OFF)
- SET(_IS_DIR OFF)
- ELSEIF(_PARAM STREQUAL "DEBUG")
- SET(_IS_RELEASE OFF)
- SET(_IS_DEBUG ON)
- SET(_IS_DIR OFF)
- ELSEIF(_PARAM STREQUAL "VERBOSE")
- SET(_IS_RELEASE OFF)
- SET(_IS_DEBUG OFF)
- SET(_IS_DIR OFF)
- SET(_IS_VERBOSE ON)
- ELSEIF(_PARAM STREQUAL "REQUIRED")
- SET(_IS_RELEASE OFF)
- SET(_IS_DEBUG OFF)
- SET(_IS_DIR OFF)
- SET(${NAME}_FIND_REQUIRED ON)
- ELSEIF(_PARAM STREQUAL "DIR")
- SET(_IS_RELEASE OFF)
- SET(_IS_DEBUG OFF)
- SET(_IS_DIR ON)
- ELSE()
- IF(_IS_RELEASE)
- LIST(APPEND _RELEASE_LIBRARIES ${_PARAM})
- ELSEIF(_IS_DEBUG)
- LIST(APPEND _DEBUG_LIBRARIES ${_PARAM})
- ELSEIF(_IS_DIR)
- LIST(APPEND _BASE_DIRECTORIES ${_PARAM})
- ELSE()
- MESSAGE(STATUS "parameter ${_PARAM} with no prefix")
- ENDIF()
- ENDIF()
- ENDFOREACH()
- ENDIF()
-
- # Fixes names if invalid characters are found
- IF("${NAME}" MATCHES "^[a-zA-Z0-9]+$")
- SET(_NAME_FIXED ${NAME})
- ELSE()
- # if invalid characters are detected, replace them by valid ones
- STRING(REPLACE "+" "p" _NAME_FIXED ${NAME})
- ENDIF()
-
- # Create uppercase and lowercase versions of NAME
- STRING(TOUPPER ${NAME} _UPNAME)
- STRING(TOLOWER ${NAME} _LOWNAME)
-
- STRING(TOUPPER ${_NAME_FIXED} _UPNAME_FIXED)
- STRING(TOLOWER ${_NAME_FIXED} _LOWNAME_FIXED)
-
- SET(_LIBRARY_PATHS)
-
- # Check for root directories passed to CMake with -DXXX_DIR=...
- IF(DEFINED ${_UPNAME_FIXED}_DIR)
- SET(_TMP ${${_UPNAME_FIXED}_DIR})
- GET_FILENAME_COMPONENT(_TMP ${_TMP} ABSOLUTE)
- LIST(APPEND _LIBRARY_PATHS ${_TMP}/lib${LIB_SUFFIX})
-
- IF(_IS_VERBOSE)
- MESSAGE(STATUS "Using ${_UPNAME_FIXED}_DIR as root directory ${_TMP}")
- ENDIF()
- ENDIF()
-
- IF(DEFINED ${_UPNAME}_DIR)
- SET(_TMP ${${_UPNAME}_DIR})
- LIST(APPEND _LIBRARY_PATHS ${_TMP}/lib${LIB_SUFFIX})
-
- IF(_IS_VERBOSE)
- MESSAGE(STATUS "Using ${_UPNAME_FIXED}_DIR as root directory ${_TMP}")
- ENDIF()
- ENDIF()
-
- IF(_BASE_DIRECTORIES)
- FOREACH(_DIR ${_BASE_DIRECTORIES})
- IF(_DIR)
- LIST(APPEND _LIBRARY_PATHS ${_DIR}/lib${LIB_SUFFIX})
-
- IF(_IS_VERBOSE)
- MESSAGE(STATUS "Using ${_DIR} as root directory")
- ENDIF()
- ENDIF()
- ENDFOREACH()
- ENDIF()
-
- # Append environment variables XXX_DIR
- LIST(APPEND _LIBRARY_PATHS
- $ENV{${_UPNAME}_DIR}/lib${LIB_SUFFIX}
- $ENV{${_UPNAME_FIXED}_DIR}/lib${LIB_SUFFIX})
-
- IF(UNIX)
- SET(_UNIX_LIBRARY_PATHS)
-
- # Append multiarch libraries paths
- IF(CMAKE_LIBRARY_ARCHITECTURE)
- LIST(APPEND _UNIX_LIBRARY_PATHS
- /usr/local/lib/${CMAKE_LIBRARY_ARCHITECTURE}
- /lib/${CMAKE_LIBRARY_ARCHITECTURE}
- /usr/lib/${CMAKE_LIBRARY_ARCHITECTURE})
- ENDIF()
-
- # Append UNIX standard libraries paths
- LIST(APPEND _UNIX_LIBRARY_PATHS
- /usr/local/lib
- /usr/lib
- /lib
- /usr/local/X11R6/lib
- /usr/X11R6/lib
- /sw/lib
- /opt/local/lib
- /opt/csw/lib
- /opt/lib
- /usr/freeware/lib${LIB_SUFFIX})
- ENDIF()
-
- LIST(APPEND _RELEASE_LIBRARIES ${_LOWNAME} ${_LOWNAME_FIXED} ${NAME} ${_NAME_FIXED})
- LIST(APPEND _DEBUG_LIBRARIES ${_LOWNAME}d ${_LOWNAME_FIXED}d ${NAME}d ${_NAME_FIXED}d)
-
- # Under Windows, some libs may need the lib prefix
- IF(WIN32)
- SET(_LIBS ${_RELEASE_LIBRARIES})
- FOREACH(_LIB ${_LIBS})
- LIST(APPEND _RELEASE_LIBRARIES lib${_LIB})
- ENDFOREACH()
-
- SET(_LIBS ${_DEBUG_LIBRARIES})
- FOREACH(_LIB ${_LIBS})
- LIST(APPEND _DEBUG_LIBRARIES lib${_LIB})
- ENDFOREACH()
- ENDIF()
-
- LIST(REMOVE_DUPLICATES _RELEASE_LIBRARIES)
- LIST(REMOVE_DUPLICATES _DEBUG_LIBRARIES)
-
- # Search for release library
- FIND_LIBRARY(${_UPNAME_FIXED}_LIBRARY_RELEASE
- NAMES
- ${_RELEASE_LIBRARIES}
- HINTS ${PKG_${_NAME_FIXED}_LIBRARY_DIRS}
- PATHS
- ${_LIBRARY_PATHS}
- ${_UNIX_LIBRARY_PATHS}
- NO_CMAKE_SYSTEM_PATH
- )
-
- IF(_IS_VERBOSE)
- IF(${_UPNAME_FIXED}_LIBRARY_RELEASE)
- MESSAGE(STATUS "${NAME} release library found: ${${_UPNAME_FIXED}_LIBRARY_RELEASE}")
- ELSE()
- MESSAGE(STATUS "${NAME} release library not found in ${_LIBRARY_PATHS};${_UNIX_LIBRARY_PATHS}")
- ENDIF()
- ENDIF()
-
- # Search for debug library
- FIND_LIBRARY(${_UPNAME_FIXED}_LIBRARY_DEBUG
- NAMES
- ${_DEBUG_LIBRARIES}
- HINTS ${PKG_${_NAME_FIXED}_LIBRARY_DIRS}
- PATHS
- ${_LIBRARY_PATHS}
- ${_UNIX_LIBRARY_PATHS}
- NO_CMAKE_SYSTEM_PATH
- )
-
- IF(_IS_VERBOSE)
- IF(${_UPNAME_FIXED}_LIBRARY_DEBUG)
- MESSAGE(STATUS "${NAME} debug library found: ${${_UPNAME_FIXED}_LIBRARY_DEBUG}")
- ELSE()
- MESSAGE(STATUS "${NAME} debug library not found")
- ENDIF()
- ENDIF()
-
- # Library has been found if at least only one library and include are found
- IF(${_UPNAME_FIXED}_LIBRARY_RELEASE AND ${_UPNAME_FIXED}_LIBRARY_DEBUG)
- # Release and debug libraries found
- SET(${_UPNAME_FIXED}_LIBRARIES optimized ${${_UPNAME_FIXED}_LIBRARY_RELEASE} debug ${${_UPNAME_FIXED}_LIBRARY_DEBUG})
- SET(${_UPNAME_FIXED}_LIBRARY ${${_UPNAME_FIXED}_LIBRARY_RELEASE})
- ELSEIF(${_UPNAME_FIXED}_LIBRARY_RELEASE)
- # Release library found
- SET(${_UPNAME_FIXED}_LIBRARIES ${${_UPNAME_FIXED}_LIBRARY_RELEASE})
- SET(${_UPNAME_FIXED}_LIBRARY ${${_UPNAME_FIXED}_LIBRARY_RELEASE})
- ELSEIF(${_UPNAME_FIXED}_LIBRARY_DEBUG)
- # Debug library found
- SET(${_UPNAME_FIXED}_LIBRARIES ${${_UPNAME_FIXED}_LIBRARY_DEBUG})
- SET(${_UPNAME_FIXED}_LIBRARY ${${_UPNAME_FIXED}_LIBRARY_DEBUG})
- ENDIF()
-
- MARK_AS_ADVANCED(${_UPNAME_FIXED}_LIBRARY_RELEASE ${_UPNAME_FIXED}_LIBRARY_DEBUG)
-ENDMACRO()
-
-MACRO(FIND_LIBCURL)
- IF(NOT CURL_FOUND)
- FIND_PACKAGE(CURL REQUIRED)
-
- IF(WIN32 OR CURL_LIBRARY MATCHES "\\.a" OR WITH_STATIC_CURL)
- SET(CURL_STATIC ON)
- ELSE()
- SET(CURL_STATIC OFF)
- ENDIF()
-
- IF(CURL_STATIC)
- SET(CURL_DEFINITIONS -DCURL_STATICLIB)
-
- IF(UNIX)
- # CURL can depend on libidn
- FIND_LIBRARY(IDN_LIBRARY idn)
- IF(IDN_LIBRARY)
- LIST(APPEND CURL_LIBRARIES ${IDN_LIBRARY})
- ENDIF()
-
- # CURL Macports version can depend on libidn, libintl and libiconv too
- IF(APPLE)
- FIND_LIBRARY(INTL_LIBRARY intl)
- IF(INTL_LIBRARY)
- LIST(APPEND CURL_LIBRARIES ${INTL_LIBRARY})
- ENDIF()
- ELSE()
- # Only used by libcurl under Linux
- FIND_PACKAGE(OpenSSL REQUIRED)
-
- #IF(WIN32)
- # SET(OPENSSL_LIBRARIES ${OPENSSL_LIBRARIES} Crypt32.lib)
- #ENDIF()
-
- # Only Linux version of libcurl depends on OpenSSL
- LIST(APPEND CURL_INCLUDE_DIRS ${OPENSSL_INCLUDE_DIR})
- LIST(APPEND CURL_LIBRARIES ${OPENSSL_LIBRARIES})
- ENDIF()
- ENDIF()
- ENDIF()
- ENDIF()
-ENDMACRO()
-
-MACRO(FIND_LIBXML2)
- IF(NOT LIBXML2_FOUND)
- FIND_PACKAGE(LibXml2 REQUIRED)
-
- IF(WIN32 OR WITH_STATIC_LIBXML2)
- LIST(APPEND LIBXML2_DEFINITIONS -DLIBXML_STATIC)
- ENDIF()
-
- IF(WITH_LIBXML2_ICONV)
- FIND_PACKAGE(Iconv REQUIRED)
-# LIST(APPEND CURL_INCLUDE_DIRS ${ICONV_INCLUDE_DIR})
- LIST(APPEND LIBXML2_LIBRARIES ${ICONV_LIBRARIES})
- ENDIF()
-
- IF(WITH_STATIC)
- # libxml2 could need winsock2 library
- IF(WIN32)
- FIND_LIBRARY(WINSOCK2_LIB ws2_32)
-
- IF(WINSOCK2_LIB)
- LIST(APPEND LIBXML2_LIBRARIES ${WINSOCK2_LIB})
- ENDIF()
-
- FIND_LIBRARY(CRYPT32_LIB Crypt32)
-
- IF(CRYPT32_LIB)
- LIST(APPEND LIBXML2_LIBRARIES ${CRYPT32_LIB})
- ENDIF()
- ELSE()
- # under Linux and OS X, recent libxml2 versions are linked against liblzma
- FIND_PACKAGE(LibLZMA)
-
- IF(LIBLZMA_LIBRARIES)
- LIST(APPEND LIBXML2_LIBRARIES ${LIBLZMA_LIBRARIES})
- ENDIF()
- ENDIF()
- ENDIF()
- ENDIF()
-ENDMACRO()
-
-MACRO(ADD_QT_LIBRARY _NAME)
- IF(WIN32)
- SET(_PREFIX "Qt5")
- SET(_EXT "lib")
- ELSE()
- SET(_PREFIX "libQt5")
- SET(_EXT "a")
- ENDIF()
- SET(_LIB "${QT_LIBRARY_DIR}/${_PREFIX}${_NAME}.${_EXT}")
- IF(EXISTS ${_LIB})
- LIST(APPEND QT_LIBRARIES optimized ${_LIB})
- ENDIF()
- SET(_LIB "${QT_LIBRARY_DIR}/${_PREFIX}${_NAME}d.${_EXT}")
- IF(EXISTS ${_LIB})
- LIST(APPEND QT_LIBRARIES debug ${_LIB})
- ENDIF()
-ENDMACRO()
-
-MACRO(ADD_QT_PLUGIN _TYPE _NAME)
- IF(WIN32)
- SET(_PREFIX "")
- SET(_EXT "lib")
- ELSE()
- SET(_PREFIX "lib")
- SET(_EXT "a")
- ENDIF()
- SET(_LIB "${QT_PLUGINS_DIR}/${_TYPE}/${_PREFIX}${_NAME}.${_EXT}")
- IF(EXISTS ${_LIB})
- LIST(APPEND QT_LIBRARIES optimized ${_LIB})
- ENDIF()
- SET(_LIB "${QT_PLUGINS_DIR}/${_TYPE}/${_PREFIX}${_NAME}d.${_EXT}")
- IF(EXISTS ${_LIB})
- LIST(APPEND QT_LIBRARIES debug ${_LIB})
- ENDIF()
-ENDMACRO()
-
-MACRO(ADD_QT_SYSTEM_LIBRARY _NAME)
- # Save default suffixes
- SET(_OLD_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
-
- # Define specific suffixes
- SET(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_SHARED_LIBRARY_SUFFIX})
-
- # Find the library with specified suffixes
- FIND_LIBRARY(${_NAME}_LIBRARY NAMES ${_NAME})
-
- # Restore default suffixes
- SET(CMAKE_FIND_LIBRARY_SUFFIXES ${_OLD_SUFFIXES})
-
- IF(${_NAME}_LIBRARY)
- MESSAGE(STATUS "Found ${${_NAME}_LIBRARY} ${_NAME}")
-
- LIST(APPEND QT_LIBRARIES ${${_NAME}_LIBRARY})
- ELSE()
- MESSAGE(STATUS "Didn't find ${_NAME}")
- ENDIF()
-ENDMACRO()
-
-MACRO(FIND_QT5)
- CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11 FATAL_ERROR)
-
- SET(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ${QTDIR} $ENV{QTDIR})
-
- FIND_PACKAGE(Qt5Core QUIET)
-
- IF(Qt5Core_FOUND)
- # Check if we are using Qt static or shared libraries
- GET_TARGET_PROPERTY(_FILE Qt5::Core IMPORTED_LOCATION_RELEASE)
-
- SET(QT_VERSION "${Qt5Core_VERSION_STRING}")
- SET(_VERSION "${QT_VERSION}")
-
- IF(_FILE MATCHES "\\.(lib|a)$")
- SET(QT_STATIC ON)
- SET(_VERSION "${_VERSION} static version")
- ELSE()
- SET(QT_STATIC OFF)
- SET(_VERSION "${_VERSION} shared version")
- ENDIF()
-
- MESSAGE(STATUS "Found Qt ${_VERSION}")
-
- # These variables are not defined with Qt5 CMake modules
- SET(QT_BINARY_DIR "${_qt5Core_install_prefix}/bin")
- SET(QT_LIBRARY_DIR "${_qt5Core_install_prefix}/lib")
- SET(QT_PLUGINS_DIR "${_qt5Core_install_prefix}/plugins")
- SET(QT_TRANSLATIONS_DIR "${_qt5Core_install_prefix}/translations")
-
- # Fix wrong include directories with Qt 5 under Mac OS X
- INCLUDE_DIRECTORIES("${_qt5Core_install_prefix}/include")
-
- FIND_PACKAGE(Qt5Gui)
- FIND_PACKAGE(Qt5Widgets)
- FIND_PACKAGE(Qt5OpenGL)
- FIND_PACKAGE(Qt5Xml)
- FIND_PACKAGE(Qt5LinguistTools)
- FIND_PACKAGE(Qt5Network)
-
- IF(QT_STATIC)
- FIND_PACKAGE(PNG REQUIRED)
- FIND_PACKAGE(Jpeg REQUIRED)
-
- ADD_DEFINITIONS(-DQT_STATICPLUGIN)
-
- SET(QT_LIBRARIES Qt5::Widgets)
-
- # Gui
- LIST(APPEND QT_LIBRARIES Qt5::Gui Qt5::OpenGL)
-
- ADD_QT_LIBRARY(PrintSupport)
-
- IF(WIN32)
- LIST(APPEND QT_LIBRARIES
- ${WINSDK_LIBRARY_DIR}/Imm32.lib
- ${WINSDK_LIBRARY_DIR}/OpenGL32.lib
- ${WINSDK_LIBRARY_DIR}/WinMM.Lib)
- ADD_QT_PLUGIN(platforms qwindows)
- ADD_QT_LIBRARY(PlatformSupport)
- ELSEIF(APPLE)
- # Cups needs .dylib
- SET(OLD_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
- SET(CMAKE_FIND_LIBRARY_SUFFIXES .dylib)
- FIND_LIBRARY(CUPS_LIBRARY cups)
- SET(CMAKE_FIND_LIBRARY_SUFFIXES ${OLD_CMAKE_FIND_LIBRARY_SUFFIXES})
-
- FIND_LIBRARY(IOKIT_FRAMEWORK IOKit)
- FIND_LIBRARY(COCOA_FRAMEWORK Cocoa)
- FIND_LIBRARY(SYSTEMCONFIGURATION_FRAMEWORK SystemConfiguration)
- FIND_LIBRARY(OPENGL_FRAMEWORK NAMES OpenGL)
-
- LIST(APPEND QT_LIBRARIES
- ${CUPS_LIBRARY}
- ${COCOA_FRAMEWORK}
- ${SYSTEMCONFIGURATION_FRAMEWORK}
- ${IOKIT_FRAMEWORK}
- ${OPENGL_FRAMEWORK})
-
- ADD_QT_PLUGIN(printsupport cocoaprintersupport)
- ADD_QT_PLUGIN(platforms qcocoa)
- ADD_QT_LIBRARY(PlatformSupport)
- ELSE()
- # order is very important there
- ADD_QT_PLUGIN(platforms qxcb)
- ADD_QT_PLUGIN(xcbglintegrations qxcb-glx-integration)
-
- ADD_QT_LIBRARY(XcbQpa)
- ADD_QT_LIBRARY(GlxSupport)
- ADD_QT_LIBRARY(ServiceSupport)
- ADD_QT_LIBRARY(EdidSupport)
- ADD_QT_LIBRARY(FontDatabaseSupport)
- ADD_QT_LIBRARY(ThemeSupport)
- ADD_QT_LIBRARY(EventDispatcherSupport)
- ADD_QT_LIBRARY(PlatformSupport)
-
- ADD_QT_LIBRARY(DBus)
-
- IF(EXISTS "${QT_LIBRARY_DIR}/libxcb-static.a")
- LIST(APPEND QT_LIBRARIES "${QT_LIBRARY_DIR}/libxcb-static.a")
- ENDIF()
-
- # always link these in dynamic, API never changes
- ADD_QT_SYSTEM_LIBRARY(X11)
- ADD_QT_SYSTEM_LIBRARY(Xmu)
- ADD_QT_SYSTEM_LIBRARY(X11-xcb)
- ADD_QT_SYSTEM_LIBRARY(Xi)
- ADD_QT_SYSTEM_LIBRARY(SM)
- ADD_QT_SYSTEM_LIBRARY(ICE)
- ADD_QT_SYSTEM_LIBRARY(xcb)
- ADD_QT_SYSTEM_LIBRARY(GL)
- ADD_QT_SYSTEM_LIBRARY(xcb-glx)
- ADD_QT_SYSTEM_LIBRARY(fontconfig)
- ADD_QT_SYSTEM_LIBRARY(Xrender)
- ENDIF()
-
- ADD_QT_PLUGIN(imageformats qgif)
- ADD_QT_PLUGIN(imageformats qicns)
- ADD_QT_PLUGIN(imageformats qico)
- ADD_QT_PLUGIN(imageformats qjpeg)
-
- # harfbuzz is needed since Qt 5.3
- IF(UNIX)
- SET(HB_LIB "${QT_LIBRARY_DIR}/libqtharfbuzzng.a")
- IF(NOT EXISTS ${HB_LIB})
- SET(HB_LIB "${QT_LIBRARY_DIR}/libqtharfbuzz.a")
- ENDIF()
- ELSEIF(WIN32)
- SET(HB_LIB "${QT_LIBRARY_DIR}/qtharfbuzzng.lib")
- ENDIF()
- IF(EXISTS ${HB_LIB})
- LIST(APPEND QT_LIBRARIES ${HB_LIB})
- ENDIF()
-
- # freetype is needed since Qt 5.5
- FIND_PACKAGE(Freetype)
-
- IF(FREETYPE_FOUND)
- LIST(APPEND QT_LIBRARIES ${FREETYPE_LIBRARIES})
- ELSE()
- IF(UNIX)
- SET(FREETYPE_LIB "${QT_LIBRARY_DIR}/libqtfreetype.a")
- ELSEIF(WIN32)
- SET(FREETYPE_LIB "${QT_LIBRARY_DIR}/qtfreetype.lib")
- ENDIF()
- IF(EXISTS ${FREETYPE_LIB})
- LIST(APPEND QT_LIBRARIES ${FREETYPE_LIB})
- ENDIF()
- ENDIF()
-
- ADD_QT_PLUGIN(accessible qtaccessiblewidgets)
-
- LIST(APPEND QT_LIBRARIES ${PNG_LIBRARIES} ${JPEG_LIBRARY})
-
- # Network
- LIST(APPEND QT_LIBRARIES Qt5::Network Qt5::Xml)
- LIST(APPEND QT_LIBRARIES ${OPENSSL_LIBRARIES} ${ZLIB_LIBRARIES})
-
- IF(WIN32)
- LIST(APPEND QT_LIBRARIES
- ${WINSDK_LIBRARY_DIR}/Crypt32.lib
- ${WINSDK_LIBRARY_DIR}/WS2_32.Lib
- ${WINSDK_LIBRARY_DIR}/IPHlpApi.Lib)
- ENDIF()
-
- # Core
- LIST(APPEND QT_LIBRARIES Qt5::Core)
-
- # pcre is needed since Qt 5.5
- IF(UNIX)
- SET(PCRE_LIB "${QT_LIBRARY_DIR}/libqtpcre.a")
- IF(NOT EXISTS ${PCRE_LIB})
- SET(PCRE_LIB "${QT_LIBRARY_DIR}/libqtpcre2.a")
- ENDIF()
- ELSEIF(WIN32)
- SET(PCRE_LIB "${QT_LIBRARY_DIR}/qtpcre.lib")
- ENDIF()
- IF(EXISTS ${PCRE_LIB})
- LIST(APPEND QT_LIBRARIES ${PCRE_LIB})
- ENDIF()
-
- IF(APPLE)
- FIND_LIBRARY(PCRE_LIBRARY pcre16 pcre)
-
- FIND_LIBRARY(SECURITY_FRAMEWORK Security)
-
- LIST(APPEND QT_LIBRARIES
- ${PCRE_LIBRARY}
- ${FOUNDATION_FRAMEWORK}
- ${CARBON_FRAMEWORK}
- ${SECURITY_FRAMEWORK})
- ELSEIF(UNIX)
- FIND_PACKAGE(Threads)
- LIST(APPEND QT_LIBRARIES ${ZLIB_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${CMAKE_DL_LIBS} -lrt)
- ENDIF()
- ELSE()
- SET(QT_LIBRARIES Qt5::Widgets Qt5::Network Qt5::Xml Qt5::Gui Qt5::OpenGL Qt5::Core)
- ENDIF()
- ELSE()
- MESSAGE(WARNING "Unable to find Qt 5")
- ENDIF()
-ENDMACRO()
diff --git a/code/CMakeModules/FindIconv.cmake b/code/CMakeModules/FindIconv.cmake
index e96fe4054..092b35702 100644
--- a/code/CMakeModules/FindIconv.cmake
+++ b/code/CMakeModules/FindIconv.cmake
@@ -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
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
diff --git a/code/CMakeModules/FindJpeg.cmake b/code/CMakeModules/FindJpeg.cmake
index b77eba41b..454f0fdc2 100644
--- a/code/CMakeModules/FindJpeg.cmake
+++ b/code/CMakeModules/FindJpeg.cmake
@@ -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)
diff --git a/code/CMakeModules/FindLIBGSF.cmake b/code/CMakeModules/FindLIBGSF.cmake
deleted file mode 100644
index 8d749a87d..000000000
--- a/code/CMakeModules/FindLIBGSF.cmake
+++ /dev/null
@@ -1,57 +0,0 @@
-# - Try to find libGSF
-#
-# Once done this will define
-#
-# LIBGSF_FOUND - System has LibGSF
-# LIBGSF_INCLUDE_DIR - The LibGSF include directory
-# LIBGSF_LIBRARIES - The libraries needed to use LibGSF
-# LIBGSF_DEFINITIONS - Compiler switches required for using LibGSF
-# LIBGSF_GSF_EXECUTABLE - The archive utility
-# LIBGSF_GSFOFFICETHUMBNAILER_EXECUTABLE - The office files thumbnailer for the GNOME desktop
-# LIBGSF_GSFVBADUMP_EXECUTABLE - The utility to extract Visual Basic for Applications macros
-
-# Copyright (c) 2009, Pau Garcia i Quiles
-# Based off FindLibXml2.cmake from CMake 2.6.4 by Alexander Neundorf
-#
-# Redistribution and use is allowed according to the terms of the BSD license.
-# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
-
-
-IF (LIBGSF_INCLUDE_DIR AND LIBGSF_LIBRARIES)
- # in cache already
- SET(LIBGSF_FIND_QUIETLY TRUE)
-ENDIF (LIBGSF_INCLUDE_DIR AND LIBGSF_LIBRARIES)
-
-IF (NOT WIN32)
- # use pkg-config to get the directories and then use these values
- # in the FIND_PATH() and FIND_LIBRARY() calls
- FIND_PACKAGE(PkgConfig)
- PKG_CHECK_MODULES(PC_LIBGSF libgsf-1)
- SET(LIBGSF_DEFINITIONS ${PC_LIBGSF_CFLAGS_OTHER})
-ENDIF (NOT WIN32)
-
-FIND_PATH(LIBGSF_INCLUDE_DIR gsf/gsf.h
- HINTS
- ${PC_LIBGSF_INCLUDEDIR}
- ${PC_LIBGSF_INCLUDE_DIRS}
- PATH_SUFFIXES libgsf-1
- )
-
-FIND_LIBRARY(LIBGSF_LIBRARIES NAMES gsf-1 libgsf-1
- HINTS
- ${PC_LIBGSF_LIBDIR}
- ${PC_LIBGSF_LIBRARY_DIRS}
- )
-
-FIND_PROGRAM(LIBGSF_GSF_EXECUTABLE gsf)
-FIND_PROGRAM(LIBGSF_GSFOFFICETHUMBNAILER_EXECUTABLE gsf-office-thumbnailer)
-FIND_PROGRAM(LIBGSF_GSFVBADUMP_EXECUTABLE gsf-vba-dump)
-
-INCLUDE(FindPackageHandleStandardArgs)
-
-# handle the QUIETLY and REQUIRED arguments and set LIBGSF_FOUND to TRUE if
-# all listed variables are TRUE
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBGSF DEFAULT_MSG LIBGSF_LIBRARIES LIBGSF_INCLUDE_DIR)
-
-MARK_AS_ADVANCED(LIBGSF_INCLUDE_DIR LIBGSF_LIBRARIES LIBGSF_GSF_EXECUTABLE LIBGSF_GSFOFFICETHUMBNAILER_EXECUTABLE LIBGSF_GSFVBADUMP_EXECUTABLE )
-
diff --git a/code/CMakeModules/FindLibOVR.cmake b/code/CMakeModules/FindLibOVR.cmake
index 081fa0bca..b182da00c 100644
--- a/code/CMakeModules/FindLibOVR.cmake
+++ b/code/CMakeModules/FindLibOVR.cmake
@@ -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)
diff --git a/code/CMakeModules/FindLibVR.cmake b/code/CMakeModules/FindLibVR.cmake
index 5e9da0342..e8bcf2fde 100644
--- a/code/CMakeModules/FindLibVR.cmake
+++ b/code/CMakeModules/FindLibVR.cmake
@@ -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)
diff --git a/code/CMakeModules/FindLuabind.cmake b/code/CMakeModules/FindLuabind.cmake
index 5511379a3..c21d64e4f 100644
--- a/code/CMakeModules/FindLuabind.cmake
+++ b/code/CMakeModules/FindLuabind.cmake
@@ -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,7 +194,7 @@ IF(LUABIND_INCLUDE_DIR AND Boost_INCLUDE_DIR)
# Case where Luabind is compiled from sources (debug version is compiled by default)
SET(LUABIND_FOUND TRUE)
SET(LUABIND_LIBRARIES ${LUABIND_LIBRARY_DEBUG})
- ENDIF()
+ ENDIF(LUABIND_LIBRARY_RELEASE AND LUABIND_LIBRARY_DEBUG)
ENDIF()
IF(LUABIND_FOUND)
@@ -209,11 +209,11 @@ IF(LUABIND_FOUND)
IF(NOT Luabind_FIND_QUIETLY)
MESSAGE(STATUS "Found Luabind: ${LUABIND_LIBRARIES}")
- ENDIF()
+ ENDIF(NOT Luabind_FIND_QUIETLY)
ELSE()
IF(NOT Luabind_FIND_QUIETLY)
MESSAGE(STATUS "Warning: Unable to find Luabind!")
ENDIF()
-ENDIF()
+ENDIF(LUABIND_FOUND)
MARK_AS_ADVANCED(LUABIND_LIBRARY_RELEASE LUABIND_LIBRARY_DEBUG Boost_LIB_DIAGNOSTIC_DEFINITIONS)
diff --git a/code/CMakeModules/FindMSVC.cmake b/code/CMakeModules/FindMSVC.cmake
index 9d5fc5cf7..6a8bdd33a 100644
--- a/code/CMakeModules/FindMSVC.cmake
+++ b/code/CMakeModules/FindMSVC.cmake
@@ -1,182 +1,106 @@
-# - Find MS Visual C++
-#
-# VC_INCLUDE_DIR - where to find headers
-# VC_INCLUDE_DIRS - where to find headers
-# VC_LIBRARY_DIR - where to find libraries
-# VC_FOUND - True if MSVC found.
-
-MACRO(ADD_TRAILING_SLASH _FILENAME_VAR)
- # put content in a new variable
- SET(_FILENAME ${${_FILENAME_VAR}})
- # get length of the string
- STRING(LENGTH ${_FILENAME} _LEN)
- # convert length to last pos
- MATH(EXPR _POS "${_LEN}-1")
- # get last character of the string
- STRING(SUBSTRING ${_FILENAME} ${_POS} 1 _FILENAME_END)
- # compare it with a slash
- IF(NOT _FILENAME_END STREQUAL "/")
- # not a slash, append it
- SET(${_FILENAME_VAR} "${_FILENAME}/")
- ELSE()
- # already a slash
- ENDIF()
-ENDMACRO()
-
-MACRO(DETECT_VC_VERSION_HELPER _ROOT _VERSION)
- # Software/Wow6432Node/...
- GET_FILENAME_COMPONENT(VC${_VERSION}_DIR "[${_ROOT}\\SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VC7;${_VERSION}]" ABSOLUTE)
-
- IF(VC${_VERSION}_DIR AND VC${_VERSION}_DIR STREQUAL "/registry")
- SET(VC${_VERSION}_DIR)
- GET_FILENAME_COMPONENT(VC${_VERSION}_DIR "[${_ROOT}\\SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VS7;${_VERSION}]" ABSOLUTE)
-
- IF(VC${_VERSION}_DIR AND NOT VC${_VERSION}_DIR STREQUAL "/registry")
- # be sure it's finishing by a /
- ADD_TRAILING_SLASH(VC${_VERSION}_DIR)
-
- SET(VC${_VERSION}_DIR "${VC${_VERSION}_DIR}VC/")
- ENDIF()
- ENDIF()
-
- IF(VC${_VERSION}_DIR AND NOT VC${_VERSION}_DIR STREQUAL "/registry")
- SET(VC${_VERSION}_FOUND ON)
- DETECT_EXPRESS_VERSION(${_VERSION})
- IF(NOT MSVC_FIND_QUIETLY)
- SET(_VERSION_STR ${_VERSION})
- IF(MSVC_EXPRESS)
- SET(_VERSION_STR "${_VERSION_STR} Express")
- ENDIF()
- MESSAGE(STATUS "Found Visual C++ ${_VERSION_STR} in ${VC${_VERSION}_DIR}")
- ENDIF()
- ELSEIF(VC${_VERSION}_DIR AND NOT VC${_VERSION}_DIR STREQUAL "/registry")
- SET(VC${_VERSION}_FOUND OFF)
- SET(VC${_VERSION}_DIR "")
- ENDIF()
-ENDMACRO()
-
-MACRO(DETECT_VC_VERSION _VERSION)
- IF(NOT VC_FOUND)
- SET(VC${_VERSION}_FOUND OFF)
- DETECT_VC_VERSION_HELPER("HKEY_CURRENT_USER" ${_VERSION})
-
- IF(NOT VC${_VERSION}_FOUND)
- DETECT_VC_VERSION_HELPER("HKEY_LOCAL_MACHINE" ${_VERSION})
- ENDIF()
-
- IF(VC${_VERSION}_FOUND)
- SET(VC_FOUND ON)
- SET(VC_DIR "${VC${_VERSION}_DIR}")
- ENDIF()
- ENDIF()
-ENDMACRO()
-
-MACRO(DETECT_EXPRESS_VERSION _VERSION)
- GET_FILENAME_COMPONENT(MSVC_EXPRESS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\${_VERSION}\\Setup\\VC;ProductDir]" ABSOLUTE)
-
- IF(MSVC_EXPRESS AND NOT MSVC_EXPRESS STREQUAL "/registry")
- SET(MSVC_EXPRESS ON)
- ENDIF()
-ENDMACRO()
-
-IF(MSVC_VERSION GREATER 1909)
- DETECT_VC_VERSION("15.0")
- SET(MSVC_TOOLSET "140")
-
- SET(VC_DIR "${VC_DIR}Tools/MSVC")
-
- FILE(GLOB MSVC_TOOLCHAIN_VERSIONS RELATIVE ${VC_DIR} "${VC_DIR}/*")
-
- IF(MSVC_TOOLCHAIN_VERSIONS)
- LIST(SORT MSVC_TOOLCHAIN_VERSIONS)
- LIST(REVERSE MSVC_TOOLCHAIN_VERSIONS)
- ENDIF()
-
- IF(NOT MSVC_TOOLCHAIN_VERSIONS)
- MESSAGE(FATAL_ERROR "No MSVC version found in default search path ${VC_DIR}")
- ENDIF()
-
- LIST(GET MSVC_TOOLCHAIN_VERSIONS 0 MSVC_TOOLCHAIN_VERSION)
-
- SET(VC_DIR "${VC_DIR}/${MSVC_TOOLCHAIN_VERSION}")
- SET(VC_INCLUDE_DIR "${VC_DIR}/include")
-ELSEIF(MSVC14)
- DETECT_VC_VERSION("14.0")
- SET(MSVC_TOOLSET "140")
-ELSEIF(MSVC12)
- DETECT_VC_VERSION("12.0")
- SET(MSVC_TOOLSET "120")
-ELSEIF(MSVC11)
- DETECT_VC_VERSION("11.0")
- SET(MSVC_TOOLSET "110")
-ELSEIF(MSVC10)
- DETECT_VC_VERSION("10.0")
- SET(MSVC_TOOLSET "100")
-ELSEIF(MSVC90)
- DETECT_VC_VERSION("9.0")
- SET(MSVC_TOOLSET "90")
-ELSEIF(MSVC80)
- DETECT_VC_VERSION("8.0")
- SET(MSVC_TOOLSET "80")
-ENDIF()
-
-# If you plan to use VC++ compilers with WINE, set VC_DIR environment variable
-IF(NOT VC_DIR)
- SET(VC_DIR $ENV{VC_DIR})
- # Fix path
- FILE(TO_CMAKE_PATH ${VC_DIR} VC_DIR)
-ENDIF()
-
-IF(NOT VC_DIR)
- IF(CMAKE_CXX_COMPILER)
- SET(_COMPILER ${CMAKE_CXX_COMPILER})
- ELSE()
- SET(_COMPILER ${CMAKE_C_COMPILER})
- ENDIF()
- STRING(REGEX REPLACE "/(bin|BIN|Bin)/.+" "" VC_DIR ${_COMPILER})
-ENDIF()
-
-IF(NOT VC_INCLUDE_DIR AND VC_DIR AND EXISTS "${VC_DIR}")
- SET(VC_INCLUDE_DIR "${VC_DIR}/include")
- IF(EXISTS "${VC_INCLUDE_DIR}")
- SET(VC_FOUND ON)
- ENDIF()
-ENDIF()
-
-SET(MSVC_REDIST_DIR "${EXTERNAL_PATH}/redist")
-
-IF(NOT EXISTS "${MSVC_REDIST_DIR}")
- SET(MSVC_REDIST_DIR "${VC_DIR}/redist")
-
- IF(NOT EXISTS "${MSVC_REDIST_DIR}")
- SET(MSVC_REDIST_DIR)
- ENDIF()
-ENDIF()
-
-IF(MSVC_REDIST_DIR)
- IF(MSVC1411 OR MSVC1410)
- # If you have VC++ 2017 Express, put x64/Microsoft.VC141.CRT/*.dll in ${EXTERNAL_PATH}/redist
- # original files whould be in ${VC_DIR}/Redist/MSVC/14.11.25325/x64/Microsoft.VC141.CRT
- SET(MSVC14_REDIST_DIR "${MSVC_REDIST_DIR}")
- ELSEIF(MSVC14)
- SET(MSVC14_REDIST_DIR "${MSVC_REDIST_DIR}")
- ELSEIF(MSVC12)
- # If you have VC++ 2013 Express, put x64/Microsoft.VC120.CRT/*.dll in ${EXTERNAL_PATH}/redist
- SET(MSVC12_REDIST_DIR "${MSVC_REDIST_DIR}")
- ELSEIF(MSVC11)
- # If you have VC++ 2012 Express, put x64/Microsoft.VC110.CRT/*.dll in ${EXTERNAL_PATH}/redist
- SET(MSVC11_REDIST_DIR "${MSVC_REDIST_DIR}")
- ELSEIF(MSVC10)
- # If you have VC++ 2010 Express, put x64/Microsoft.VC100.CRT/*.dll in ${EXTERNAL_PATH}/redist
- SET(MSVC10_REDIST_DIR "${MSVC_REDIST_DIR}")
- ELSEIF(MSVC90)
- SET(MSVC90_REDIST_DIR "${MSVC_REDIST_DIR}")
- ELSEIF(MSVC80)
- SET(MSVC80_REDIST_DIR "${MSVC_REDIST_DIR}")
- ENDIF()
-ENDIF()
-
-MESSAGE(STATUS "Using headers from ${VC_INCLUDE_DIR}")
-
-SET(VC_INCLUDE_DIRS ${VC_INCLUDE_DIR})
-INCLUDE_DIRECTORIES(${VC_INCLUDE_DIR})
+# - Find MS Visual C++
+#
+# VC_INCLUDE_DIR - where to find headers
+# VC_INCLUDE_DIRS - where to find headers
+# VC_LIBRARY_DIR - where to find libraries
+# VC_FOUND - True if MSVC found.
+
+MACRO(DETECT_VC_VERSION_HELPER _ROOT _VERSION)
+ # Software/Wow6432Node/...
+ GET_FILENAME_COMPONENT(VC${_VERSION}_DIR "[${_ROOT}\\SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VC7;${_VERSION}]" ABSOLUTE)
+
+ IF(VC${_VERSION}_DIR AND VC${_VERSION}_DIR STREQUAL "/registry")
+ SET(VC${_VERSION}_DIR)
+ GET_FILENAME_COMPONENT(VC${_VERSION}_DIR "[${_ROOT}\\SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VS7;${_VERSION}]" ABSOLUTE)
+ IF(VC${_VERSION}_DIR AND NOT VC${_VERSION}_DIR STREQUAL "/registry")
+ SET(VC${_VERSION}_DIR "${VC${_VERSION}_DIR}VC/")
+ ENDIF()
+ ENDIF()
+
+ IF(VC${_VERSION}_DIR AND NOT VC${_VERSION}_DIR STREQUAL "/registry")
+ SET(VC${_VERSION}_FOUND ON)
+ DETECT_EXPRESS_VERSION(${_VERSION})
+ IF(NOT MSVC_FIND_QUIETLY)
+ SET(_VERSION_STR ${_VERSION})
+ IF(MSVC_EXPRESS)
+ SET(_VERSION_STR "${_VERSION_STR} Express")
+ ENDIF()
+ MESSAGE(STATUS "Found Visual C++ ${_VERSION_STR} in ${VC${_VERSION}_DIR}")
+ ENDIF()
+ ELSEIF(VC${_VERSION}_DIR AND NOT VC${_VERSION}_DIR STREQUAL "/registry")
+ SET(VC${_VERSION}_FOUND OFF)
+ SET(VC${_VERSION}_DIR "")
+ ENDIF()
+ENDMACRO()
+
+MACRO(DETECT_VC_VERSION _VERSION)
+ SET(VC${_VERSION}_FOUND OFF)
+ DETECT_VC_VERSION_HELPER("HKEY_CURRENT_USER" ${_VERSION})
+
+ IF(NOT VC${_VERSION}_FOUND)
+ DETECT_VC_VERSION_HELPER("HKEY_LOCAL_MACHINE" ${_VERSION})
+ ENDIF()
+
+ IF(VC${_VERSION}_FOUND)
+ SET(VC_FOUND ON)
+ SET(VC_DIR "${VC${_VERSION}_DIR}")
+ ENDIF()
+ENDMACRO()
+
+MACRO(DETECT_EXPRESS_VERSION _VERSION)
+ GET_FILENAME_COMPONENT(MSVC_EXPRESS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\${_VERSION}\\Setup\\VC;ProductDir]" ABSOLUTE)
+
+ IF(MSVC_EXPRESS AND NOT MSVC_EXPRESS STREQUAL "/registry")
+ SET(MSVC_EXPRESS ON)
+ ENDIF()
+ENDMACRO()
+
+IF(MSVC12)
+ DETECT_VC_VERSION("12.0")
+ SET(MSVC_TOOLSET "120")
+
+ IF(NOT MSVC12_REDIST_DIR)
+ # If you have VC++ 2013 Express, put x64/Microsoft.VC120.CRT/*.dll in ${EXTERNAL_PATH}/redist
+ SET(MSVC12_REDIST_DIR "${EXTERNAL_PATH}/redist")
+ ENDIF()
+ELSEIF(MSVC11)
+ DETECT_VC_VERSION("11.0")
+ SET(MSVC_TOOLSET "110")
+
+ IF(NOT MSVC11_REDIST_DIR)
+ # If you have VC++ 2012 Express, put x64/Microsoft.VC110.CRT/*.dll in ${EXTERNAL_PATH}/redist
+ SET(MSVC11_REDIST_DIR "${EXTERNAL_PATH}/redist")
+ ENDIF()
+ELSEIF(MSVC10)
+ DETECT_VC_VERSION("10.0")
+ SET(MSVC_TOOLSET "100")
+
+ IF(NOT MSVC10_REDIST_DIR)
+ # If you have VC++ 2010 Express, put x64/Microsoft.VC100.CRT/*.dll in ${EXTERNAL_PATH}/redist
+ SET(MSVC10_REDIST_DIR "${EXTERNAL_PATH}/redist")
+ ENDIF()
+ELSEIF(MSVC90)
+ DETECT_VC_VERSION("9.0")
+ SET(MSVC_TOOLSET "90")
+ELSEIF(MSVC80)
+ DETECT_VC_VERSION("8.0")
+ SET(MSVC_TOOLSET "80")
+ENDIF()
+
+# If you plan to use VC++ compilers with WINE, set VC_DIR environment variable
+IF(NOT VC_DIR)
+ SET(VC_DIR $ENV{VC_DIR})
+ENDIF()
+
+IF(NOT VC_DIR)
+ IF(CMAKE_CXX_COMPILER)
+ SET(_COMPILER ${CMAKE_CXX_COMPILER})
+ ELSE()
+ SET(_COMPILER ${CMAKE_C_COMPILER})
+ ENDIF()
+ STRING(REGEX REPLACE "/bin/.+" "" VC_DIR ${_COMPILER})
+ENDIF()
+
+SET(VC_INCLUDE_DIR "${VC_DIR}/include")
+SET(VC_INCLUDE_DIRS ${VC_INCLUDE_DIR})
+INCLUDE_DIRECTORIES(${VC_INCLUDE_DIR})
diff --git a/code/CMakeModules/FindMercurial.cmake b/code/CMakeModules/FindMercurial.cmake
index 4e6429357..f85952557 100644
--- a/code/CMakeModules/FindMercurial.cmake
+++ b/code/CMakeModules/FindMercurial.cmake
@@ -60,12 +60,12 @@ IF(Mercurial_HG_EXECUTABLE)
EXECUTE_PROCESS(COMMAND ${Mercurial_HG_EXECUTABLE} --version
OUTPUT_VARIABLE Mercurial_VERSION_HG
OUTPUT_STRIP_TRAILING_WHITESPACE)
-
+
STRING(REGEX REPLACE ".*version ([\\.0-9]+).*"
"\\1" Mercurial_VERSION_HG "${Mercurial_VERSION_HG}")
MACRO(Mercurial_WC_INFO dir prefix)
- EXECUTE_PROCESS(COMMAND ${Mercurial_HG_EXECUTABLE} log -r . --template "{rev};{node};{tags};{author}"
+ EXECUTE_PROCESS(COMMAND ${Mercurial_HG_EXECUTABLE} tip --template "{rev};{node};{tags};{author}"
WORKING_DIRECTORY ${dir}
OUTPUT_VARIABLE ${prefix}_WC_INFO
ERROR_VARIABLE Mercurial_hg_info_error
@@ -73,7 +73,7 @@ IF(Mercurial_HG_EXECUTABLE)
OUTPUT_STRIP_TRAILING_WHITESPACE)
IF(NOT ${Mercurial_hg_info_result} EQUAL 0)
- MESSAGE(SEND_ERROR "Command \"${Mercurial_HG_EXECUTABLE} log\" failed with output:\n${Mercurial_hg_info_error}")
+ MESSAGE(SEND_ERROR "Command \"${Mercurial_HG_EXECUTABLE} tip\" failed with output:\n${Mercurial_hg_info_error}")
ELSE()
LIST(LENGTH ${prefix}_WC_INFO _COUNT)
IF(_COUNT EQUAL 4)
diff --git a/code/CMakeModules/FindMySQL.cmake b/code/CMakeModules/FindMySQL.cmake
index 631a96224..f2b62fc59 100644
--- a/code/CMakeModules/FindMySQL.cmake
+++ b/code/CMakeModules/FindMySQL.cmake
@@ -16,12 +16,10 @@ IF(MYSQL_INCLUDE_DIR AND MYSQL_LIBRARIES)
ELSE()
FIND_PATH(MYSQL_INCLUDE_DIR mysql.h
- PATH_SUFFIXES mysql mariadb
+ PATH_SUFFIXES mysql
PATHS
/usr/include/mysql
- /usr/include/mariadb
/usr/local/include/mysql
- /usr/local/include/mariadb
/opt/local/include/mysql5/mysql
/opt/local/include/mysql55/mysql
/opt/local/include/mysql51/mysql
@@ -29,29 +27,28 @@ ELSE()
$ENV{SystemDrive}/MySQL/*/include)
IF(WIN32 AND MSVC)
- FIND_LIBRARY(MYSQL_LIBRARY_RELEASE NAMES libmysql mysqlclient libmariadb mariadbclient
+ FIND_LIBRARY(MYSQL_LIBRARY_RELEASE NAMES libmysql mysqlclient
PATHS
$ENV{ProgramFiles}/MySQL/*/lib/opt
$ENV{SystemDrive}/MySQL/*/lib/opt)
- FIND_LIBRARY(MYSQL_LIBRARY_DEBUG NAMES libmysqld mysqlclientd libmariadb mariadbclient
+
+ FIND_LIBRARY(MYSQL_LIBRARY_DEBUG NAMES libmysqld mysqlclientd
PATHS
$ENV{ProgramFiles}/MySQL/*/lib/opt
$ENV{SystemDrive}/MySQL/*/lib/opt)
ELSE()
- FIND_LIBRARY(MYSQL_LIBRARY_RELEASE NAMES mysqlclient mariadbclient
+ FIND_LIBRARY(MYSQL_LIBRARY_RELEASE NAMES mysqlclient
PATHS
/usr/lib
/usr/local/lib
- /usr/lib/mariadb
/usr/lib/mysql
/usr/local/lib/mysql
- /usr/local/lib/mariadb
/opt/local/lib/mysql5/mysql
/opt/local/lib/mysql55/mysql
/opt/local/lib/mysql51/mysql
)
- FIND_LIBRARY(MYSQL_LIBRARY_DEBUG NAMES mysqlclientd mariadbclientd
+ FIND_LIBRARY(MYSQL_LIBRARY_DEBUG NAMES mysqlclientd
PATHS
/usr/lib
/usr/local/lib
@@ -72,9 +69,6 @@ ELSE()
ENDIF()
FIND_PACKAGE(OpenSSL)
IF(OPENSSL_FOUND)
- IF(WIN32)
- SET(OPENSSL_LIBRARIES ${OPENSSL_LIBRARIES} Crypt32.lib)
- ENDIF()
SET(MYSQL_LIBRARIES ${MYSQL_LIBRARIES} ${OPENSSL_LIBRARIES})
ENDIF()
ENDIF()
@@ -83,10 +77,6 @@ ELSE()
IF(MYSQL_INCLUDE_DIR AND MYSQL_LIBRARIES)
SET(MYSQL_FOUND TRUE)
MESSAGE(STATUS "Found MySQL: ${MYSQL_INCLUDE_DIR}, ${MYSQL_LIBRARIES}")
- IF (MYSQL_LIBRARIES MATCHES "libmariadb" OR MYSQL_LIBRARIES MATCHES "mariadbclient")
- SET(MARIADB_FOUND TRUE)
- MESSAGE(STATUS "Found MariaDB.")
- ENDIF()
ELSE()
SET(MYSQL_FOUND FALSE)
MESSAGE(STATUS "MySQL not found.")
diff --git a/code/CMakeModules/FindNeL.cmake b/code/CMakeModules/FindNeL.cmake
deleted file mode 100644
index e75163cce..000000000
--- a/code/CMakeModules/FindNeL.cmake
+++ /dev/null
@@ -1,398 +0,0 @@
-# NEL_DIR can be specified as root directory
-
-# Returned variables
-# NELDRIVER_XXX_BINARY_DEBUG
-# NELDRIVER_XXX_BINARY_RELEASE
-# NELDRIVER_XXX_LIBRARY_DEBUG
-# NELDRIVER_XXX_LIBRARY_RELEASE
-# NELDRIVER_XXX_FOUND
-# NEL_DEFINITIONS
-# NEL_INCLUDE_DIR
-# NEL_INCLUDE_DIRS
-# NEL_LIBRARIES
-# NELXXX_FOUND
-# NELXXX_LIBRARIES
-
-
-INCLUDE(FindHelpers)
-
-# Init all variables we'll set
-SET(NEL_LIBRARIES)
-SET(NEL_INCLUDE_DIR)
-SET(NEL_INCLUDE_DIRS)
-SET(NEL_VERSION)
-SET(NEL_STATIC)
-SET(NEL_STATIC_DRIVERS)
-SET(NEL_VERSION_MAJOR)
-SET(NEL_VERSION_MINOR)
-SET(NEL_VERSION_PATCH)
-SET(NEL_REVISION)
-SET(NEL_VERSION)
-
-SET(NEL_MODULES_FOUND)
-SET(NEL_MODULES_AVAILABLE 3d georges gui ligo logic net pacs sound) # cegui pipeline
-
-SET(NEL_DRIVERS_FOUND)
-SET(NEL_DRIVERS_AVAILABLE opengl opengles direct3d dsound fmod openal xaudio2)
-
-SET(NELMISC_FIND_REQUIRED ${NeL_FIND_REQUIRED})
-
-# Force search of NELMISC
-FIND_PACKAGE_HELPER(nelmisc nel/misc/types_nl.h RELEASE nelmisc_r nelmisc DEBUG nelmisc_d DIR ${NEL_DIR} VERBOSE QUIET)
-
-IF(NELMISC_FOUND)
- # define NEL_DIR if not specified
- IF(NOT NEL_DIR)
- GET_FILENAME_COMPONENT(NEL_DIR ${NELMISC_INCLUDE_DIR}/.. ABSOLUTE)
- ENDIF()
-
- # Aliases for include directory
- SET(NEL_INCLUDE_DIR ${NELMISC_INCLUDE_DIR})
- SET(NEL_INCLUDE_DIRS ${NEL_INCLUDE_DIR})
-
- MESSAGE(STATUS "Found NeL headers in ${NEL_INCLUDE_DIR}")
-
- GET_FILENAME_COMPONENT(NEL_LIBRARY_DIR ${NELMISC_LIBRARY} DIRECTORY)
-
- MESSAGE(STATUS "Found NeL library in ${NEL_LIBRARY_DIR}")
-
- # TODO: implement static version checks for Windows
-
- # static libraries
- IF(UNIX)
- GET_FILENAME_COMPONENT(_LIBEXT ${NELMISC_LIBRARY} EXT)
-
- IF(_LIBEXT STREQUAL ".a")
- SET(NEL_STATIC ON)
- MESSAGE(STATUS "NeL is using static libraries")
- ENDIF()
- ENDIF()
-
- IF(WIN32)
- SET(NELDRIVER_DIRS_TO_CHECK
- ${NEL_DIR}/bin${LIB_SUFFIX}
- ${NEL_DIR}
- )
- ELSE()
- SET(NELDRIVER_DIRS_TO_CHECK
- /usr/local/lib/${CMAKE_LIBRARY_ARCHITECTURE}/nel
- /usr/local/lib/${CMAKE_LIBRARY_ARCHITECTURE}
- /usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}/nel
- /usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}
- /usr/lib/nel
- /usr/lib
- )
- ENDIF()
-
- # check for static drivers
- FOREACH(_DRIVER ${NEL_DRIVERS_AVAILABLE})
- IF(WIN32)
- SET(_DRIVER_RELASE_FILE "nel_drv_${_DRIVER}_win_r")
- SET(_DRIVER_DEBUG_FILE "nel_drv_${_DRIVER}_win_d")
- SET(_DRIVER_SHARED_EXT dll)
- SET(_DRIVER_STATIC_EXT lib)
- ELSE()
- SET(_DRIVER_RELEASE_FILE "nel_drv_${_DRIVER}")
- SET(_DRIVER_DEBUG_FILE)
- SET(_DRIVER_SHARED_EXT so)
- SET(_DRIVER_STATIC_EXT a)
- ENDIF()
-
- STRING(TOUPPER ${_DRIVER} _UPDRIVER)
-
- FOREACH(_DIR ${NELDRIVER_DIRS_TO_CHECK})
- SET(_FOUND OFF)
-
- IF(_DRIVER_RELASE_FILE)
- SET(_FILE "${_DIR}/${_DRIVER_RELASE_FILE}.${_DRIVER_SHARED_EXT}")
- IF(EXISTS ${_FILE})
- SET(NELDRIVER_${_UPDRIVER}_BINARY_RELEASE ${_FILE})
-
- MESSAGE(STATUS "Found NeL release shared driver ${_DRIVER}: ${_FILE}")
-
- SET(NEL_STATIC_DRIVERS OFF)
-
- IF(NOT NEL_DRIVER_DIR)
- SET(NEL_DRIVER_DIR ${_DIR})
- ENDIF()
- ENDIF()
-
- SET(_FILE "${_DIR}/${_DRIVER_RELASE_FILE}.${_DRIVER_STATIC_EXT}")
- IF(EXISTS ${_FILE})
- SET(NELDRIVER_${_UPDRIVER}_LIBRARY_RELEASE ${_FILE})
-
- MESSAGE(STATUS "Found NeL release static driver ${_DRIVER}: ${_FILE}")
-
- SET(NEL_STATIC_DRIVERS ON)
-
- IF(NOT NEL_DRIVER_DIR)
- SET(NEL_DRIVER_DIR ${_DIR})
- ENDIF()
- ENDIF()
- ENDIF()
-
- IF(_DRIVER_DEBUG_FILE)
- SET(_FILE "${_DIR}/${_DRIVER_RELASE_FILE}.${_DRIVER_SHARED_EXT}")
- IF(EXISTS ${_FILE})
- SET(NELDRIVER_${_UPDRIVER}_BINARY_DEBUG ${_FILE})
-
- MESSAGE(STATUS "Found NeL debug shared driver ${_DRIVER}: ${_FILE}")
-
- SET(NEL_STATIC_DRIVERS OFF)
-
- IF(NOT NEL_DRIVER_DIR)
- SET(NEL_DRIVER_DIR ${_DIR})
- ENDIF()
- ENDIF()
-
- SET(_FILE "${_DIR}/${_DRIVER_RELASE_FILE}.${_DRIVER_STATIC_EXT}")
- IF(EXISTS ${_FILE})
- SET(NELDRIVER_${_UPDRIVER}_LIBRARY_DEBUG ${_FILE})
-
- MESSAGE(STATUS "Found NeL debug static driver ${_DRIVER}: ${_FILE}")
-
- SET(NEL_STATIC_DRIVERS ON)
-
- IF(NOT NEL_DRIVER_DIR)
- SET(NEL_DRIVER_DIR ${_DIR})
- ENDIF()
- ENDIF()
-
- IF(_FOUND)
- SET(NELDRIVER_${_UPDRIVER}_FOUND ON)
- LIST(APPEND NEL_DRIVERS_FOUND ${_DRIVER})
- ENDIF()
- ENDIF()
- ENDFOREACH()
- ENDFOREACH()
-
- MESSAGE(STATUS "Found NeL driver in ${NEL_DRIVER_DIR}")
-
- PARSE_VERSION_OTHER(${NEL_INCLUDE_DIR}/nel/misc/version_nl.h NL_VERSION_MAJOR NL_VERSION_MINOR NL_VERSION_PATCH NL_REVISION)
-
- SET(NEL_VERSION_MAJOR ${NL_VERSION_MAJOR})
- SET(NEL_VERSION_MINOR ${NL_VERSION_MINOR})
- SET(NEL_VERSION_PATCH ${NL_VERSION_PATCH})
- SET(NEL_REVISION ${NL_REVISION})
-
- IF(NOT NEL_VERSION)
- IF(NEL_VERSION_MAJOR OR NEL_VERSION_MINOR} OR NEL_VERSION_PATCH)
- SET(NEL_VERSION "${NEL_VERSION_MAJOR}.${NEL_VERSION_MINOR}.${NEL_VERSION_PATCH}")
- ELSE()
- SET(NEL_VERSION "0.5.0")
- ENDIF()
-
- IF(NEL_REVISION)
- SET(NEL_VERSION "${NEL_VERSION}.${NEL_REVISION}")
- ENDIF()
- ENDIF()
-
- FIND_PACKAGE(PNG REQUIRED)
- IF(PNG_FOUND)
- LIST(APPEND NELMISC_LIBRARIES ${PNG_LIBRARIES})
- ENDIF()
-
- FIND_PACKAGE(Jpeg REQUIRED)
- IF(JPEG_FOUND)
- LIST(APPEND NELMISC_LIBRARIES ${JPEG_LIBRARY})
- ENDIF()
-
- FIND_PACKAGE(GIF)
-
- IF(GIF_FOUND)
- LIST(APPEND NELMISC_LIBRARIES ${GIF_LIBRARY})
- ENDIF()
-
- FIND_LIBXML2()
-
- IF(LIBXML2_FOUND)
- LIST(APPEND NELMISC_LIBRARIES ${LIBXML2_LIBRARIES})
- ENDIF()
-
- LIST(REMOVE_ITEM NeL_FIND_COMPONENTS misc)
-
- LIST(APPEND NEL_MODULES_FOUND misc)
- LIST(APPEND NEL_LIBRARIES ${NELMISC_LIBRARIES})
-ENDIF()
-
-IF(NOT NeL_FIND_COMPONENTS)
- SET(NeL_FIND_COMPONENTS ${NEL_MODULES_AVAILABLE})
-
- # We can skip not installed modules
- SET(NeL_FIND_REQUIRED OFF)
-ENDIF()
-
-FOREACH(COMPONENT ${NeL_FIND_COMPONENTS})
- SET(_NAME NeL${COMPONENT})
- STRING(TOUPPER ${_NAME} _UPNAME)
-
- # module is required
- SET(${_NAME}_FIND_REQUIRED ${NeL_FIND_REQUIRED})
-
- IF(COMPONENT STREQUAL "3d")
- SET(HEADER_FILE shape.h)
-# ELSEIF(COMPONENT STREQUAL "cegui")
-# SET(HEADER_FILE shape.h)
- ELSEIF(COMPONENT STREQUAL "georges")
- SET(HEADER_FILE form.h)
- ELSEIF(COMPONENT STREQUAL "gui")
- SET(HEADER_FILE reflect.h)
- ELSEIF(COMPONENT STREQUAL "ligo")
- SET(HEADER_FILE primitive.h)
- ELSEIF(COMPONENT STREQUAL "logic")
- SET(HEADER_FILE logic_state.h)
- ELSEIF(COMPONENT STREQUAL "net")
- SET(HEADER_FILE sock.h)
- ELSEIF(COMPONENT STREQUAL "pacs")
- SET(HEADER_FILE primitive_block.h)
-# ELSEIF(COMPONENT STREQUAL "pipeline")
-# SET(HEADER_FILE shape.h)
- ELSEIF(COMPONENT STREQUAL "sound")
- SET(HEADER_FILE shape.h)
- ELSE()
- SET(HEADER_FILE)
- ENDIF()
-
- # display if a component has a wrong name
- IF(NOT HEADER_FILE)
- MESSAGE(STATUS "NeL module ${COMPONENT} not supported, ignoring it...")
- CONTINUE()
- ENDIF()
-
- FIND_PACKAGE_HELPER(${_NAME} nel/${COMPONENT}/${HEADER_FILE}
- RELEASE nel${COMPONENT}_r nel${COMPONENT}
- DEBUG nel${COMPONENT}_d
- QUIET)
-
- IF(${_UPNAME}_FOUND)
- LIST(APPEND NEL_MODULES_FOUND ${COMPONENT})
-
- IF(COMPONENT STREQUAL "3d")
- IF(NEL_STATIC)
- # 3rd party dependencies
- FIND_PACKAGE(Freetype REQUIRED)
- IF(FREETYPE_FOUND)
- LIST(APPEND ${_UPNAME}_LIBRARIES ${FREETYPE_LIBRARIES})
- ENDIF()
-
- # Append static 3D drivers
- IF(NEL_STATIC_DRIVERS)
- # Direct3D driver (only under Windows)
- IF(WIN32)
- IF(NELDRIVER_DIRECT3D_LIBRARY_DEBUG)
- LIST(APPEND ${_UPNAME}_LIBRARIES debug ${NELDRIVER_DIRECT3D_LIBRARY_DEBUG})
- ENDIF()
-
- IF(NELDRIVER_DIRECT3D_LIBRARY_RELEASE)
- LIST(APPEND ${_UPNAME}_LIBRARIES optimized ${NELDRIVER_DIRECT3D_LIBRARY_RELEASE})
- ENDIF()
- ENDIF()
-
- # OpenGL driver
- IF(NELDRIVER_OPENGL_LIBRARY_DEBUG)
- LIST(APPEND ${_UPNAME}_LIBRARIES debug ${NELDRIVER_OPENGL_LIBRARY_DEBUG})
- ENDIF()
-
- IF(NELDRIVER_OPENGL_LIBRARY_RELEASE)
- LIST(APPEND ${_UPNAME}_LIBRARIES optimized ${NELDRIVER_OPENGL_LIBRARY_RELEASE})
- ENDIF()
- ENDIF()
- ENDIF()
- ELSEIF(COMPONENT STREQUAL "gui")
- FIND_PACKAGE(Luabind REQUIRED)
-
- LIST(APPEND ${_UPNAME}_LIBRARIES ${LUABIND_LIBRARIES})
-
- FIND_LIBCURL()
-
- IF(CURL_FOUND)
- LIST(APPEND ${_UPNAME}_LIBRARIES ${CURL_LIBRARIES})
- LIST(APPEND ${_UPNAME}_DEFINITIONS ${CURL_DEFINITIONS})
- ENDIF()
-
- # TODO: remove complately OpenSSL requirement on Windows
-
- # Only used by libcurl under Linux
- FIND_PACKAGE(OpenSSL REQUIRED)
-
- IF(WIN32)
- LIST(APPEND OPENSSL_LIBRARIES Crypt32.lib)
- ENDIF()
-
- # Only Linux version of libcurl depends on OpenSSL
- LIST(APPEND CURL_INCLUDE_DIRS ${OPENSSL_INCLUDE_DIR})
- LIST(APPEND CURL_LIBRARIES ${OPENSSL_LIBRARIES})
-
- LIST(APPEND ${_UPNAME}_LIBRARIES ${LUABIND_LIBRARIES} ${CURL_LIBRARIES})
- LIST(APPEND NEL_DEFINITIONS ${${_UPNAME}_DEFINITIONS})
- ELSEIF(COMPONENT STREQUAL "sound")
- FIND_PACKAGE(Ogg REQUIRED)
-
- IF(OGG_FOUND)
- LIST(APPEND ${_UPNAME}_LIBRARIES ${OGG_LIBRARY})
- ENDIF()
-
- FIND_PACKAGE(Vorbis REQUIRED)
-
- IF(VORBIS_FOUND)
- LIST(APPEND ${_UPNAME}_LIBRARIES ${VORBIS_LIBRARY} ${VORBISFILE_LIBRARY})
- ENDIF()
-
- IF(NEL_STATIC)
- # Link to snd_lowlevel
- FIND_LIBRARY_HELPER(nelsnd_lowlevel RELEASE nelsnd_lowlevel_r DEBUG nelsnd_lowlevel_d DIR ${NEL_DIR} REQUIRED)
-
- IF(NELSND_LOWLEVEL_LIBRARIES)
- MESSAGE(STATUS "Found NeL sound lowlevel ${NELSND_LOWLEVEL_LIBRARIES}")
-
- LIST(APPEND NELSOUND_LIBRARIES ${NELSND_LOWLEVEL_LIBRARIES})
-
- IF(NEL_STATIC_DRIVERS)
- # DirectSound, XAudio2 and FMod drivers (only under Windows)
- IF(WIN32)
- # DirectSound
- IF(NELDRIVER_DIRECTSOUND_LIBRARY_DEBUG)
- LIST(APPEND NELSOUND_LIBRARIES debug ${NELDRIVER_DIRECTSOUND_LIBRARY_DEBUG})
- ENDIF()
-
- IF(NELDRIVER_DIRECTSOUND_LIBRARY_RELEASE)
- LIST(APPEND NELSOUND_LIBRARIES optimized ${NELDRIVER_DIRECTSOUND_LIBRARY_RELEASE})
- ENDIF()
-
- # FMod
- IF(NELDRIVER_FMOD_LIBRARY_DEBUG)
- LIST(APPEND NELSOUND_LIBRARIES debug ${NELDRIVER_FMOD_LIBRARY_DEBUG})
- ENDIF()
-
- IF(NELDRIVER_FMOD_LIBRARY_RELEASE)
- LIST(APPEND NELSOUND_LIBRARIES optimized ${NELDRIVER_FMOD_LIBRARY_RELEASE})
- ENDIF()
-
- # XAudio2
- IF(NELDRIVER_XAUDIO2_LIBRARY_DEBUG)
- LIST(APPEND NELSOUND_LIBRARIES debug ${NELDRIVER_XAUDIO2_LIBRARY_DEBUG})
- ENDIF()
-
- IF(NELDRIVER_XAUDIO2_LIBRARY_RELEASE)
- LIST(APPEND NELSOUND_LIBRARIES optimized ${NELDRIVER_XAUDIO2_LIBRARY_RELEASE})
- ENDIF()
- ENDIF()
-
- # OpenAL driver
- IF(NELDRIVER_OPENAL_LIBRARY_DEBUG)
- LIST(APPEND NELSOUND_LIBRARIES debug ${NELDRIVER_OPENAL_LIBRARY_DEBUG})
- ENDIF()
-
- IF(NELDRIVER_OPENAL_LIBRARY_RELEASE)
- LIST(APPEND NELSOUND_LIBRARIES optimized ${NELDRIVER_OPENAL_LIBRARY_RELEASE})
- ENDIF()
- ENDIF()
- ENDIF()
- ENDIF()
- ENDIF()
-
- LIST(APPEND NEL_LIBRARIES ${${_UPNAME}_LIBRARIES})
- ENDIF()
-ENDFOREACH()
-
-MESSAGE_VERSION_PACKAGE_HELPER(NeL ${NEL_VERSION} ${NEL_MODULES_FOUND})
diff --git a/code/CMakeModules/FindOgg.cmake b/code/CMakeModules/FindOgg.cmake
index c1f4492e1..8762afc5d 100644
--- a/code/CMakeModules/FindOgg.cmake
+++ b/code/CMakeModules/FindOgg.cmake
@@ -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)
diff --git a/code/CMakeModules/FindOpenGLES.cmake b/code/CMakeModules/FindOpenGLES.cmake
index 74a5b4021..35157b95b 100644
--- a/code/CMakeModules/FindOpenGLES.cmake
+++ b/code/CMakeModules/FindOpenGLES.cmake
@@ -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)
diff --git a/code/CMakeModules/FindRyzomGameShare.cmake b/code/CMakeModules/FindRyzomGameShare.cmake
deleted file mode 100644
index f76e4dd93..000000000
--- a/code/CMakeModules/FindRyzomGameShare.cmake
+++ /dev/null
@@ -1,14 +0,0 @@
-INCLUDE(FindHelpers)
-
-FIND_PACKAGE_HELPER(RyzomGameShare game_share/continent.h RELEASE ryzom_gameshare_r ryzom_gameshare DEBUG ryzom_gameshare_d DIR ${NEL_DIR} ${RYZOM_DIR} SUFFIXES ryzom)
-
-IF(RYZOMGAMESHARE_FOUND)
- FIND_PACKAGE(NeL REQUIRED)
- LIST(APPEND RYZOMGAMESHARE_INCLUDE_DIRS ${NEL_INCLUDE_DIRS})
- LIST(APPEND RYZOMGAMESHARE_LIBRARIES ${NELMISC_LIBRARIES} ${NELLIGO_LIBRARIES} ${NELNET_LIBRARIES} ${NELGEORGES_LIBRARIES})
-
- SET(RYZOM_GAMESHARE_LIBRARIES ${RYZOMGAMESHARE_LIBRARIES})
- SET(RYZOM_GAMESHARE_FOUND ${RYZOMGAMESHARE_FOUND})
- SET(RYZOM_GAMESHARE_INCLUDE_DIR ${RYZOMGAMESHARE_INCLUDE_DIR})
- SET(RYZOM_GAMESHARE_INCLUDE_DIRS ${RYZOMGAMESHARE_INCLUDE_DIRS})
-ENDIF()
diff --git a/code/CMakeModules/FindSTLport.cmake b/code/CMakeModules/FindSTLport.cmake
index 68e542ea5..22e0745ba 100644
--- a/code/CMakeModules/FindSTLport.cmake
+++ b/code/CMakeModules/FindSTLport.cmake
@@ -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)
diff --git a/code/CMakeModules/FindSquish.cmake b/code/CMakeModules/FindSquish.cmake
index 4242f4055..61250fec1 100644
--- a/code/CMakeModules/FindSquish.cmake
+++ b/code/CMakeModules/FindSquish.cmake
@@ -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)
diff --git a/code/CMakeModules/FindSteam.cmake b/code/CMakeModules/FindSteam.cmake
deleted file mode 100644
index 8d9b12372..000000000
--- a/code/CMakeModules/FindSteam.cmake
+++ /dev/null
@@ -1,74 +0,0 @@
-# - Locate Steam API
-# This module defines
-# STEAM_LIBRARY, the library to link against
-# STEAM_FOUND, if false, do not try to link to STEAM
-# STEAM_INCLUDE_DIR, where to find headers.
-
-IF(STEAM_LIBRARY AND STEAM_INCLUDE_DIR)
- # in cache already
- SET(Steam_FIND_QUIETLY TRUE)
-ENDIF()
-
-
-FIND_PATH(STEAM_INCLUDE_DIR
- steam_api.h
- PATH_SUFFIXES steam
- PATHS
- $ENV{STEAM_DIR}/public
-)
-
-IF(WIN32)
- IF(TARGET_X64)
- SET(STEAM_LIBNAME steam_api64)
- SET(STEAM_RUNTIMENAME steam_api64.dll)
- SET(STEAM_PATHNAME redistributable_bin/win64)
- ELSE()
- SET(STEAM_LIBNAME steam_api)
- SET(STEAM_RUNTIMENAME steam_api.dll)
- SET(STEAM_PATHNAME redistributable_bin)
- ENDIF()
-ELSEIF(APPLE)
- # universal binary
- SET(STEAM_LIBNAME steam_api)
- SET(STEAM_RUNTIMENAME libsteam_api.dylib)
- SET(STEAM_PATHNAME redistributable_bin/osx32)
-ELSE()
- SET(STEAM_LIBNAME steam_api)
- SET(STEAM_RUNTIMENAME libsteam_api.so)
- IF(TARGET_X64)
- SET(STEAM_PATHNAME redistributable_bin/linux64)
- ELSE()
- SET(STEAM_PATHNAME redistributable_bin/linux32)
- ENDIF()
-ENDIF()
-
-FIND_LIBRARY(STEAM_LIBRARY
- NAMES ${STEAM_LIBNAME}
- HINTS
- $ENV{STEAM_DIR}/${STEAM_PATHNAME}
-)
-
-FIND_FILE(STEAM_RUNTIME
- NAMES ${STEAM_RUNTIMENAME}
- HINTS
- $ENV{STEAM_DIR}/${STEAM_PATHNAME}
- PATHS
- ${EXTERNAL_BINARY_PATH}
- ${CMAKE_LIBRARY_PATH}
- /usr/local/lib
- /usr/lib
-)
-
-# Don't need to check STEAM_LIBRARY because we're dynamically loading Steam DLL
-IF(STEAM_INCLUDE_DIR)
- SET(STEAM_FOUND ON)
- SET(STEAM_LIBRARIES ${STEAM_LIBRARY})
- SET(STEAM_INCLUDE_DIRS ${STEAM_INCLUDE_DIR})
- IF(NOT Steam_FIND_QUIETLY)
- MESSAGE(STATUS "Found Steam: ${STEAM_INCLUDE_DIR} and ${STEAM_RUNTIME}")
- ENDIF()
-ELSE()
- IF(NOT Steam_FIND_QUIETLY)
- MESSAGE(STATUS "Warning: Unable to find Steam!")
- ENDIF()
-ENDIF()
diff --git a/code/CMakeModules/FindVorbis.cmake b/code/CMakeModules/FindVorbis.cmake
index 234d2d31a..95883fa59 100644
--- a/code/CMakeModules/FindVorbis.cmake
+++ b/code/CMakeModules/FindVorbis.cmake
@@ -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)
diff --git a/code/CMakeModules/FindWindowsSDK.cmake b/code/CMakeModules/FindWindowsSDK.cmake
index 3d9c43bd9..43864c6a6 100644
--- a/code/CMakeModules/FindWindowsSDK.cmake
+++ b/code/CMakeModules/FindWindowsSDK.cmake
@@ -35,7 +35,7 @@ MACRO(DETECT_WINKIT_VERSION _VERSION _SUFFIX)
SET(WINSDK${_VERSION}_FOUND ON)
SET(WINSDK${_VERSION}_VERSION_FULL "${_VERSION}")
IF(NOT WindowsSDK_FIND_QUIETLY)
- MESSAGE(STATUS "Found Windows Kit ${_VERSION} in ${WINSDK${_VERSION}_DIR}")
+ MESSAGE(STATUS "Found Windows SDK ${_VERSION} in ${WINSDK${_VERSION}_DIR}")
ENDIF()
LIST(APPEND WINSDK_DETECTED_VERSIONS ${_VERSION})
ELSE()
@@ -240,11 +240,7 @@ MACRO(USE_CURRENT_WINSDK)
IF(NOT WINSDK_DIR)
# Use Windows SDK versions installed with VC++ when possible
- IF(MSVC_VERSION GREATER 1909)
- # Special case, use Kits for SDK
- SET(WINSDK_VERSION "10.0")
- SET(WINSDK_DIR ${WINSDK_UCRT_DIR})
- ELSEIF(MSVC14)
+ IF(MSVC14)
SET(WINSDK_VERSION "8.1")
ELSEIF(MSVC12)
SET(WINSDK_VERSION "8.1")
@@ -259,19 +255,8 @@ MACRO(USE_CURRENT_WINSDK)
SET(WINSDK_VERSION "6.0A")
ENDIF()
ELSEIF(MSVC80)
- SET(WINSDK_MSVC80_COMPATIBLES "7.1" "7.1A" "7.0" "7.0A" "6.1" "6.0" "6.0A" "5.2A")
-
- # look for each Windows SDK supported by VC++ 2005 (7.1 is the latest)
- FOREACH(_VERSION ${WINSDK_DETECTED_VERSIONS})
- # look if this version of Windows SDK is installed
- LIST(FIND WINSDK_MSVC80_COMPATIBLES ${_VERSION} _FOUND)
- IF(NOT _FOUND EQUAL -1)
- SET(WINSDK_VERSION "${_VERSION}")
- BREAK()
- ENDIF()
- ENDFOREACH()
-
- IF(NOT MSVC_EXPRESS AND NOT WINSDK_VERSION)
+ IF(NOT MSVC_EXPRESS)
+ # TODO: fix this version
SET(WINSDK_VERSION "5.2A")
ENDIF()
ELSE()
@@ -309,7 +294,7 @@ MACRO(USE_CURRENT_WINSDK)
ENDMACRO()
IF(MSVC14)
- # Under VC++ 2015 and 2017, stdio.h, stdlib.h, etc... are part of UCRT
+ # Under VC++ 2015, stdio.h, stdlib.h, etc... are part of UCRT
SET(WINSDK_UCRT_VERSION "10.0")
ENDIF()
@@ -318,40 +303,6 @@ IF(WINSDK_UCRT_VERSION AND WINSDK${WINSDK_UCRT_VERSION}_FOUND)
SET(WINSDK_UCRT_DIR "${WINSDK${WINSDK_UCRT_VERSION}_DIR}")
ENDIF()
-IF(WINSDK_UCRT_DIR)
- # determine exact UCRT version
- SET(WINSDK_UCRT_INCLUDE_ROOT_DIR ${WINSDK_UCRT_DIR}/Include)
- SET(WINSDK_UCRT_LIB_ROOT_DIR ${WINSDK_UCRT_DIR}/Lib)
-
- FILE(GLOB UCRT_SUBDIRS RELATIVE ${WINSDK_UCRT_INCLUDE_ROOT_DIR} ${WINSDK_UCRT_INCLUDE_ROOT_DIR}/*)
- SET(UCRT_VERSION)
-
- FOREACH(UCRT_SUBDIR ${UCRT_SUBDIRS})
- IF(NOT UCRT_VERSION OR UCRT_SUBDIR VERSION_GREATER UCRT_VERSION)
- SET(UCRT_VERSION ${UCRT_SUBDIR})
- ENDIF()
- ENDFOREACH()
-
- IF(UCRT_VERSION)
- MESSAGE(STATUS "Using Windows UCRT ${UCRT_VERSION}")
-
- SET(WINSDK10_INCLUDE_DIR ${WINSDK_UCRT_INCLUDE_ROOT_DIR}/${UCRT_VERSION})
- SET(WINSDK10_LIBRARY_DIR ${WINSDK_UCRT_LIB_ROOT_DIR}/${UCRT_VERSION})
-
- # directory where UCRT headers are found
- FIND_PATH(WINSDK_UCRT_INCLUDE_DIR corecrt.h
- HINTS
- ${WINSDK10_INCLUDE_DIR}/ucrt
- )
-
- # directory where UCRT libraries are found
- FIND_PATH(WINSDK_UCRT_LIBRARY_DIR ucrt.lib
- HINTS
- ${WINSDK10_LIBRARY_DIR}/ucrt/${WINSDK8_SUFFIX}
- )
- ENDIF()
-ENDIF()
-
IF(WINSDK_VERSION STREQUAL "CURRENT")
USE_CURRENT_WINSDK()
ELSE()
@@ -372,87 +323,93 @@ ENDIF()
# directory where Win32 headers are found
FIND_PATH(WINSDK_INCLUDE_DIR Windows.h
HINTS
- ${WINSDK_DIR}/Include/${UCRT_VERSION}/um
${WINSDK_DIR}/Include/um
${WINSDK_DIR}/Include
- NO_DEFAULT_PATH
)
-MESSAGE(STATUS "Found Windows.h in ${WINSDK_INCLUDE_DIR}")
-
# directory where WinRT headers are found
FIND_PATH(WINSDK_WINRT_INCLUDE_DIR winstring.h
HINTS
- ${WINSDK_DIR}/Include/${UCRT_VERSION}/winrt
${WINSDK_DIR}/Include/winrt
- NO_DEFAULT_PATH
)
-MESSAGE(STATUS "Found winstring.h in ${WINSDK_WINRT_INCLUDE_DIR}")
-
# directory where DirectX headers are found
FIND_PATH(WINSDK_SHARED_INCLUDE_DIR d3d9.h
HINTS
- ${WINSDK_DIR}/Include/${UCRT_VERSION}/shared
${WINSDK_DIR}/Include/shared
- NO_DEFAULT_PATH
)
-MESSAGE(STATUS "Found d3d9.h in ${WINSDK_SHARED_INCLUDE_DIR}")
-
# directory where OpenGL headers are found
FIND_PATH(WINSDK_OPENGL_INCLUDE_DIR GL.h
HINTS
- ${WINSDK_INCLUDE_DIR}/gl
${WINSDK_DIR}/Include/um/gl
${WINSDK_DIR}/Include/gl
- NO_DEFAULT_PATH
)
-MESSAGE(STATUS "Found GL.h in ${WINSDK_OPENGL_INCLUDE_DIR}")
-
SET(WINSDK_LIBRARY_DIRS
- ${WINSDK_DIR}/Lib/${UCRT_VERSION}/um/${WINSDK8_SUFFIX}
${WINSDK_DIR}/Lib/winv6.3/um/${WINSDK8_SUFFIX}
${WINSDK_DIR}/Lib/win8/um/${WINSDK8_SUFFIX}
)
IF(WINSDK_SUFFIXES)
FOREACH(_SUFFIX ${WINSDK_SUFFIXES})
- LIST(APPEND WINSDK_LIBRARY_DIRS ${WINSDK_DIR}/Lib/${_SUFFIX})
+ SET(WINSDK_LIBRARY_DIRS ${WINSDK_LIBRARY_DIRS} ${WINSDK_DIR}/Lib/${_SUFFIX})
ENDFOREACH()
ELSE()
- LIST(APPEND WINSDK_LIBRARY_DIRS ${WINSDK_DIR}/Lib)
+ SET(WINSDK_LIBRARY_DIRS ${WINSDK_LIBRARY_DIRS} ${WINSDK_DIR}/Lib)
ENDIF()
# directory where all libraries are found
FIND_PATH(WINSDK_LIBRARY_DIR ComCtl32.lib
HINTS
${WINSDK_LIBRARY_DIRS}
- NO_DEFAULT_PATH
)
-MESSAGE(STATUS "Found ComCtl32.lib in ${WINSDK_LIBRARY_DIR}")
+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)
-SET(WINSDK_BINARY_DIRS
- ${WINSDK_DIR}/Bin/${UCRT_VERSION}/${WINSDK8_SUFFIX}
+ FILE(GLOB UCRT_SUBDIRS RELATIVE ${WINSDK_UCRT_INCLUDE_ROOT_DIR} ${WINSDK_UCRT_INCLUDE_ROOT_DIR}/*)
+ SET(UCRT_VERSION)
+
+ FOREACH(UCRT_SUBDIR ${UCRT_SUBDIRS})
+ IF(NOT UCRT_VERSION OR UCRT_SUBDIR VERSION_GREATER UCRT_VERSION)
+ SET(UCRT_VERSION ${UCRT_SUBDIR})
+ ENDIF()
+ ENDFOREACH()
+
+ IF(UCRT_VERSION)
+ MESSAGE(STATUS "Using Windows UCRT ${UCRT_VERSION}")
+
+ # directory where UCRT headers are found
+ FIND_PATH(WINSDK_UCRT_INCLUDE_DIR corecrt.h
+ HINTS
+ ${WINSDK_UCRT_INCLUDE_ROOT_DIR}/${UCRT_VERSION}/ucrt
+ )
+
+ # directory where UCRT libraries are found
+ FIND_PATH(WINSDK_UCRT_LIBRARY_DIR ucrt.lib
+ HINTS
+ ${WINSDK_UCRT_LIB_ROOT_DIR}/${UCRT_VERSION}/ucrt/${WINSDK8_SUFFIX}
+ )
+ ENDIF()
+ENDIF()
+
+# signtool is used to sign executables
+FIND_PROGRAM(WINSDK_SIGNTOOL signtool
+ HINTS
${WINSDK_DIR}/Bin/${WINSDK8_SUFFIX}
${WINSDK_DIR}/Bin/x86
${WINSDK_DIR}/Bin
)
-# signtool is used to sign executables
-FIND_PROGRAM(WINSDK_SIGNTOOL signtool
- HINTS
- ${WINSDK_BINARY_DIRS}
- NO_DEFAULT_PATH
-)
-
# midl is used to generate IDL interfaces
FIND_PROGRAM(WINSDK_MIDL midl
HINTS
- ${WINSDK_BINARY_DIRS}
- NO_DEFAULT_PATH
+ ${WINSDK_DIR}/Bin/${WINSDK8_SUFFIX}
+ ${WINSDK_DIR}/Bin/x86
+ ${WINSDK_DIR}/Bin
)
IF(WINSDK_INCLUDE_DIR)
@@ -476,7 +433,7 @@ IF(WINSDK_INCLUDE_DIR)
SET(WINSDK_INCLUDE_DIRS ${WINSDK_INCLUDE_DIRS} ${WINSDK_WINRT_INCLUDE_DIR})
ENDIF()
- INCLUDE_DIRECTORIES(${WINSDK_INCLUDE_DIRS})
+ INCLUDE_DIRECTORIES(${WINSDK_INCLUDE_DIRS}) # TODO: Move this after all other includes somehow...
IF(WINSDK_UCRT_LIBRARY_DIR)
SET(CMAKE_LIBRARY_PATH ${WINSDK_UCRT_LIBRARY_DIR} ${CMAKE_LIBRARY_PATH})
@@ -484,8 +441,8 @@ IF(WINSDK_INCLUDE_DIR)
SET(CMAKE_LIBRARY_PATH ${WINSDK_LIBRARY_DIR} ${CMAKE_LIBRARY_PATH})
- # Fix for using Windows SDK 7.1 with Visual C++ 2012, 2013, 2015 and 2017
- IF(WINSDK_VERSION STREQUAL "7.1" AND (MSVC11 OR MSVC12 OR MSVC14))
+ # Fix for using Windows SDK 7.1 with Visual C++ 2012
+ IF(WINSDK_VERSION STREQUAL "7.1" AND MSVC11)
ADD_DEFINITIONS(-D_USING_V110_SDK71_)
ENDIF()
ELSE()
diff --git a/code/CMakeModules/FindXF86VidMode.cmake b/code/CMakeModules/FindXF86VidMode.cmake
index 15dae03de..88fa40ad7 100644
--- a/code/CMakeModules/FindXF86VidMode.cmake
+++ b/code/CMakeModules/FindXF86VidMode.cmake
@@ -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)
diff --git a/code/CMakeModules/Findassimp.cmake b/code/CMakeModules/Findassimp.cmake
index b4bf0da99..41e53cf94 100644
--- a/code/CMakeModules/Findassimp.cmake
+++ b/code/CMakeModules/Findassimp.cmake
@@ -1,63 +1,29 @@
-IF(assimp_FIND_REQUIRED)
- SET(ASSIMP_FIND_REQUIRED ON)
-ENDIF()
-
FIND_PATH(
- ASSIMP_INCLUDE_DIRS
+ assimp_INCLUDE_DIRS
NAMES assimp/postprocess.h assimp/scene.h assimp/version.h assimp/config.h assimp/cimport.h
PATHS /usr/local/include/
)
FIND_LIBRARY(
- ASSIMP_LIBRARY_RELEASE
+ assimp_LIBRARIES
NAMES assimp
PATHS /usr/local/lib/
)
-FIND_LIBRARY(
- IRRXML_LIBRARY_RELEASE
- NAMES IrrXML
- PATHS /usr/local/lib/
-)
-
-FIND_LIBRARY(
- ASSIMP_LIBRARY_DEBUG
- NAMES assimpd
- PATHS /usr/local/lib/
-)
-
-FIND_LIBRARY(
- IRRXML_LIBRARY_DEBUG
- NAMES IrrXMLd
- PATHS /usr/local/lib/
-)
-
-IF (ASSIMP_INCLUDE_DIRS)
- SET(ASSIMP_FOUND TRUE)
- IF(ASSIMP_LIBRARY_RELEASE)
- SET(ASSIMP_LIBRARIES ${ASSIMP_LIBRARIES} optimized ${ASSIMP_LIBRARY_RELEASE})
- ENDIF()
- IF(ASSIMP_LIBRARY_DEBUG)
- SET(ASSIMP_LIBRARIES ${ASSIMP_LIBRARIES} debug ${ASSIMP_LIBRARY_DEBUG})
- ENDIF()
+IF (assimp_INCLUDE_DIRS AND assimp_LIBRARIES)
+ SET(assimp_FOUND TRUE)
FIND_PACKAGE(ZLIB)
IF(ZLIB_FOUND)
- SET(ASSIMP_LIBRARIES ${ASSIMP_LIBRARIES} ${ZLIB_LIBRARIES})
+ SET(assimp_LIBRARIES ${assimp_LIBRARIES} ${ZLIB_LIBRARIES})
ENDIF()
- IF(IRRXML_LIBRARY_RELEASE)
- SET(ASSIMP_LIBRARIES ${ASSIMP_LIBRARIES} optimized ${IRRXML_LIBRARY_RELEASE})
- ENDIF()
- IF(IRRXML_LIBRARY_DEBUG)
- SET(ASSIMP_LIBRARIES ${ASSIMP_LIBRARIES} debug ${IRRXML_LIBRARY_DEBUG})
- ENDIF()
-ENDIF()
+ENDIF (assimp_INCLUDE_DIRS AND assimp_LIBRARIES)
-IF (ASSIMP_FOUND)
- IF (NOT ASSIMP_FIND_QUIETLY)
- MESSAGE(STATUS "Found asset importer library: ${ASSIMP_LIBRARIES}")
- ENDIF ()
-ELSE (ASSIMP_FOUND)
- IF (ASSIMP_FIND_REQUIRED)
+IF (assimp_FOUND)
+ IF (NOT assimp_FIND_QUIETLY)
+ MESSAGE(STATUS "Found asset importer library: ${assimp_LIBRARIES}")
+ ENDIF (NOT assimp_FIND_QUIETLY)
+ELSE (assimp_FOUND)
+ IF (assimp_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find asset importer library")
- ENDIF ()
-ENDIF ()
+ ENDIF (assimp_FIND_REQUIRED)
+ENDIF (assimp_FOUND)
diff --git a/code/CMakeModules/GetRevision.cmake b/code/CMakeModules/GetRevision.cmake
index 17a617ba3..b29a8763e 100644
--- a/code/CMakeModules/GetRevision.cmake
+++ b/code/CMakeModules/GetRevision.cmake
@@ -1,103 +1,86 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.6.3)
-
-# ROOT_DIR should be set to root of the repository (where to find the .svn or .hg directory)
-# SOURCE_DIR should be set to root of your code (where to find CMakeLists.txt)
-# BINARY_DIR should be set to root of your build directory
-
-IF(SOURCE_DIR)
- # Replace spaces by semi-columns
- IF(CMAKE_MODULE_PATH)
- STRING(REPLACE " " ";" CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH})
- ENDIF()
-
- SET(CMAKE_MODULE_PATH ${SOURCE_DIR}/CMakeModules ${CMAKE_MODULE_PATH})
-
- IF(NOT ROOT_DIR AND SOURCE_DIR)
- SET(ROOT_DIR ${SOURCE_DIR})
- ENDIF()
-
- IF(NOT SOURCE_DIR AND ROOT_DIR)
- SET(SOURCE_DIR ${ROOT_DIR})
- ENDIF()
-ELSE()
- SET(SOURCE_DIR ${CMAKE_SOURCE_DIR})
- SET(ROOT_DIR ${CMAKE_SOURCE_DIR}/..)
-
- # convert ROOT_DIR to absolute path
- GET_FILENAME_COMPONENT(ROOT_DIR ${ROOT_DIR} ABSOLUTE)
-ENDIF()
-
-MACRO(NOW RESULT)
- IF(CMAKE_VERSION VERSION_GREATER "2.8.10")
- STRING(TIMESTAMP ${RESULT} "%Y-%m-%d %H:%M:%S")
- ELSE()
- IF(WIN32)
- EXECUTE_PROCESS(COMMAND "wmic" "os" "get" "localdatetime" OUTPUT_VARIABLE DATETIME)
- IF(NOT DATETIME MATCHES "ERROR")
- STRING(REGEX REPLACE ".*\n([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9]).*" "\\1-\\2-\\3 \\4:\\5:\\6" ${RESULT} "${DATETIME}")
- ENDIF()
- ELSEIF(UNIX)
- EXECUTE_PROCESS(COMMAND "date" "+%Y-%m-%d %H:%M:%S" OUTPUT_VARIABLE DATETIME)
- STRING(REGEX REPLACE "([0-9: -]+).*" "\\1" ${RESULT} "${DATETIME}")
- ELSE()
- MESSAGE(SEND_ERROR "date not implemented")
- SET(${RESULT} "0000-00-00 00:00:00")
- ENDIF()
- ENDIF()
-ENDMACRO()
-
-IF(EXISTS "${ROOT_DIR}/.svn/")
- FIND_PACKAGE(Subversion QUIET)
-
- IF(SUBVERSION_FOUND)
- Subversion_WC_INFO(${ROOT_DIR} ER)
- SET(REVISION ${ER_WC_REVISION})
- ENDIF()
-
- FIND_PACKAGE(TortoiseSVN QUIET)
-
- IF(TORTOISESVN_FOUND)
- TORTOISESVN_GET_REVISION(${ROOT_DIR} REVISION)
- ENDIF()
-ENDIF()
-
-IF(EXISTS "${ROOT_DIR}/.hg/")
- FIND_PACKAGE(Mercurial)
-
- IF(MERCURIAL_FOUND)
- Mercurial_WC_INFO(${ROOT_DIR} ER)
- SET(REVISION ${ER_WC_REVISION})
- SET(CHANGESET ${ER_WC_CHANGESET})
- SET(BRANCH ${ER_WC_BRANCH})
- ENDIF()
-ENDIF()
-
-IF(EXISTS "${ROOT_DIR}/.git/")
- FIND_PACKAGE(Git)
-
- IF(GIT_FOUND)
- Git_WC_INFO(${ROOT_DIR} ER)
- SET(REVISION ${ER_WC_REVISION})
- SET(CHANGESET ${ER_WC_CHANGESET})
- ENDIF()
-ENDIF()
-
-# if processing exported sources, use "revision" file if exists
-IF(SOURCE_DIR AND NOT DEFINED REVISION)
- SET(REVISION_FILE ${SOURCE_DIR}/revision)
- IF(EXISTS ${REVISION_FILE})
- FILE(STRINGS ${REVISION_FILE} REVISION LIMIT_COUNT 1)
- MESSAGE(STATUS "Read revision ${REVISION} from file")
- ENDIF()
-ENDIF()
-
-# Prevent crash if no revision from git or mercurial found
-IF(NOT DEFINED REVISION)
- SET(REVISION 0)
-ENDIF()
-
-IF(DEFINED REVISION)
- MESSAGE(STATUS "Found revision ${REVISION}")
-ELSE()
- SET(REVISION 0)
-ENDIF()
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6.3)
+
+# ROOT_DIR should be set to root of the repository (where to find the .svn or .hg directory)
+# SOURCE_DIR should be set to root of your code (where to find CMakeLists.txt)
+# BINARY_DIR should be set to root of your build directory
+
+IF(SOURCE_DIR)
+ # Replace spaces by semi-columns
+ IF(CMAKE_MODULE_PATH)
+ STRING(REPLACE " " ";" CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH})
+ ENDIF()
+
+ SET(CMAKE_MODULE_PATH ${SOURCE_DIR}/CMakeModules ${CMAKE_MODULE_PATH})
+
+ IF(NOT ROOT_DIR AND SOURCE_DIR)
+ SET(ROOT_DIR ${SOURCE_DIR})
+ ENDIF()
+
+ IF(NOT SOURCE_DIR AND ROOT_DIR)
+ SET(SOURCE_DIR ${ROOT_DIR})
+ ENDIF()
+ELSE()
+ SET(SOURCE_DIR ${CMAKE_SOURCE_DIR})
+ SET(ROOT_DIR ${CMAKE_SOURCE_DIR}/..)
+
+ # convert ROOT_DIR to absolute path
+ GET_FILENAME_COMPONENT(ROOT_DIR ${ROOT_DIR} ABSOLUTE)
+ENDIF()
+
+MACRO(NOW RESULT)
+ IF(CMAKE_VERSION VERSION_GREATER "2.8.10")
+ STRING(TIMESTAMP ${RESULT} "%Y-%m-%d %H:%M:%S")
+ ELSE()
+ IF(WIN32)
+ EXECUTE_PROCESS(COMMAND "wmic" "os" "get" "localdatetime" OUTPUT_VARIABLE DATETIME)
+ IF(NOT DATETIME MATCHES "ERROR")
+ STRING(REGEX REPLACE ".*\n([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9])([0-9][0-9]).*" "\\1-\\2-\\3 \\4:\\5:\\6" ${RESULT} "${DATETIME}")
+ ENDIF()
+ ELSEIF(UNIX)
+ EXECUTE_PROCESS(COMMAND "date" "+%Y-%m-%d %H:%M:%S" OUTPUT_VARIABLE DATETIME)
+ STRING(REGEX REPLACE "([0-9: -]+).*" "\\1" ${RESULT} "${DATETIME}")
+ ELSE()
+ MESSAGE(SEND_ERROR "date not implemented")
+ SET(${RESULT} "0000-00-00 00:00:00")
+ ENDIF()
+ ENDIF()
+ENDMACRO()
+
+IF(EXISTS "${ROOT_DIR}/.svn/")
+ FIND_PACKAGE(Subversion QUIET)
+
+ IF(SUBVERSION_FOUND)
+ Subversion_WC_INFO(${ROOT_DIR} ER)
+ SET(REVISION ${ER_WC_REVISION})
+ ENDIF()
+
+ FIND_PACKAGE(TortoiseSVN QUIET)
+
+ IF(TORTOISESVN_FOUND)
+ TORTOISESVN_GET_REVISION(${ROOT_DIR} REVISION)
+ ENDIF()
+ENDIF()
+
+IF(EXISTS "${ROOT_DIR}/.hg/")
+ FIND_PACKAGE(Mercurial)
+
+ IF(MERCURIAL_FOUND)
+ Mercurial_WC_INFO(${ROOT_DIR} ER)
+ SET(REVISION ${ER_WC_REVISION})
+ SET(CHANGESET ${ER_WC_CHANGESET})
+ SET(BRANCH ${ER_WC_BRANCH})
+ ENDIF()
+ENDIF()
+
+# if processing exported sources, use "revision" file if exists
+IF(SOURCE_DIR AND NOT DEFINED REVISION)
+ SET(REVISION_FILE ${SOURCE_DIR}/revision)
+ IF(EXISTS ${REVISION_FILE})
+ FILE(STRINGS ${REVISION_FILE} REVISION LIMIT_COUNT 1)
+ MESSAGE(STATUS "Read revision ${REVISION} from file")
+ ENDIF()
+ENDIF()
+
+IF(DEFINED REVISION)
+ MESSAGE(STATUS "Found revision ${REVISION}")
+ENDIF()
diff --git a/code/CMakeModules/OSXToolChain.cmake b/code/CMakeModules/OSXToolChain.cmake
deleted file mode 100644
index 3169aec78..000000000
--- a/code/CMakeModules/OSXToolChain.cmake
+++ /dev/null
@@ -1,131 +0,0 @@
-# Define OSX_SDK to force a specific version such as : -DOSX_SDK=10.11
-#
-# Example:
-# cmake ../code -DCMAKE_TOOLCHAIN_FILE=../code/CMakeModules/OSXToolChain.cmake -DWITH_NEL_TESTS=OFF -DWITH_RYZOM_SERVER=OFF -DWITH_NEL_TOOLS=OFF -DWITH_RYZOM_TOOLS=OFF -DWITH_LUA51=OFF -DWITH_LUA53=ON -DCMAKE_BUILD_TYPE=Release -DWITH_RYZOM_INSTALLER=OFF -DWITH_RYZOM_PATCH=ON -DWITH_NEL_TESTS=OFF -DWITH_NEL_TOOLS=OFF -DWITH_TOOLS=OFF -DWITH_NEL_SAMPLES=OFF -DWITH_WARNINGS=OFF -DWITH_QT5=OFF -DWITH_STATIC=ON -DWITH_STATIC_DRIVERS=ON -DWITH_STATIC_EXTERNAL=ON -DWITH_UNIX_STRUCTURE=OFF -DWITH_INSTALL_LIBRARIES=OFF -DWITH_RYZOM_SANDBOX=OFF -DOSX_SDK=10.11
-
-# Don't forget to define environment variables:
-#
-# export MACOSX_DEPLOYMENT_TARGET=10.7
-# export OSXCROSS_GCC_NO_STATIC_RUNTIME=1
-# export PATH=$PATH:/home/src/osxcross/target/bin
-#
-# ln -s /usr/bin/hg /home/src/osxcross/target/bin/hg
-#
-# To install all dependencies:
-# ./osxcross-macports install libxml2 jpeg curl libogg libvorbis freetype boost openssl zlib lua-5.3 giflib
-
-# to compile Luabind
-# export CMAKE_MODULE_PATH=$HOME/shard/tools/external/cmake/modules
-# cmake .. -DCMAKE_TOOLCHAIN_FILE=$HOME/ryzomcore/code/CMakeModules/OSXToolChain.cmake -DWITH_SHARED=OFF -DWITH_STATIC=ON -DWITH_LUA51=OFF -DWITH_LUA53=ON -DCMAKE_INSTALL_PREFIX=$HOME/osxcross/target/external
-
-IF(DEFINED CMAKE_CROSSCOMPILING)
- # subsequent toolchain loading is not really needed
- RETURN()
-ENDIF()
-
-# Force the compilers to Clang for OS X
-
-# C
-SET(CMAKE_C_COMPILER x86_64-apple-darwin15-clang)
-SET(CMAKE_C_STANDARD_COMPUTED_DEFAULT "11")
-SET(CMAKE_C_COMPILE_FEATURES "c_std_90;c_function_prototypes;c_std_99;c_restrict;c_variadic_macros;c_std_11;c_static_assert")
-SET(CMAKE_C90_COMPILE_FEATURES "c_std_90;c_function_prototypes")
-SET(CMAKE_C99_COMPILE_FEATURES "c_std_99;c_restrict;c_variadic_macros")
-SET(CMAKE_C11_COMPILE_FEATURES "c_std_11;c_static_assert")
-
-# C++
-SET(CMAKE_CXX_COMPILER x86_64-apple-darwin15-clang++)
-SET(CMAKE_CXX_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters;cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates;cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates;cxx_std_17")
-SET(CMAKE_CXX98_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters")
-SET(CMAKE_CXX11_COMPILE_FEATURES "cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates")
-SET(CMAKE_CXX14_COMPILE_FEATURES "cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates")
-SET(CMAKE_CXX17_COMPILE_FEATURES "cxx_std_17")
-
-# make
-SET(CMAKE_MAKE_PROGRAM make)
-
-# Skip the platform compiler checks for cross compiling.
-SET(CMAKE_CXX_COMPILER_FORCED TRUE)
-SET(CMAKE_C_COMPILER_FORCED TRUE)
-
-# Check if osxcross is installed
-EXECUTE_PROCESS(COMMAND which ${CMAKE_CXX_COMPILER} OUTPUT_VARIABLE COMPILER_FULLPATH OUTPUT_STRIP_TRAILING_WHITESPACE)
-
-IF(NOT COMPILER_FULLPATH)
- MESSAGE(FATAL_ERROR "Unable to find ${CMAKE_CXX_COMPILER}, are you sure osxcross is installed and is in PATH?")
-ENDIF()
-
-# Default paths
-GET_FILENAME_COMPONENT(CMAKE_OSX_TOOLCHAIN_ROOT ${COMPILER_FULLPATH} DIRECTORY)
-
-# Parent directory
-GET_FILENAME_COMPONENT(CMAKE_OSX_TOOLCHAIN_ROOT ${CMAKE_OSX_TOOLCHAIN_ROOT} DIRECTORY)
-
-SET(CMAKE_OSX_SYSROOT ${CMAKE_OSX_TOOLCHAIN_ROOT}/SDK)
-SET(MACPORTS_ROOT_DIR ${CMAKE_OSX_TOOLCHAIN_ROOT}/macports/pkgs/opt/local)
-SET(EXTERNAL_OSX_PATH ${CMAKE_OSX_TOOLCHAIN_ROOT}/external)
-
-# List of all SDKs that have been found
-SET(OSX_SDKS)
-
-FILE(GLOB _CMAKE_OSX_SDKS "${CMAKE_OSX_SYSROOT}/MacOSX*")
-IF(_CMAKE_OSX_SDKS)
- LIST(SORT _CMAKE_OSX_SDKS)
- LIST(REVERSE _CMAKE_OSX_SDKS)
- FOREACH(_CMAKE_OSX_SDK ${_CMAKE_OSX_SDKS})
- STRING(REGEX REPLACE ".+MacOSX([0-9.]+)\\.sdk" "\\1" _OSX_SDK "${_CMAKE_OSX_SDK}")
- LIST(APPEND OSX_SDKS ${_OSX_SDK})
- ENDFOREACH()
-ENDIF()
-
-# Find and use the most recent OS X sdk
-IF(NOT OSX_SDKS)
- MESSAGE(FATAL_ERROR "No OS X SDK's found in default search path ${CMAKE_OSX_SYSROOT}.")
-ENDIF()
-
-# if a specific SDK is defined, try to use it
-IF(OSX_SDK)
- LIST(FIND OSX_SDKS "${OSX_SDK}" _INDEX)
- IF(_INDEX EQUAL -1)
- # if specified SDK doesn't exist, use the last one
- LIST(GET OSX_SDKS 0 OSX_SDK)
- ENDIF()
-ELSE()
- # use the last SDK
- LIST(GET OSX_SDKS 0 OSX_SDK)
-ENDIF()
-
-MESSAGE(STATUS "Using OS X SDK ${OSX_SDK}")
-
-# Define final OS X sysroot
-SET(CMAKE_OSX_SYSROOT ${CMAKE_OSX_SYSROOT}/MacOSX${OSX_SDK}.sdk)
-
-# Standard settings
-SET(CMAKE_SYSTEM_NAME Darwin)
-SET(CMAKE_SYSTEM "Darwin-15.0.0")
-SET(CMAKE_SYSTEM_VERSION "15.0.0")
-SET(CMAKE_SYSTEM_PROCESSOR "x86_64")
-
-SET(UNIX ON)
-SET(APPLE ON)
-
-# Set the find root to the OS X developer roots and to user defined paths
-SET(CMAKE_FIND_ROOT_PATH ${CMAKE_OSX_TOOLCHAIN_ROOT} ${CMAKE_OSX_SYSROOT} ${CMAKE_PREFIX_PATH} ${CMAKE_INSTALL_PREFIX} ${MACPORTS_ROOT_DIR} ${EXTERNAL_OSX_PATH} $ENV{EXTERNAL_OSX_PATH} CACHE STRING "OS X find search path root")
-
-# default to searching for frameworks first
-SET(CMAKE_FIND_FRAMEWORK FIRST)
-
-# set up the default search directories for frameworks
-SET(CMAKE_SYSTEM_FRAMEWORK_PATH
- ${CMAKE_OSX_SYSROOT}/System/Library/Frameworks
- ${CMAKE_OSX_SYSROOT}/System/Library/PrivateFrameworks
- ${CMAKE_OSX_SYSROOT}/Developer/Library/Frameworks
-)
-
-# only search the OS X sdks, not the remainder of the host filesystem
-SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY)
-SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
-SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
-
-# determinate location for bin utils based on CMAKE_FIND_ROOT_PATH
-INCLUDE(CMakeFindBinUtils)
diff --git a/code/CMakeModules/PCHSupport.cmake b/code/CMakeModules/PCHSupport.cmake
index 5069ec40f..20539e87f 100644
--- a/code/CMakeModules/PCHSupport.cmake
+++ b/code/CMakeModules/PCHSupport.cmake
@@ -27,63 +27,23 @@ ELSE()
ENDIF()
ENDIF()
-MACRO(APPEND_DEFINITION _NAME _VAL)
- IF(CMAKE_VERSION VERSION_LESS "2.8.12")
- # don't support logical expressions, append definition
- LIST(APPEND ${_NAME} "-D${_VAL}")
- ELSE()
- # support logical expressions, use them
- LIST(APPEND ${_NAME} "$<$:-D$>")
- ENDIF()
-ENDMACRO()
-
# Set PCH_FLAGS for common flags, PCH_ARCH_XXX_FLAGS for specific archs flags and PCH_ARCHS for archs
MACRO(PCH_SET_COMPILE_FLAGS _target)
SET(PCH_FLAGS)
SET(PCH_ARCHS)
- SET(PCH_INCLUDES)
- # Append target for clang if defined
- IF(CMAKE_CXX_COMPILER_TARGET)
- LIST(APPEND PCH_FLAGS "--target=${CMAKE_CXX_COMPILER_TARGET}")
- ENDIF()
+ SET(_FLAGS)
+ LIST(APPEND _FLAGS ${CMAKE_CXX_FLAGS})
- IF(CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN)
- LIST(APPEND PCH_FLAGS "--gcc-toolchain=${CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN}")
- ENDIF()
-
- IF(CMAKE_SYSROOT)
- LIST(APPEND PCH_FLAGS "--sysroot=${CMAKE_SYSROOT}")
- ENDIF()
-
- IF(CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES)
- FOREACH(item ${CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES})
- LIST(APPEND PCH_FLAGS "-isystem ${item}")
- ENDFOREACH()
- ENDIF()
-
- # C++ flags
- SET(_FLAGS ${CMAKE_CXX_FLAGS})
- SEPARATE_ARGUMENTS(_FLAGS)
-
- LIST(APPEND PCH_FLAGS ${_FLAGS})
-
- # C++ config flags
STRING(TOUPPER "${CMAKE_BUILD_TYPE}" _UPPER_BUILD)
-
- SET(_FLAGS ${CMAKE_CXX_FLAGS_${_UPPER_BUILD}})
- SEPARATE_ARGUMENTS(_FLAGS)
-
- LIST(APPEND PCH_FLAGS ${_FLAGS})
+ 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(_FLAGS ${CMAKE_SHARED_LIBRARY_CXX_FLAGS})
- SEPARATE_ARGUMENTS(_FLAGS)
- LIST(APPEND PCH_FLAGS ${_FLAGS})
+ LIST(APPEND _FLAGS " ${CMAKE_SHARED_LIBRARY_CXX_FLAGS}")
ELSE()
GET_TARGET_PROPERTY(_pic ${_target} POSITION_INDEPENDENT_CODE)
IF(_pic)
@@ -93,90 +53,70 @@ MACRO(PCH_SET_COMPILE_FLAGS _target)
GET_DIRECTORY_PROPERTY(DIRINC INCLUDE_DIRECTORIES)
FOREACH(item ${DIRINC})
- LIST(APPEND PCH_INCLUDES "${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})
- APPEND_DEFINITION(GLOBAL_DEFINITIONS ${item})
+ LIST(APPEND GLOBAL_DEFINITIONS " -D${item}")
ENDFOREACH()
ENDIF()
GET_DIRECTORY_PROPERTY(DEFINITIONS COMPILE_DEFINITIONS_${_UPPER_BUILD})
IF(DEFINITIONS)
FOREACH(item ${DEFINITIONS})
- APPEND_DEFINITION(GLOBAL_DEFINITIONS ${item})
+ LIST(APPEND GLOBAL_DEFINITIONS " -D${item}")
ENDFOREACH()
ENDIF()
- GET_DIRECTORY_PROPERTY(DEFINITIONS DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMPILE_DEFINITIONS)
+ GET_DIRECTORY_PROPERTY(DEFINITIONS DIRECTORY ${CMAKE_SOURCE_DIR} COMPILE_DEFINITIONS)
IF(DEFINITIONS)
FOREACH(item ${DEFINITIONS})
- APPEND_DEFINITION(GLOBAL_DEFINITIONS ${item})
+ LIST(APPEND GLOBAL_DEFINITIONS " -D${item}")
ENDFOREACH()
ENDIF()
- GET_DIRECTORY_PROPERTY(DEFINITIONS DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMPILE_DEFINITIONS_${_UPPER_BUILD})
+ GET_DIRECTORY_PROPERTY(DEFINITIONS DIRECTORY ${CMAKE_SOURCE_DIR} COMPILE_DEFINITIONS_${_UPPER_BUILD})
IF(DEFINITIONS)
FOREACH(item ${DEFINITIONS})
- APPEND_DEFINITION(GLOBAL_DEFINITIONS ${item})
+ LIST(APPEND GLOBAL_DEFINITIONS " -D${item}")
ENDFOREACH()
ENDIF()
GET_TARGET_PROPERTY(oldProps ${_target} COMPILE_FLAGS)
IF(oldProps)
- SET(_FLAGS ${oldProps})
- SEPARATE_ARGUMENTS(_FLAGS)
- LIST(APPEND PCH_FLAGS ${_FLAGS})
+ LIST(APPEND _FLAGS " ${oldProps}")
ENDIF()
GET_TARGET_PROPERTY(oldPropsBuild ${_target} COMPILE_FLAGS_${_UPPER_BUILD})
IF(oldPropsBuild)
- SET(_FLAGS ${oldPropsBuild})
- SEPARATE_ARGUMENTS(_FLAGS)
- LIST(APPEND PCH_FLAGS ${_FLAGS})
+ LIST(APPEND _FLAGS " ${oldPropsBuild}")
ENDIF()
GET_TARGET_PROPERTY(DIRINC ${_target} INCLUDE_DIRECTORIES)
IF(DIRINC)
FOREACH(item ${DIRINC})
- LIST(APPEND PCH_INCLUDES "${item}")
+ LIST(APPEND _FLAGS " -I\"${item}\"")
ENDFOREACH()
ENDIF()
GET_TARGET_PROPERTY(DEFINITIONS ${_target} COMPILE_DEFINITIONS)
IF(DEFINITIONS)
FOREACH(item ${DEFINITIONS})
- APPEND_DEFINITION(GLOBAL_DEFINITIONS ${item})
+ LIST(APPEND GLOBAL_DEFINITIONS " -D${item}")
ENDFOREACH()
ENDIF()
GET_TARGET_PROPERTY(DEFINITIONS ${_target} COMPILE_DEFINITIONS_${_UPPER_BUILD})
IF(DEFINITIONS)
FOREACH(item ${DEFINITIONS})
- APPEND_DEFINITION(GLOBAL_DEFINITIONS ${item})
+ LIST(APPEND GLOBAL_DEFINITIONS " -D${item}")
ENDFOREACH()
ENDIF()
- GET_TARGET_PROPERTY(OPTIONS ${_target} COMPILE_OPTIONS)
- IF(OPTIONS)
- SEPARATE_ARGUMENTS(OPTIONS)
- LIST(APPEND PCH_FLAGS ${OPTIONS})
- ENDIF()
-
- GET_TARGET_PROPERTY(OPTIONS ${_target} COMPILE_OPTIONS_${_UPPER_BUILD})
- IF(OPTIONS)
- SEPARATE_ARGUMENTS(OPTIONS)
- LIST(APPEND PCH_FLAGS ${OPTIONS})
- ENDIF()
-
GET_TARGET_PROPERTY(_LIBS ${_target} INTERFACE_LINK_LIBRARIES)
IF(_LIBS)
FOREACH(_LIB ${_LIBS})
@@ -186,7 +126,7 @@ MACRO(PCH_SET_COMPILE_FLAGS _target)
IF(_DIRS)
FOREACH(item ${_DIRS})
- LIST(APPEND PCH_INCLUDES "${item}")
+ LIST(APPEND GLOBAL_DEFINITIONS " -I\"${item}\"")
ENDFOREACH()
ENDIF()
@@ -195,7 +135,10 @@ MACRO(PCH_SET_COMPILE_FLAGS _target)
IF(_DEFINITIONS)
FOREACH(item ${_DEFINITIONS})
- APPEND_DEFINITION(GLOBAL_DEFINITIONS ${item})
+ # don't use dynamic expressions
+ IF(NOT item MATCHES "\\$<")
+ LIST(APPEND GLOBAL_DEFINITIONS " -D${item}")
+ ENDIF()
ENDFOREACH()
ENDIF()
ENDIF()
@@ -206,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
@@ -215,88 +158,86 @@ MACRO(PCH_SET_COMPILE_FLAGS _target)
ENDIF()
IF(_USE_PIC)
- LIST(APPEND PCH_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)
-
- IF(_DIRECTORY_FLAGS)
- SEPARATE_ARGUMENTS(_DIRECTORY_FLAGS)
- FOREACH(item ${_DIRECTORY_FLAGS})
- LIST(APPEND PCH_FLAGS "${item}")
- ENDFOREACH()
- ENDIF()
-
- GET_DIRECTORY_PROPERTY(_DIRECTORY_DEFINITIONS DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DEFINITIONS)
-
- IF(_DIRECTORY_DEFINITIONS)
- SEPARATE_ARGUMENTS(_DIRECTORY_DEFINITIONS)
- FOREACH(item ${_DIRECTORY_DEFINITIONS})
- LIST(APPEND PCH_FLAGS "${item}")
- ENDFOREACH()
- ENDIF()
+ 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}")
ENDIF()
- IF(CMAKE_CXX11_EXTENSION_COMPILE_OPTION)
- LIST(APPEND PCH_FLAGS "${CMAKE_CXX11_EXTENSION_COMPILE_OPTION}")
- ENDIF()
-
- # Already in list form and items may contain non-leading spaces that should not be split on
- LIST(APPEND PCH_FLAGS "${GLOBAL_DEFINITIONS}")
-
- IF(WIN32)
- SET(SYSTEM_FLAG "[-/$]")
+ # Format definitions
+ IF(MSVC)
+ # Fix path with space
+ SEPARATE_ARGUMENTS(_FLAGS UNIX_COMMAND "${_FLAGS}")
ELSE()
- SET(SYSTEM_FLAG "[-$]")
+ STRING(REGEX REPLACE " +" " " _FLAGS ${_FLAGS})
+ SEPARATE_ARGUMENTS(_FLAGS)
ENDIF()
- SET(_FINAL_FLAGS)
- SET(_PREVIOUS_FLAG)
-
- FOREACH(_FLAG ${PCH_FLAGS})
- # If parameter is really a flag (starts with -)
- IF(_FLAG MATCHES "^${SYSTEM_FLAG}")
- IF(_PREVIOUS_FLAG)
- # Append previous flag
- LIST(APPEND _FINAL_FLAGS ${_PREVIOUS_FLAG})
- ENDIF()
-
- SET(_PREVIOUS_FLAG ${_FLAG})
- ELSE()
- IF(_PREVIOUS_FLAG)
- # Append previous flag and its parameter
- # TODO: escape them only if there is an space
- LIST(APPEND _FINAL_FLAGS "${_PREVIOUS_FLAG} \"${_FLAG}\"")
- SET(_PREVIOUS_FLAG)
+ IF(CLANG)
+ # Determining all architectures and get common flags
+ SET(_ARCH_NEXT)
+ SET(_XARCH_NEXT)
+ FOREACH(item ${_FLAGS})
+ IF(_ARCH_NEXT)
+ LIST(FIND PCH_ARCHS ${item} ITEM_FOUND)
+ IF(ITEM_FOUND EQUAL -1)
+ LIST(APPEND PCH_ARCHS ${item})
+ STRING(TOUPPER "${item}" _UPPER_ARCH)
+ SET(PCH_ARCH_${_UPPER_ARCH}_FLAGS "-arch" ${item})
+ ENDIF()
+ SET(_ARCH_NEXT OFF)
+ ELSEIF(_XARCH_NEXT)
+ SET(_XARCH_NEXT OFF)
ELSE()
- # Shouldn't happen
- MESSAGE(FATAL_ERROR "No previous flag before ${_FLAG}")
+ IF(item MATCHES "^-arch")
+ SET(_ARCH_NEXT ON)
+ ELSEIF(item MATCHES "^-Xarch_")
+ STRING(REGEX REPLACE "-Xarch_([a-z0-9_]+)" "\\1" item ${item})
+ LIST(FIND PCH_ARCHS ${item} ITEM_FOUND)
+ IF(ITEM_FOUND EQUAL -1)
+ LIST(APPEND PCH_ARCHS ${item})
+ STRING(TOUPPER "${item}" _UPPER_ARCH)
+ SET(PCH_ARCH_${_UPPER_ARCH}_FLAGS "-arch" ${item})
+ ENDIF()
+ SET(_XARCH_NEXT ON)
+ ELSE()
+ LIST(APPEND PCH_FLAGS ${item})
+ ENDIF()
ENDIF()
- ENDIF()
- ENDFOREACH()
+ ENDFOREACH()
- IF(_PREVIOUS_FLAG)
- LIST(APPEND _FINAL_FLAGS ${_PREVIOUS_FLAG})
+ # Get architcture specific flags
+ SET(_XARCH_NEXT)
+ FOREACH(item ${_FLAGS})
+ IF(_XARCH_NEXT)
+ STRING(TOUPPER "${_XARCH_NEXT}" _UPPER_XARCH)
+ LIST(APPEND PCH_ARCH_${_UPPER_XARCH}_FLAGS ${item})
+ SET(_XARCH_NEXT OFF)
+ ELSE()
+ IF(item MATCHES "^-Xarch_")
+ STRING(SUBSTRING "${item}" 7 -1 _XARCH_NEXT)
+ ENDIF()
+ ENDIF()
+ ENDFOREACH()
+
+ # Remove duplicated architectures
+ IF(_ARCHS AND PCH_ARCHS)
+ LIST(REMOVE_DUPLICATES PCH_ARCHS)
+ ENDIF()
+ ELSE()
+ SET(PCH_FLAGS ${_FLAGS})
ENDIF()
- SET(PCH_FLAGS ${_FINAL_FLAGS})
-
- # Remove flags that don't work with PCH
- LIST(REMOVE_ITEM PCH_FLAGS "-Wa,--noexecstack")
-
- # Remove all empty parameters
- LIST(REMOVE_ITEM PCH_FLAGS "")
-
- # Remove duplicate parameters
- LIST(REMOVE_DUPLICATES PCH_FLAGS)
-
- # create a command-line string
- STRING(REGEX REPLACE ";" " " PCH_FLAGS "${PCH_FLAGS}")
-
- # and separate arguments
- SEPARATE_ARGUMENTS(PCH_FLAGS)
+ IF(PCH_FLAGS)
+ LIST(REMOVE_DUPLICATES PCH_FLAGS)
+ ENDIF()
ENDMACRO()
MACRO(GET_PDB_FILENAME _out_filename _target)
@@ -306,21 +247,21 @@ 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)
-MACRO(PCH_SET_COMPILE_COMMAND _inputcpp _compile_FLAGS _includes)
+MACRO(PCH_SET_COMPILE_COMMAND _inputcpp _compile_FLAGS)
IF(CMAKE_CXX_COMPILER_ARG1)
# remove leading space in compiler argument
STRING(REGEX REPLACE "^ +" "" pchsupport_compiler_cxx_arg1 ${CMAKE_CXX_COMPILER_ARG1})
@@ -329,34 +270,18 @@ MACRO(PCH_SET_COMPILE_COMMAND _inputcpp _compile_FLAGS _includes)
ENDIF()
IF(MSVC)
- GET_PDB_FILENAME(_PDB_FILE ${_PCH_current_target})
-
- SET(PCH_TEMP_CONTENT)
-
- FOREACH(_include ${_includes})
- SET(PCH_TEMP_CONTENT "${PCH_TEMP_CONTENT} -I \"${_include}\"")
- ENDFOREACH()
-
- SET(PCH_TEMP_FILE ${CMAKE_CURRENT_BINARY_DIR}/pch_command.txt)
- FILE(WRITE ${PCH_TEMP_FILE} "${PCH_TEMP_CONTENT}")
-
- SET(PCH_COMMAND ${CMAKE_CXX_COMPILER} /nologo @${PCH_TEMP_FILE} ${pchsupport_compiler_cxx_arg1} ${_compile_FLAGS} /Yc /Fp"${PCH_OUTPUT}" ${_inputcpp} /Fd"${_PDB_FILE}" /c /Fo"${PCH_OUTPUT}.obj")
-
+ GET_PDB_FILENAME(PDB_FILE ${_PCH_current_target})
+ SET(PCH_COMMAND ${CMAKE_CXX_COMPILER} ${pchsupport_compiler_cxx_arg1} ${_compile_FLAGS} /Yc /Fp"${PCH_OUTPUT}" ${_inputcpp} /Fd"${PDB_FILE}" /c /Fo"${PCH_OUTPUT}.obj")
# Ninja PCH Support
# http://public.kitware.com/pipermail/cmake-developers/2012-March/003653.html
SET_SOURCE_FILES_PROPERTIES(${_inputcpp} PROPERTIES OBJECT_OUTPUTS "${PCH_OUTPUT}.obj")
ELSE()
SET(HEADER_FORMAT "c++-header")
- SET(_FLAGS)
+ SET(_FLAGS "")
IF(APPLE)
SET(HEADER_FORMAT "objective-${HEADER_FORMAT}")
- LIST(APPEND _FLAGS ${OBJC_FLAGS})
+ SET(_FLAGS -fobjc-abi-version=2 -fobjc-legacy-dispatch)
ENDIF()
-
- FOREACH(_include ${_includes})
- LIST(APPEND _FLAGS -I "${_include}")
- ENDFOREACH()
-
SET(PCH_COMMAND ${CMAKE_CXX_COMPILER} ${pchsupport_compiler_cxx_arg1} ${_compile_FLAGS} ${_FLAGS} -x ${HEADER_FORMAT} -o ${PCH_OUTPUT} -c ${PCH_INPUT})
ENDIF()
ENDMACRO()
@@ -441,8 +366,7 @@ MACRO(ADD_PRECOMPILED_HEADER_TO_TARGET _targetName)
ENDIF()
IF(APPLE)
- STRING(REPLACE ";" " " OBJC_FLAGS_STR "${OBJC_FLAGS}")
- SET(PCH_ADDITIONAL_COMPILER_FLAGS "${OBJC_FLAGS_STR} -x objective-c++ ${PCH_ADDITIONAL_COMPILER_FLAGS}")
+ SET(PCH_ADDITIONAL_COMPILER_FLAGS "-fobjc-abi-version=2 -fobjc-legacy-dispatch -x objective-c++ ${PCH_ADDITIONAL_COMPILER_FLAGS}")
ENDIF()
IF(WITH_PCH_DEBUG)
@@ -498,7 +422,7 @@ MACRO(ADD_PRECOMPILED_HEADER _targetName _inputh _inputcpp)
PCH_SET_PRECOMPILED_HEADER_OUTPUT(${_targetName} ${_inputh} ${_ARCH} "")
LIST(APPEND PCH_OUTPUTS ${PCH_OUTPUT})
- PCH_SET_COMPILE_COMMAND(${_inputcpp} "${PCH_ARCH_${_UPPER_ARCH}_FLAGS};${PCH_FLAGS}" "${PCH_INCLUDES}")
+ PCH_SET_COMPILE_COMMAND(${_inputcpp} "${PCH_ARCH_${_UPPER_ARCH}_FLAGS};${PCH_FLAGS}")
PCH_CREATE_TARGET(${_targetName} ${_targetName}_pch_${_ARCH})
ADD_PRECOMPILED_HEADER_TO_TARGET_ARCH(${_targetName} ${_ARCH})
@@ -507,7 +431,7 @@ MACRO(ADD_PRECOMPILED_HEADER _targetName _inputh _inputcpp)
PCH_SET_PRECOMPILED_HEADER_OUTPUT(${_targetName} ${_inputh} "" "")
LIST(APPEND PCH_OUTPUTS ${PCH_OUTPUT})
- PCH_SET_COMPILE_COMMAND(${_inputcpp} "${PCH_FLAGS}" "${PCH_INCLUDES}")
+ PCH_SET_COMPILE_COMMAND(${_inputcpp} "${PCH_FLAGS}")
PCH_CREATE_TARGET(${_targetName} ${_targetName}_pch)
ENDIF()
@@ -556,13 +480,7 @@ MACRO(ADD_NATIVE_PRECOMPILED_HEADER _targetName _inputh _inputcpp)
SET_TARGET_PROPERTIES(${_targetName} PROPERTIES XCODE_ATTRIBUTE_GCC_PRECOMPILE_PREFIX_HEADER "YES")
ELSE()
#Fallback to the "old" precompiled suppport
- IF(CMAKE_OSX_ARCHITECTURES AND TARGETS_COUNT GREATER 1)
- FOREACH(_ARCH ${CMAKE_OSX_ARCHITECTURES})
- ADD_PRECOMPILED_HEADER(${_targetName}_${_ARCH} ${_inputh} ${_inputcpp})
- ENDFOREACH()
- ELSE()
- ADD_PRECOMPILED_HEADER(${_targetName} ${_inputh} ${_inputcpp})
- ENDIF()
+ ADD_PRECOMPILED_HEADER(${_targetName} ${_inputh} ${_inputcpp})
ENDIF()
IF(TARGET ${_targetName}_static)
diff --git a/code/CMakeModules/iOSToolChain.cmake b/code/CMakeModules/iOSToolChain.cmake
index 7bcb57227..610045e33 100644
--- a/code/CMakeModules/iOSToolChain.cmake
+++ b/code/CMakeModules/iOSToolChain.cmake
@@ -35,6 +35,23 @@ SET(UNIX ON)
SET(APPLE ON)
SET(IOS ON)
+# Force the compilers to Clang for iOS
+include (CMakeForceCompiler)
+CMAKE_FORCE_C_COMPILER (clang Clang)
+CMAKE_FORCE_CXX_COMPILER (clang++ Clang)
+
+IF(CMAKE_CXX_COMPILER)
+ EXECUTE_PROCESS(COMMAND ${CMAKE_CXX_COMPILER} --version
+ OUTPUT_VARIABLE CLANG_VERSION_RAW
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+ STRING(REGEX REPLACE "Apple LLVM version ([\\.0-9]+).*"
+ "\\1" CMAKE_CXX_COMPILER_VERSION "${CLANG_VERSION_RAW}")
+
+ SET(CMAKE_C_COMPILER_VERSION ${CMAKE_CXX_COMPILER_VERSION})
+ SET(CMAKE_COMPILER_VERSION ${CMAKE_CXX_COMPILER_VERSION})
+ENDIF()
+
# Setup iOS platform
IF(NOT DEFINED IOS_PLATFORM)
SET(IOS_PLATFORM "OS")
@@ -145,14 +162,14 @@ IF(CMAKE_GENERATOR MATCHES Xcode)
ENDIF()
ELSE()
IF(${IOS_PLATFORM} STREQUAL "OS")
- SET(ARCHS armv7 arm64)
+ SET(ARCHS "armv7;arm64")
SET(CMAKE_SYSTEM_PROCESSOR "armv7")
ELSEIF(${IOS_PLATFORM} STREQUAL "SIMULATOR")
# iPhone simulator targets i386
SET(ARCHS "i386")
SET(CMAKE_SYSTEM_PROCESSOR "x86")
ELSEIF(${IOS_PLATFORM} STREQUAL "ALL")
- SET(ARCHS armv7 arm64 i386 x86_64)
+ SET(ARCHS "armv7;arm64;i386;x86_64")
SET(CMAKE_SYSTEM_PROCESSOR "armv7")
ENDIF()
ENDIF()
@@ -181,13 +198,5 @@ SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH)
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
-# Force the compilers to Clang for iOS
-SET(CMAKE_C_COMPILER clang)
-SET(CMAKE_CXX_COMPILER clang++)
-
-# Skip the platform compiler checks for cross compiling.
-SET(CMAKE_CXX_COMPILER_FORCED TRUE)
-SET(CMAKE_C_COMPILER_FORCED TRUE)
-
# determinate location for bin utils based on CMAKE_FIND_ROOT_PATH
-INCLUDE(CMakeFindBinUtils)
+include(CMakeFindBinUtils)
diff --git a/code/CMakeModules/nel.cmake b/code/CMakeModules/nel.cmake
index bd70dd2ff..5c2d99d30 100644
--- a/code/CMakeModules/nel.cmake
+++ b/code/CMakeModules/nel.cmake
@@ -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,32 +194,31 @@ 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)
- OPTION(WITH_STATIC_RUNTIMES "Use only static C++ runtimes" OFF)
IF(UNIX AND NOT APPLE)
OPTION(WITH_UNIX_STRUCTURE "Use UNIX structure (bin, include, lib)" ON )
ELSE()
@@ -247,7 +227,6 @@ MACRO(NL_SETUP_DEFAULT_OPTIONS)
OPTION(WITH_INSTALL_LIBRARIES "Install development files." ON )
OPTION(WITH_ASSIMP "Use assimp exporter" OFF)
- OPTION(WITH_LIBGSF "Use libgsf for max file library" OFF)
###
# GUI toolkits
@@ -258,9 +237,9 @@ 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
@@ -325,7 +304,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)
@@ -354,8 +333,6 @@ MACRO(NL_SETUP_RYZOM_DEFAULT_OPTIONS)
OPTION(WITH_RYZOM_CLIENT_UAC "Ask to run as Administrator" OFF)
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)
@@ -369,20 +346,10 @@ ENDMACRO(NL_SETUP_SNOWBALLS_DEFAULT_OPTIONS)
MACRO(ADD_PLATFORM_FLAGS _FLAGS)
SET(PLATFORM_CFLAGS "${PLATFORM_CFLAGS} ${_FLAGS}")
SET(PLATFORM_CXXFLAGS "${PLATFORM_CXXFLAGS} ${_FLAGS}")
-ENDMACRO()
-
-MACRO(ADD_PLATFORM_LINKFLAGS _FLAGS)
- SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} ${_FLAGS}")
-ENDMACRO()
-
-MACRO(CONVERT_VERSION_NUMBER _VERSION_NUMBER _BASE)
- SET(${_VERSION_NUMBER} 0)
- FOREACH(_ARG ${ARGN})
- MATH(EXPR ${_VERSION_NUMBER} "${${_VERSION_NUMBER}} * ${_BASE} + ${_ARG}")
- ENDFOREACH()
-ENDMACRO()
+ENDMACRO(ADD_PLATFORM_FLAGS)
MACRO(NL_SETUP_BUILD)
+
#-----------------------------------------------------------------------------
# Setup the buildmode variables.
#
@@ -392,60 +359,51 @@ 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")
- IF(CMAKE_CXX_LIBRARY_ARCHITECTURE)
- SET(HOST_CPU ${CMAKE_CXX_LIBRARY_ARCHITECTURE})
- ELSE()
- SET(HOST_CPU ${CMAKE_HOST_SYSTEM_PROCESSOR})
- ENDIF()
+ SET(HOST_CPU ${CMAKE_HOST_SYSTEM_PROCESSOR})
- IF(HOST_CPU MATCHES "(amd|AMD|x86_)64")
+ IF(HOST_CPU MATCHES "(amd|AMD)64")
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 ${HOST_CPU})
- ENDIF()
+ SET(TARGET_CPU ${CMAKE_SYSTEM_PROCESSOR})
+ ENDIF(NOT TARGET_CPU)
- IF(TARGET_CPU MATCHES "(amd|AMD|x86_)64")
+ 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 ${CMAKE_CXX_COMPILER_VERSION} compiler")
- ENDIF()
+ MESSAGE(STATUS "Using Clang compiler")
+ 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()
-
- IF(CMAKE_GENERATOR MATCHES "Ninja")
- SET(NINJA ON)
- MESSAGE(STATUS "Generating Ninja 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)
@@ -454,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}")
@@ -495,9 +453,6 @@ MACRO(NL_SETUP_BUILD)
SET(TARGET_X86 1)
ELSEIF(TARGET_CPU STREQUAL "x86")
SET(TARGET_X86 1)
- ELSEIF(TARGET_CPU STREQUAL "arm64")
- SET(TARGET_ARM 1)
- SET(TARGET_ARM64 1)
ELSEIF(TARGET_CPU STREQUAL "armv7s")
SET(TARGET_ARM 1)
SET(TARGET_ARMV7S 1)
@@ -514,40 +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_ARM64)
- ADD_PLATFORM_FLAGS("-DHAVE_ARM64")
- ENDIF()
-
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)
@@ -556,88 +507,77 @@ 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()
-
- SET(CUSTOM_FLAGS "" CACHE STRING "Custom compile flags (useful for /MPn)")
- IF(NOT ${CUSTOM_FLAGS} STREQUAL "")
- ADD_PLATFORM_FLAGS(${CUSTOM_FLAGS})
- ENDIF()
+ ENDIF(WITH_LOGGING)
IF(MSVC)
+ IF(MSVC_VERSION EQUAL "1700" AND NOT MSVC11)
+ SET(MSVC11 ON)
+ ENDIF(MSVC_VERSION EQUAL "1700" AND NOT MSVC11)
+
# Ignore default include paths
ADD_PLATFORM_FLAGS("/X")
IF(MSVC14)
- ADD_PLATFORM_FLAGS("/Gy-")
- # /Ox is working with VC++ 2015 and 2017, but custom optimizations don't exist
+ ADD_PLATFORM_FLAGS("/Gy- /MP")
+ # /Ox is working with VC++ 2015, 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}")
-
- # Special cases for VC++ 2017
- IF(MSVC_VERSION EQUAL "1911")
- SET(MSVC1411 ON)
- ELSEIF(MSVC_VERSION EQUAL "1910")
- SET(MSVC1410 ON)
- ENDIF()
ELSEIF(MSVC12)
- ADD_PLATFORM_FLAGS("/Gy-")
+ ADD_PLATFORM_FLAGS("/Gy- /MP /Zm1000")
# /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-")
+ ADD_PLATFORM_FLAGS("/Gy- /MP /Zm1000")
# /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-")
+ ADD_PLATFORM_FLAGS("/Gy- /MP /Zm1000")
# /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-")
+ ADD_PLATFORM_FLAGS("/Gy- /MP /Zm1000")
# 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")
+ ADD_PLATFORM_FLAGS("/Gy- /Wp64 /Zm1000")
# 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 /D_SCL_SECURE_NO_WARNINGS /D_WIN32 /DWIN32 /D_WINDOWS /wd4250")
-
- # huge PCH
- ADD_PLATFORM_FLAGS("/Zm1000")
+ ADD_PLATFORM_FLAGS("/D_CRT_SECURE_NO_DEPRECATE /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_WARNINGS /DWIN32 /D_WINDOWS /wd4250")
IF(TARGET_X64)
# Fix a bug with Intellisense
ADD_PLATFORM_FLAGS("/D_WIN64")
# Fix a compilation error for some big C++ files
- ADD_PLATFORM_FLAGS("/bigobj")
- ELSE()
+ SET(RELEASE_CFLAGS "${RELEASE_CFLAGS} /bigobj")
+ ELSE(TARGET_X64)
# Allows 32 bits applications to use 3 GB of RAM
- ADD_PLATFORM_LINKFLAGS("/LARGEADDRESSAWARE")
- ENDIF()
+ SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} /LARGEADDRESSAWARE")
+ ENDIF(TARGET_X64)
# Exceptions are only set for C++
SET(PLATFORM_CXXFLAGS "${PLATFORM_CXXFLAGS} /EHa")
@@ -645,46 +585,38 @@ 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)
- IF(WITH_STATIC_RUNTIMES)
- SET(RUNTIME_FLAG "/MT")
- ELSE()
- SET(RUNTIME_FLAG "/MD")
- ENDIF()
-
- SET(NL_DEBUG_CFLAGS "/Zi ${RUNTIME_FLAG}d /RTC1 /D_DEBUG ${DEBUG_CFLAGS} ${NL_DEBUG_CFLAGS}")
- SET(NL_RELEASE_CFLAGS "${RUNTIME_FLAG} /DNDEBUG ${RELEASE_CFLAGS} ${NL_RELEASE_CFLAGS}")
+ 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}")
SET(NL_DEBUG_LINKFLAGS "/DEBUG /OPT:NOREF /OPT:NOICF /NODEFAULTLIB:msvcrt ${MSVC_INCREMENTAL_YES_FLAG} ${NL_DEBUG_LINKFLAGS}")
SET(NL_RELEASE_LINKFLAGS "/OPT:REF /OPT:ICF /INCREMENTAL:NO ${NL_RELEASE_LINKFLAGS}")
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)
- SET(OBJC_FLAGS -fobjc-abi-version=2 -fobjc-legacy-dispatch -fobjc-weak)
-
IF(NOT XCODE)
IF(CMAKE_OSX_ARCHITECTURES)
SET(TARGETS_COUNT 0)
@@ -717,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)
@@ -817,90 +749,75 @@ 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}")
- ADD_PLATFORM_LINKFLAGS("${XARCH}-Wl,-iphoneos_version_min,${IOS_VERSION}")
- ENDIF()
+ SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} ${XARCH}-Wl,-iphoneos_version_min,${IOS_VERSION}")
+ 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}")
- ADD_PLATFORM_LINKFLAGS("${XARCH}-Wl,-iphoneos_version_min,${IOS_VERSION}")
- ENDIF()
+ SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} ${XARCH}-Wl,-iphoneos_version_min,${IOS_VERSION}")
+ 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}")
- ADD_PLATFORM_LINKFLAGS("${XARCH}-Wl,-iphoneos_version_min,${IOS_VERSION}")
- ENDIF()
- ENDIF()
+ SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} ${XARCH}-Wl,-iphoneos_version_min,${IOS_VERSION}")
+ 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)
- ADD_PLATFORM_LINKFLAGS("${XARCH}-Wl,-macosx_version_min,${CMAKE_OSX_DEPLOYMENT_TARGET}")
- ENDIF()
- ENDIF()
- ELSE()
+ SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} ${XARCH}-Wl,-macosx_version_min,${CMAKE_OSX_DEPLOYMENT_TARGET}")
+ 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)
- IF(CMAKE_OSX_DEPLOYMENT_TARGET VERSION_LESS "10.7")
- MESSAGE(FATAL_ERROR "Minimum target for OS X is 10.7 but you're using ${CMAKE_OSX_DEPLOYMENT_TARGET}")
- ENDIF()
- ADD_PLATFORM_LINKFLAGS("-Wl,-macosx_version_min,${CMAKE_OSX_DEPLOYMENT_TARGET}")
- ENDIF()
- ENDIF()
+ SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Wl,-macosx_version_min,${CMAKE_OSX_DEPLOYMENT_TARGET}")
+ ENDIF(CMAKE_OSX_DEPLOYMENT_TARGET)
+ ENDIF(IOS)
- # use libc++ under OX X to be able to use new C++ features (and else it'll use GCC 4.2.1 STL)
- # minimum target is now OS X 10.7
- SET(PLATFORM_CXXFLAGS "${PLATFORM_CXXFLAGS} -stdlib=libc++")
-
- ADD_PLATFORM_LINKFLAGS("-Wl,-headerpad_max_install_names")
+ SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Wl,-headerpad_max_install_names")
IF(HAVE_FLAG_SEARCH_PATHS_FIRST)
- ADD_PLATFORM_LINKFLAGS("-Wl,-search_paths_first")
- ENDIF()
- ENDIF()
- ELSE()
+ SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Wl,-search_paths_first")
+ 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)
- # use c++0x standard to use std::unique_ptr and std::shared_ptr
- IF(CMAKE_CXX11_EXTENSION_COMPILE_OPTION)
- SET(PLATFORM_CXXFLAGS "${PLATFORM_CXXFLAGS} ${CMAKE_CXX11_EXTENSION_COMPILE_OPTION}")
- ENDIF()
-
- ADD_PLATFORM_FLAGS("-D_REENTRANT")
-
- # hardening
- ADD_PLATFORM_FLAGS("-D_FORTIFY_SOURCE=2")
+ ADD_PLATFORM_FLAGS("-D_REENTRANT -fno-strict-aliasing")
IF(NOT WITH_LOW_MEMORY)
ADD_PLATFORM_FLAGS("-pipe")
@@ -908,23 +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")
- ELSE()
- # Check wrong formats in printf-like functions
- ADD_PLATFORM_FLAGS("-Wformat -Werror=format-security")
- ENDIF()
-
- # never display these warnings because they are minor
- ADD_PLATFORM_FLAGS("-Wno-unused-parameter -Wno-unused-variable -Wno-unused-function -Wno-unused-value")
-
- IF(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "6.0.0")
- ADD_PLATFORM_FLAGS("-Wno-unused-local-typedefs")
- ELSEIF(CLANG)
- ADD_PLATFORM_FLAGS("-Wno-unused-private-field -Wno-unused-local-typedef")
- ENDIF()
+ ADD_PLATFORM_FLAGS("-Wall -W -Wpointer-arith -Wsign-compare -Wno-deprecated-declarations -Wno-multichar -Wno-unused")
+ ENDIF(WITH_WARNINGS)
IF(ANDROID)
ADD_PLATFORM_FLAGS("--sysroot=${PLATFORM_ROOT}")
@@ -933,82 +838,68 @@ MACRO(NL_SETUP_BUILD)
ADD_PLATFORM_FLAGS("-Wa,--noexecstack")
IF(TARGET_ARM)
- ADD_PLATFORM_FLAGS("-fpic")
+ ADD_PLATFORM_FLAGS("-fpic -fstack-protector")
ADD_PLATFORM_FLAGS("-D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__")
IF(TARGET_ARMV7)
ADD_PLATFORM_FLAGS("-march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16")
- ADD_PLATFORM_LINKFLAGS("-march=armv7-a -Wl,--fix-cortex-a8")
+ 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 -finline-limit=64")
+ 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")
- ENDIF()
+ SET(DEBUG_CFLAGS "${DEBUG_CFLAGS} -fno-strict-aliasing")
+ SET(RELEASE_CFLAGS "${RELEASE_CFLAGS} -fstrict-aliasing")
+ 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")
- ADD_PLATFORM_FLAGS("-funswitch-loops -finline-limit=300")
+ ADD_PLATFORM_FLAGS("-fstack-protector -funswitch-loops -finline-limit=300")
+ SET(RELEASE_CFLAGS "${RELEASE_CFLAGS} -fstrict-aliasing")
+ SET(DEBUG_CFLAGS "${DEBUG_CFLAGS} -fno-strict-aliasing")
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")
+ 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()
- ADD_PLATFORM_LINKFLAGS("-Wl,-z,noexecstack")
- ADD_PLATFORM_LINKFLAGS("-L${PLATFORM_ROOT}/usr/lib")
- 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(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(NOT MINGW)
+ 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)
- # hardening
- ADD_PLATFORM_FLAGS("-fstack-protector --param=ssp-buffer-size=4")
-
- # If -fstack-protector or -fstack-protector-all enabled, enable too new warnings and fix possible link problems
- IF(WITH_WARNINGS)
- ADD_PLATFORM_FLAGS("-Wstack-protector")
- ENDIF()
-
- # Fix undefined reference to `__stack_chk_fail' error
- ADD_PLATFORM_LINKFLAGS("-lc")
+ SET(PLATFORM_CXXFLAGS "${PLATFORM_CXXFLAGS} -ftemplate-depth-48")
IF(NOT APPLE)
- ADD_PLATFORM_LINKFLAGS("-Wl,--no-undefined -Wl,--as-needed")
-
- IF(WITH_STATIC_RUNTIMES)
- ADD_PLATFORM_LINKFLAGS("-static-libstdc++")
- ENDIF()
- ENDIF()
-
- IF(NOT APPLE)
- # hardening
- ADD_PLATFORM_LINKFLAGS("-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now")
- ENDIF()
+ SET(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Wl,--no-undefined -Wl,--as-needed")
+ 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()
-ENDMACRO()
+ ENDIF(MSVC)
+ENDMACRO(NL_SETUP_BUILD)
MACRO(NL_SETUP_BUILD_FLAGS)
SET(CMAKE_C_FLAGS ${PLATFORM_CFLAGS} CACHE STRING "" FORCE)
@@ -1042,16 +933,10 @@ 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)
- IF(TARGET_X64 AND WIN32)
- SET(LIB_SUFFIX "64")
- ELSE()
- SET(LIB_SUFFIX "")
- ENDIF()
-
## Allow override of install_prefix/etc path.
IF(NOT NL_ETC_PREFIX)
IF(WITH_UNIX_STRUCTURE)
@@ -1075,7 +960,7 @@ MACRO(NL_SETUP_PREFIX_PATHS)
## Allow override of install_prefix/sbin path.
IF(NOT NL_SBIN_PREFIX)
IF(WITH_UNIX_STRUCTURE)
- SET(NL_SBIN_PREFIX "sbin${LIB_SUFFIX}" CACHE PATH "Installation path for admin tools and services.")
+ SET(NL_SBIN_PREFIX "sbin" CACHE PATH "Installation path for admin tools and services.")
ELSE()
SET(NL_SBIN_PREFIX "." CACHE PATH "Installation path for admin tools and services.")
ENDIF()
@@ -1085,7 +970,7 @@ MACRO(NL_SETUP_PREFIX_PATHS)
## Allow override of install_prefix/bin path.
IF(NOT NL_BIN_PREFIX)
IF(WITH_UNIX_STRUCTURE)
- SET(NL_BIN_PREFIX "bin${LIB_SUFFIX}" CACHE PATH "Installation path for tools and applications.")
+ SET(NL_BIN_PREFIX "bin" CACHE PATH "Installation path for tools and applications.")
ELSE()
SET(NL_BIN_PREFIX "." CACHE PATH "Installation path for tools and applications.")
ENDIF()
@@ -1097,7 +982,7 @@ MACRO(NL_SETUP_PREFIX_PATHS)
IF(LIBRARY_ARCHITECTURE)
SET(NL_LIB_PREFIX "lib/${LIBRARY_ARCHITECTURE}" CACHE PATH "Installation path for libraries.")
ELSE()
- SET(NL_LIB_PREFIX "lib${LIB_SUFFIX}" CACHE PATH "Installation path for libraries.")
+ SET(NL_LIB_PREFIX "lib" CACHE PATH "Installation path for libraries.")
ENDIF()
ENDIF()
NL_MAKE_ABSOLUTE_PREFIX(NL_LIB_PREFIX NL_LIB_ABSOLUTE_PREFIX)
@@ -1108,11 +993,7 @@ MACRO(NL_SETUP_PREFIX_PATHS)
IF(LIBRARY_ARCHITECTURE)
SET(NL_DRIVER_PREFIX "lib/${LIBRARY_ARCHITECTURE}/nel" CACHE PATH "Installation path for drivers.")
ELSE()
- IF(WIN32)
- SET(NL_DRIVER_PREFIX "bin${LIB_SUFFIX}" CACHE PATH "Installation path for drivers.")
- ELSE()
- SET(NL_DRIVER_PREFIX "lib${LIB_SUFFIX}/nel" CACHE PATH "Installation path for drivers.")
- ENDIF()
+ SET(NL_DRIVER_PREFIX "lib/nel" CACHE PATH "Installation path for drivers.")
ENDIF()
ELSE()
SET(NL_DRIVER_PREFIX "." CACHE PATH "Installation path for drivers.")
@@ -1129,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.
@@ -1145,7 +1026,7 @@ MACRO(RYZOM_SETUP_PREFIX_PATHS)
## Allow override of install_prefix/sbin path.
IF(NOT RYZOM_SBIN_PREFIX)
IF(WITH_UNIX_STRUCTURE)
- SET(RYZOM_SBIN_PREFIX "sbin${LIB_SUFFIX}" CACHE PATH "Installation path for admin tools and services.")
+ SET(RYZOM_SBIN_PREFIX "sbin" CACHE PATH "Installation path for admin tools and services.")
ELSE()
SET(RYZOM_SBIN_PREFIX "." CACHE PATH "Installation path for admin tools and services.")
ENDIF()
@@ -1155,7 +1036,7 @@ MACRO(RYZOM_SETUP_PREFIX_PATHS)
## Allow override of install_prefix/bin path.
IF(NOT RYZOM_BIN_PREFIX)
IF(WITH_UNIX_STRUCTURE)
- SET(RYZOM_BIN_PREFIX "bin${LIB_SUFFIX}" CACHE PATH "Installation path for tools.")
+ SET(RYZOM_BIN_PREFIX "bin" CACHE PATH "Installation path for tools.")
ELSE()
SET(RYZOM_BIN_PREFIX "." CACHE PATH "Installation path for tools and applications.")
ENDIF()
@@ -1167,9 +1048,9 @@ MACRO(RYZOM_SETUP_PREFIX_PATHS)
IF(LIBRARY_ARCHITECTURE)
SET(RYZOM_LIB_PREFIX "lib/${LIBRARY_ARCHITECTURE}" CACHE PATH "Installation path for libraries.")
ELSE()
- SET(RYZOM_LIB_PREFIX "lib${LIB_SUFFIX}" CACHE PATH "Installation path for libraries.")
+ 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.
@@ -1187,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)
@@ -1196,40 +1077,38 @@ 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)
IF(WITH_STATIC_EXTERNAL)
- # Look only for static libraries because systems libraries are using Frameworks
SET(CMAKE_FIND_LIBRARY_SUFFIXES .a)
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, iOS and Mac OS X have pthread, but no need to link to libpthread
- IF(ANDROID OR APPLE)
+ # Android and iOS have pthread
+ IF(ANDROID OR IOS)
SET(CMAKE_USE_PTHREADS_INIT 1)
SET(Threads_FOUND TRUE)
- ELSE()
- SET(THREADS_HAVE_PTHREAD_ARG ON)
- FIND_PACKAGE(Threads)
+ ELSE(ANDROID OR IOS)
+ FIND_PACKAGE(Threads REQUIRED)
# TODO: replace all -l by absolute path to 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
@@ -1237,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()
-ENDMACRO()
+ ENDIF(MSVC)
+ENDMACRO(SETUP_EXTERNAL)
diff --git a/code/nel/CMakeLists.txt b/code/nel/CMakeLists.txt
index 3470fcebb..b538feb4d 100644
--- a/code/nel/CMakeLists.txt
+++ b/code/nel/CMakeLists.txt
@@ -1,39 +1,49 @@
+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()
+ ENDIF(WITH_NEL_CEGUI)
+
+ENDIF(WITH_3D)
IF(WITH_SOUND)
FIND_PACKAGE(Ogg)
FIND_PACKAGE(Vorbis)
- FIND_PACKAGE(FFmpeg COMPONENTS AVCODEC AVFORMAT AVUTIL SWRESAMPLE)
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)
@@ -51,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()
diff --git a/code/nel/include/nel/3d/animatable.h b/code/nel/include/nel/3d/animatable.h
index 6e4a7b39f..09297ab2b 100644
--- a/code/nel/include/nel/3d/animatable.h
+++ b/code/nel/include/nel/3d/animatable.h
@@ -19,8 +19,6 @@
#include "nel/misc/types_nl.h"
#include "nel/misc/bit_set.h"
-#include "nel/misc/smart_ptr.h"
-
#include
#include
#include