Merge commit '6f545aedd5638e093f35f1e156d3ed4f9a91cb18' into feature/cdb-packed
commit
c624984da1
@ -0,0 +1,19 @@
|
|||||||
|
; 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
|
@ -0,0 +1,266 @@
|
|||||||
|
syntax: glob
|
||||||
|
|
||||||
|
# Various build directories
|
||||||
|
bin
|
||||||
|
obj
|
||||||
|
Debug
|
||||||
|
Release
|
||||||
|
ReleaseDebug
|
||||||
|
DebugFast
|
||||||
|
ReleaseDebugStatic
|
||||||
|
DebugFastStatic
|
||||||
|
|
||||||
|
# Test and application directories
|
||||||
|
screenshots
|
||||||
|
release
|
||||||
|
test
|
||||||
|
Temp
|
||||||
|
|
||||||
|
# NeL cache
|
||||||
|
*.packed_sheets
|
||||||
|
|
||||||
|
# Ryzom save
|
||||||
|
save_shard
|
||||||
|
last_loaded_char.bin
|
||||||
|
*.binprim
|
||||||
|
*.string_cache
|
||||||
|
graphs_output
|
||||||
|
default_c
|
||||||
|
|
||||||
|
# Windows compile
|
||||||
|
*.exe
|
||||||
|
*.dll
|
||||||
|
*.lib
|
||||||
|
*.obj
|
||||||
|
|
||||||
|
# Linux compile
|
||||||
|
*.a
|
||||||
|
*.la
|
||||||
|
*.lo
|
||||||
|
*.Po
|
||||||
|
*.Plo
|
||||||
|
*.o
|
||||||
|
*.so
|
||||||
|
*.so.*
|
||||||
|
*_debug
|
||||||
|
*.pc
|
||||||
|
*.gch
|
||||||
|
|
||||||
|
# Mac OS X compile
|
||||||
|
*.dylib
|
||||||
|
|
||||||
|
# Log dump files
|
||||||
|
report_refused
|
||||||
|
report_failed
|
||||||
|
exception_catched
|
||||||
|
*.stat
|
||||||
|
*.log
|
||||||
|
log.txt
|
||||||
|
|
||||||
|
# Max plugin extensions
|
||||||
|
*.dlx
|
||||||
|
*.dlm
|
||||||
|
*.dlu
|
||||||
|
|
||||||
|
# makeall build
|
||||||
|
.mode_static
|
||||||
|
|
||||||
|
# cmake build files & directories
|
||||||
|
CMakeFiles
|
||||||
|
CMakeCache.txt
|
||||||
|
cmake_install.cmake
|
||||||
|
CTestTestfile.cmake
|
||||||
|
CPackConfig.cmake
|
||||||
|
CPackSourceConfig.cmake
|
||||||
|
.libs
|
||||||
|
|
||||||
|
# Linux garbage
|
||||||
|
Makefile*
|
||||||
|
aclocal.m4
|
||||||
|
config.guess
|
||||||
|
config.sub
|
||||||
|
configure
|
||||||
|
depcomp
|
||||||
|
config.h.in
|
||||||
|
nelconfig.h.in
|
||||||
|
install-sh
|
||||||
|
ltmain.sh
|
||||||
|
missing
|
||||||
|
ylwrap
|
||||||
|
*.mk
|
||||||
|
|
||||||
|
# Visual Studio garbage
|
||||||
|
*.opensdf
|
||||||
|
UpgradeLog*.XML
|
||||||
|
_UpgradeReport_Files
|
||||||
|
BuildLog.htm
|
||||||
|
mt.dep
|
||||||
|
ipch
|
||||||
|
*.suo
|
||||||
|
*.ncb
|
||||||
|
*.user
|
||||||
|
*.ilk
|
||||||
|
*.pdb
|
||||||
|
*.aps
|
||||||
|
*.exp
|
||||||
|
*.idb
|
||||||
|
*.sdf
|
||||||
|
|
||||||
|
# Mac OS X garbage
|
||||||
|
.DS_Store
|
||||||
|
|
||||||
|
# Ryzom server garbage
|
||||||
|
aes_alias_name.cfg
|
||||||
|
aes_nagios_report.txt
|
||||||
|
aes_state.txt
|
||||||
|
*.launch_ctrl
|
||||||
|
*.state
|
||||||
|
*.start_count
|
||||||
|
|
||||||
|
# Vim and kwrite cache
|
||||||
|
*~
|
||||||
|
|
||||||
|
# Kdevelop4 garbage
|
||||||
|
*.kdev4
|
||||||
|
.kdev4
|
||||||
|
|
||||||
|
# intellij project folder
|
||||||
|
.idea/
|
||||||
|
|
||||||
|
# Python cache
|
||||||
|
*.pyd
|
||||||
|
*.pyc
|
||||||
|
|
||||||
|
# Qt compiler
|
||||||
|
moc_*.cpp
|
||||||
|
*.moc
|
||||||
|
|
||||||
|
# Misc garbage
|
||||||
|
*.rej
|
||||||
|
*.orig
|
||||||
|
*.cachefile
|
||||||
|
*.cache
|
||||||
|
*.patch
|
||||||
|
*.7z
|
||||||
|
3rdParty
|
||||||
|
.svn
|
||||||
|
thumbs.db
|
||||||
|
Thumbs.db
|
||||||
|
*.tpl.php
|
||||||
|
.SyncID
|
||||||
|
.SyncIgnore
|
||||||
|
.SyncArchive
|
||||||
|
|
||||||
|
# build
|
||||||
|
code/nel/build/*
|
||||||
|
code/nelns/build/*
|
||||||
|
code/snowballs/build/*
|
||||||
|
code/ryzom/build/*
|
||||||
|
code/build/*
|
||||||
|
code/build-2010/*
|
||||||
|
build/*
|
||||||
|
install/*
|
||||||
|
build_vc*
|
||||||
|
code/nel/tools/build_gamedata/configuration/buildsite.py
|
||||||
|
|
||||||
|
# Linux nel compile
|
||||||
|
code/nel/build/nel-config
|
||||||
|
code/nel/config.status
|
||||||
|
code/nel/include/nelconfig.h
|
||||||
|
code/nel/include/stamp-h1
|
||||||
|
code/nel/libtool
|
||||||
|
code/nel/nel-config
|
||||||
|
code/nel/samples/3d/cluster_viewer/cluster_viewer
|
||||||
|
code/nel/samples/3d/font/font
|
||||||
|
code/nel/samples/georges/georges
|
||||||
|
code/nel/samples/misc/command/command
|
||||||
|
code/nel/samples/misc/configfile/configfile
|
||||||
|
code/nel/samples/misc/debug/debug
|
||||||
|
code/nel/samples/misc/i18n/i18n
|
||||||
|
code/nel/samples/misc/log/log
|
||||||
|
code/nel/samples/misc/strings/strings
|
||||||
|
code/nel/samples/net/chat/chatclient
|
||||||
|
code/nel/samples/net/chat/chatserver
|
||||||
|
code/nel/samples/net/login_system/nls_frontend_service
|
||||||
|
code/nel/samples/net/login_system/nls_login_client
|
||||||
|
code/nel/samples/net/udp/udp_bench_client
|
||||||
|
code/nel/samples/net/udp/udp_bench_service
|
||||||
|
code/nel/samples/pacs/pacs_sample
|
||||||
|
code/nel/tools/3d/build_coarse_mesh/build_coarse_mesh
|
||||||
|
code/nel/tools/3d/build_far_bank/build_far_bank
|
||||||
|
code/nel/tools/3d/build_smallbank/build_smallbank
|
||||||
|
code/nel/tools/3d/ig_lighter/ig_lighter
|
||||||
|
code/nel/tools/3d/zone_dependencies/zone_dependencies
|
||||||
|
code/nel/tools/3d/zone_ig_lighter/zone_ig_lighter
|
||||||
|
code/nel/tools/3d/zone_lighter/zone_lighter
|
||||||
|
code/nel/tools/3d/zone_welder/zone_welder
|
||||||
|
code/nel/tools/misc/bnp_make/bnp_make
|
||||||
|
code/nel/tools/misc/disp_sheet_id/disp_sheet_id
|
||||||
|
code/nel/tools/misc/make_sheet_id/make_sheet_id
|
||||||
|
code/nel/tools/misc/xml_packer/xml_packer
|
||||||
|
code/nel/tools/pacs/build_ig_boxes/build_ig_boxes
|
||||||
|
code/nel/tools/pacs/build_indoor_rbank/build_indoor_rbank
|
||||||
|
code/nel/tools/pacs/build_rbank/build_rbank
|
||||||
|
code/ryzom/common/data_leveldesign/leveldesign/game_element/xp_table/skills.skill_tree
|
||||||
|
code/ryzom/common/data_leveldesign/leveldesign/game_element/xp_table/xptable.xp_table
|
||||||
|
code/ryzom/tools/server/sql/ryzom_admin_default_data.sql
|
||||||
|
|
||||||
|
|
||||||
|
# Linux server compile
|
||||||
|
code/ryzom/server/src/entities_game_service/entities_game_service
|
||||||
|
code/ryzom/server/src/frontend_service/frontend_service
|
||||||
|
code/ryzom/server/src/gpm_service/gpm_service
|
||||||
|
code/ryzom/server/src/input_output_service/input_output_service
|
||||||
|
code/ryzom/server/src/mirror_service/mirror_service
|
||||||
|
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
|
||||||
|
|
||||||
|
# AMS ignore
|
||||||
|
code/web/public_php/ams/is_installed
|
||||||
|
code/web/docs/ams/html
|
||||||
|
code/web/public_php/ams/templates_c
|
||||||
|
code/ryzom/tools/server/ryzom_ams/drupal
|
||||||
|
code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/autoload
|
||||||
|
code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/configs
|
||||||
|
code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/cron
|
||||||
|
code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/img
|
||||||
|
code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/plugins
|
||||||
|
code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/smarty
|
||||||
|
code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/translations
|
||||||
|
code/ryzom/tools/server/ryzom_ams/drupal_module/ryzommanage/ams_lib/libinclude.php
|
||||||
|
code/ryzom/tools/server/ryzom_ams/old
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# Tools and external directories
|
||||||
|
external
|
||||||
|
external_stlport
|
||||||
|
nel_tools*
|
||||||
|
ryzom_tools*
|
||||||
|
|
||||||
|
# Dumps
|
||||||
|
*.dmp
|
||||||
|
|
||||||
|
code/nel/tools/build_gamedata/processes/ai_wmap/ai_build_wmap.cfg
|
||||||
|
code/nel/tools/build_gamedata/processes/sheets/sheets_packer.cfg
|
||||||
|
code/nel/tools/build_gamedata/processes/rbank/build_rbank.cfg
|
||||||
|
code/nel/tools/build_gamedata/processes/zone/debug_zone_dependencies.cfg
|
||||||
|
code/web/public_php/config.php
|
||||||
|
code/web/public_php/is_installed
|
||||||
|
code/web/public_php/ams/files
|
||||||
|
code/web/public_php/db_version_lib
|
||||||
|
code/web/public_php/db_version_shard
|
||||||
|
code/web/public_php/db_version_tool
|
||||||
|
code/web/public_php/db_version_web
|
||||||
|
code/web/public_php/role_service
|
||||||
|
code/web/public_php/role_support
|
||||||
|
code/web/public_php/role_domain
|
||||||
|
code/web/public_php/db_version_ring
|
||||||
|
code/web/public_php/config_user.php
|
||||||
|
code/nel/tools/build_gamedata/processes/pz/build_world_packed_col.cfg
|
||||||
|
code/nel/tools/build_gamedata/processes/cartographer/island_screenshots.cfg
|
@ -0,0 +1,48 @@
|
|||||||
|
sudo: false
|
||||||
|
language: cpp
|
||||||
|
|
||||||
|
compiler:
|
||||||
|
- gcc
|
||||||
|
|
||||||
|
os:
|
||||||
|
- linux
|
||||||
|
matrix:
|
||||||
|
fast_finish: true
|
||||||
|
env:
|
||||||
|
- CMAKE_CONFIGURE_OPTIONS="-DWITH_NEL_TESTS=OFF -DWITH_NEL_SAMPLES=ON -DWITH_LUA51=ON -DWITH_RYZOM_SERVER=OFF -DWITH_RYZOM_TOOLS=OFF -DWITH_NEL_TOOLS=OFF"
|
||||||
|
- CMAKE_CONFIGURE_OPTIONS="-DCPPTEST_LIBRARY_DEBUG:STRING=/usr/lib/libcpptest.so"
|
||||||
|
CMAKE_BUILD_OPTIONS="--target nel_unit_test -- -j 2"
|
||||||
|
RUN="build/bin/nel_unit_test"
|
||||||
|
|
||||||
|
addons:
|
||||||
|
apt:
|
||||||
|
packages:
|
||||||
|
- liblua5.1-dev
|
||||||
|
- 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}"
|
@ -0,0 +1,34 @@
|
|||||||
|
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 libmysqlclient-dev -y
|
||||||
|
sudo apt-get install bison autoconf automake -y
|
||||||
|
sudo apt-get install libpng12-dev libjpeg62-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 libgif-dev libfreetype6-dev -y
|
||||||
|
sudo apt-get install libxml2-dev -y
|
||||||
|
sudo apt-get install libcurl4-openssl-dev -y
|
||||||
|
displayName: 'Dependencies'
|
||||||
|
- script: |
|
||||||
|
mkdir build
|
||||||
|
cmake --version
|
||||||
|
cd build
|
||||||
|
cmake -DWITH_NEL_TESTS=OFF -DWITH_NEL_SAMPLES=ON -DWITH_LUA51=ON -DWITH_RYZOM_SERVER=ON -DWITH_RYZOM_TOOLS=OFF -DWITH_NEL_TOOLS=OFF ../code
|
||||||
|
cat CMakeCache.txt
|
||||||
|
displayName: 'CMake'
|
||||||
|
- script: |
|
||||||
|
cd build
|
||||||
|
make -j`nproc`
|
||||||
|
displayName: 'Make'
|
@ -1,79 +1,57 @@
|
|||||||
MACRO(NL_CONFIGURE_CHECKS)
|
MACRO(NL_CONFIGURE_CHECKS)
|
||||||
INCLUDE(CheckIncludeFiles)
|
INCLUDE(GetRevision)
|
||||||
INCLUDE(CheckFunctionExists)
|
|
||||||
INCLUDE(CheckLibraryExists)
|
|
||||||
INCLUDE(CheckTypeSize)
|
|
||||||
|
|
||||||
CHECK_INCLUDE_FILES ("execinfo.h" HAVE_EXECINFO_H)
|
|
||||||
CHECK_INCLUDE_FILES ("stdint.h" HAVE_STDINT_H)
|
|
||||||
CHECK_INCLUDE_FILES ("sys/types.h" HAVE_SYS_TYPES_H)
|
|
||||||
CHECK_INCLUDE_FILES ("inttypes.h" HAVE_INTTYPES_H)
|
|
||||||
CHECK_INCLUDE_FILES ("unistd.h" HAVE_UNISTD_H)
|
|
||||||
CHECK_INCLUDE_FILES ("utime.h" HAVE_UTIME_H)
|
|
||||||
|
|
||||||
CHECK_INCLUDE_FILES ("dl.h" HAVE_DL_H)
|
|
||||||
CHECK_INCLUDE_FILES ("limits.h" HAVE_LIMITS_H)
|
|
||||||
CHECK_INCLUDE_FILES ("malloc.h" HAVE_MALLOC_H)
|
|
||||||
CHECK_INCLUDE_FILES ("sys/param.h" HAVE_SYS_PARAM_H)
|
|
||||||
CHECK_INCLUDE_FILES ("sys/param.h;sys/mount.h" HAVE_SYS_MOUNT_H)
|
|
||||||
CHECK_INCLUDE_FILES ("sys/statvfs.h" HAVE_SYS_STATVFS_H)
|
|
||||||
|
|
||||||
CHECK_INCLUDE_FILES ("pthread.h" HAVE_PTHREAD)
|
|
||||||
|
|
||||||
CHECK_TYPE_SIZE("size_t" SIZEOF_SIZE_T)
|
|
||||||
#if (NOT HAVE_SIZEOF_SIZE_T)
|
|
||||||
# MESSAGE(FATAL_ERROR "size_t is not present on this architecture - aborting")
|
|
||||||
#endif (NOT HAVE_SIZEOF_SIZE_T)
|
|
||||||
MESSAGE(STATUS "DEBUG size_t is ${SIZEOF_SIZE_T}")
|
|
||||||
|
|
||||||
CHECK_TYPE_SIZE("off_t" SIZEOF_OFF_T)
|
|
||||||
MESSAGE(STATUS "DEBUG off_t is ${SIZEOF_OFF_T}")
|
|
||||||
|
|
||||||
CHECK_FUNCTION_EXISTS("backtrace" HAVE_BACKTRACE)
|
|
||||||
CHECK_FUNCTION_EXISTS("getsockname" HAVE_GETSOCKNAME)
|
|
||||||
CHECK_FUNCTION_EXISTS("inet_ntoa" HAVE_INET_NTOA)
|
|
||||||
CHECK_FUNCTION_EXISTS("inet_ntop" HAVE_INET_NTOP)
|
|
||||||
CHECK_FUNCTION_EXISTS("inet_pton" HAVE_INET_PTON)
|
|
||||||
CHECK_FUNCTION_EXISTS("regcomp" HAVE_REGCOMP)
|
|
||||||
CHECK_FUNCTION_EXISTS("strerror" HAVE_STRERROR)
|
|
||||||
CHECK_FUNCTION_EXISTS("strlcat" HAVE_STRLCAT)
|
|
||||||
CHECK_FUNCTION_EXISTS("strptime" HAVE_STRPTIME)
|
|
||||||
CHECK_FUNCTION_EXISTS("strtok_r" HAVE_STRTOK_R)
|
|
||||||
CHECK_FUNCTION_EXISTS("strtoull" HAVE_STRTOULL)
|
|
||||||
CHECK_FUNCTION_EXISTS("statvfs" HAVE_STATVFS)
|
|
||||||
CHECK_FUNCTION_EXISTS("stat64" HAVE_STAT64)
|
|
||||||
|
|
||||||
# 3D drivers
|
# 3D drivers
|
||||||
IF(WITH_DRIVER_OPENGL)
|
IF(WITH_DRIVER_OPENGL)
|
||||||
SET(NL_OPENGL_AVAILABLE 1)
|
SET(NL_OPENGL_AVAILABLE 1)
|
||||||
ENDIF(WITH_DRIVER_OPENGL)
|
ENDIF()
|
||||||
|
|
||||||
IF(WITH_DRIVER_OPENGLES)
|
IF(WITH_DRIVER_OPENGLES)
|
||||||
SET(NL_OPENGLES_AVAILABLE 1)
|
SET(NL_OPENGLES_AVAILABLE 1)
|
||||||
ENDIF(WITH_DRIVER_OPENGLES)
|
ENDIF()
|
||||||
|
|
||||||
IF(WITH_DRIVER_DIRECT3D)
|
IF(WITH_DRIVER_DIRECT3D)
|
||||||
SET(NL_DIRECT3D_AVAILABLE 1)
|
SET(NL_DIRECT3D_AVAILABLE 1)
|
||||||
ENDIF(WITH_DRIVER_DIRECT3D)
|
ENDIF()
|
||||||
|
|
||||||
# sound drivers
|
# sound drivers
|
||||||
IF(WITH_DRIVER_FMOD)
|
IF(WITH_DRIVER_FMOD)
|
||||||
SET(NL_FMOD_AVAILABLE 1)
|
SET(NL_FMOD_AVAILABLE 1)
|
||||||
ENDIF(WITH_DRIVER_FMOD)
|
ENDIF()
|
||||||
|
|
||||||
IF(WITH_DRIVER_OPENAL)
|
IF(WITH_DRIVER_OPENAL)
|
||||||
SET(NL_OPENAL_AVAILABLE 1)
|
SET(NL_OPENAL_AVAILABLE 1)
|
||||||
ENDIF(WITH_DRIVER_OPENAL)
|
ENDIF()
|
||||||
|
|
||||||
IF(WITH_DRIVER_DSOUND)
|
IF(WITH_DRIVER_DSOUND)
|
||||||
SET(NL_DSOUND_AVAILABLE 1)
|
SET(NL_DSOUND_AVAILABLE 1)
|
||||||
ENDIF(WITH_DRIVER_DSOUND)
|
ENDIF()
|
||||||
|
|
||||||
IF(WITH_DRIVER_XAUDIO2)
|
IF(WITH_DRIVER_XAUDIO2)
|
||||||
SET(NL_XAUDIO2_AVAILABLE 1)
|
SET(NL_XAUDIO2_AVAILABLE 1)
|
||||||
ENDIF(WITH_DRIVER_XAUDIO2)
|
ENDIF()
|
||||||
|
|
||||||
|
IF(NOT RYZOM_VERSION_MAJOR)
|
||||||
|
SET(RYZOM_VERSION_MAJOR ${NL_VERSION_MAJOR})
|
||||||
|
SET(RYZOM_VERSION_MINOR ${NL_VERSION_MINOR})
|
||||||
|
SET(RYZOM_VERSION_PATCH ${NL_VERSION_PATCH})
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
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_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 "ryzom_client")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
|
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/config.h.cmake ${CMAKE_BINARY_DIR}/config.h)
|
||||||
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
|
INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR})
|
||||||
ADD_DEFINITIONS(-DHAVE_CONFIG_H)
|
ADD_DEFINITIONS(-DHAVE_CONFIG_H)
|
||||||
ENDMACRO(NL_CONFIGURE_CHECKS)
|
ENDMACRO()
|
||||||
|
@ -0,0 +1,173 @@
|
|||||||
|
# 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
|
||||||
|
# <component>_FOUND - System has <component>
|
||||||
|
# <component>_INCLUDE_DIRS - Include directory necessary for using the <component> headers
|
||||||
|
# <component>_LIBRARIES - Link these to use <component>
|
||||||
|
# <component>_DEFINITIONS - Compiler switches required for using <component>
|
||||||
|
# <component>_VERSION - The components version
|
||||||
|
#
|
||||||
|
# Copyright (c) 2006, Matthias Kretz, <kretz@kde.org>
|
||||||
|
# Copyright (c) 2008, Alexander Neundorf, <neundorf@kde.org>
|
||||||
|
# Copyright (c) 2011, Michael Jansen, <kde@michael-jansen.biz>
|
||||||
|
#
|
||||||
|
# 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})
|
@ -0,0 +1,959 @@
|
|||||||
|
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()
|
@ -1,190 +0,0 @@
|
|||||||
#
|
|
||||||
# Find the W3C libwww includes and library
|
|
||||||
#
|
|
||||||
# This module defines
|
|
||||||
# LIBWWW_INCLUDE_DIR, where to find tiff.h, etc.
|
|
||||||
# LIBWWW_LIBRARY, where to find the Libwww library.
|
|
||||||
# LIBWWW_FOUND, If false, do not try to use Libwww.
|
|
||||||
|
|
||||||
OPTION(WITH_LIBWWW_STATIC "Use only static libraries for libwww" OFF)
|
|
||||||
|
|
||||||
# also defined, but not for general use are
|
|
||||||
IF(LIBWWW_LIBRARIES AND LIBWWW_INCLUDE_DIR)
|
|
||||||
# in cache already
|
|
||||||
SET(Libwww_FIND_QUIETLY TRUE)
|
|
||||||
ENDIF(LIBWWW_LIBRARIES AND LIBWWW_INCLUDE_DIR)
|
|
||||||
|
|
||||||
FIND_PATH(LIBWWW_INCLUDE_DIR
|
|
||||||
WWWInit.h
|
|
||||||
PATHS
|
|
||||||
/usr/local/include
|
|
||||||
/usr/include
|
|
||||||
/sw/include
|
|
||||||
/opt/local/include
|
|
||||||
/opt/csw/include
|
|
||||||
/opt/include
|
|
||||||
PATH_SUFFIXES libwww w3c-libwww
|
|
||||||
)
|
|
||||||
|
|
||||||
# when installing libwww on mac os x using macports the file wwwconf.h resides
|
|
||||||
# in /opt/local/include and not in the real libwww include dir :/
|
|
||||||
FIND_PATH(LIBWWW_ADDITIONAL_INCLUDE_DIR
|
|
||||||
wwwconf.h
|
|
||||||
PATHS
|
|
||||||
/usr/local/include
|
|
||||||
/usr/include
|
|
||||||
/sw/include
|
|
||||||
/opt/local/include
|
|
||||||
/opt/csw/include
|
|
||||||
/opt/include
|
|
||||||
)
|
|
||||||
|
|
||||||
# combine both include directories into one variable
|
|
||||||
IF(LIBWWW_ADDITIONAL_INCLUDE_DIR)
|
|
||||||
SET(LIBWWW_INCLUDE_DIR ${LIBWWW_INCLUDE_DIR} ${LIBWWW_ADDITIONAL_INCLUDE_DIR})
|
|
||||||
ENDIF(LIBWWW_ADDITIONAL_INCLUDE_DIR)
|
|
||||||
|
|
||||||
# helper to find all the libwww sub libraries
|
|
||||||
MACRO(FIND_WWW_LIBRARY MYLIBRARY OPTION FILE)
|
|
||||||
IF(WITH_LIBWWW_STATIC AND UNIX AND NOT APPLE AND NOT WITH_STATIC_EXTERNAL)
|
|
||||||
SET(CMAKE_FIND_LIBRARY_SUFFIXES_OLD ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
|
||||||
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
|
|
||||||
ENDIF(WITH_LIBWWW_STATIC AND UNIX AND NOT APPLE AND NOT WITH_STATIC_EXTERNAL)
|
|
||||||
|
|
||||||
FIND_LIBRARY(${MYLIBRARY}_RELEASE
|
|
||||||
NAMES ${FILE}
|
|
||||||
PATHS
|
|
||||||
/usr/local/lib
|
|
||||||
/usr/lib
|
|
||||||
/usr/lib/x86_64-linux-gnu
|
|
||||||
/usr/local/X11R6/lib
|
|
||||||
/usr/X11R6/lib
|
|
||||||
/sw/lib
|
|
||||||
/opt/local/lib
|
|
||||||
/opt/csw/lib
|
|
||||||
/opt/lib
|
|
||||||
/usr/freeware/lib64
|
|
||||||
)
|
|
||||||
|
|
||||||
FIND_LIBRARY(${MYLIBRARY}_DEBUG
|
|
||||||
NAMES ${FILE}d
|
|
||||||
PATHS
|
|
||||||
/usr/local/lib
|
|
||||||
/usr/lib
|
|
||||||
/usr/lib/x86_64-linux-gnu
|
|
||||||
/usr/local/X11R6/lib
|
|
||||||
/usr/X11R6/lib
|
|
||||||
/sw/lib
|
|
||||||
/opt/local/lib
|
|
||||||
/opt/csw/lib
|
|
||||||
/opt/lib
|
|
||||||
/usr/freeware/lib64
|
|
||||||
)
|
|
||||||
|
|
||||||
IF(CMAKE_FIND_LIBRARY_SUFFIXES_OLD)
|
|
||||||
SET(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_OLD})
|
|
||||||
ENDIF(CMAKE_FIND_LIBRARY_SUFFIXES_OLD)
|
|
||||||
|
|
||||||
IF(${MYLIBRARY}_RELEASE AND ${MYLIBRARY}_DEBUG)
|
|
||||||
IF(${OPTION} STREQUAL REQUIRED OR WITH_STATIC OR WITH_LIBWWW_STATIC)
|
|
||||||
SET(LIBWWW_LIBRARIES ${LIBWWW_LIBRARIES} optimized ${${MYLIBRARY}_RELEASE} debug ${${MYLIBRARY}_DEBUG})
|
|
||||||
ENDIF(${OPTION} STREQUAL REQUIRED OR WITH_STATIC OR WITH_LIBWWW_STATIC)
|
|
||||||
ELSEIF(${MYLIBRARY}_RELEASE)
|
|
||||||
IF(${OPTION} STREQUAL REQUIRED OR WITH_STATIC OR WITH_LIBWWW_STATIC)
|
|
||||||
SET(LIBWWW_LIBRARIES ${LIBWWW_LIBRARIES} ${${MYLIBRARY}_RELEASE})
|
|
||||||
ENDIF(${OPTION} STREQUAL REQUIRED OR WITH_STATIC OR WITH_LIBWWW_STATIC)
|
|
||||||
ELSEIF(${MYLIBRARY}_DEBUG)
|
|
||||||
IF(${OPTION} STREQUAL REQUIRED OR WITH_STATIC OR WITH_LIBWWW_STATIC)
|
|
||||||
SET(LIBWWW_LIBRARIES ${LIBWWW_LIBRARIES} ${${MYLIBRARY}_DEBUG})
|
|
||||||
ENDIF(${OPTION} STREQUAL REQUIRED OR WITH_STATIC OR WITH_LIBWWW_STATIC)
|
|
||||||
ELSE(${MYLIBRARY}_RELEASE AND ${MYLIBRARY}_DEBUG)
|
|
||||||
IF(NOT Libwww_FIND_QUIETLY AND NOT WIN32)
|
|
||||||
MESSAGE(STATUS "Warning: Libwww: Library not found: ${MYLIBRARY}")
|
|
||||||
ENDIF(NOT Libwww_FIND_QUIETLY AND NOT WIN32)
|
|
||||||
ENDIF(${MYLIBRARY}_RELEASE AND ${MYLIBRARY}_DEBUG)
|
|
||||||
|
|
||||||
MARK_AS_ADVANCED(${MYLIBRARY}_RELEASE ${MYLIBRARY}_DEBUG)
|
|
||||||
ENDMACRO(FIND_WWW_LIBRARY)
|
|
||||||
|
|
||||||
MACRO(LINK_WWW_LIBRARY MYLIBRARY OTHERLIBRARY SYMBOL)
|
|
||||||
IF(NOT WITH_LIBWWW_STATIC AND NOT WITH_STATIC_EXTERNAL)
|
|
||||||
LINK_DEPENDS(LIBWWW_LIBRARIES ${MYLIBRARY} ${OTHERLIBRARY} ${SYMBOL})
|
|
||||||
ENDIF(NOT WITH_LIBWWW_STATIC AND NOT WITH_STATIC_EXTERNAL)
|
|
||||||
ENDMACRO(LINK_WWW_LIBRARY)
|
|
||||||
|
|
||||||
# Find and link required libs for static or dynamic
|
|
||||||
FIND_WWW_LIBRARY(LIBWWWAPP_LIBRARY REQUIRED wwwapp) # cache core file ftp gopher html http mime news stream telnet trans utils zip xml xmlparse
|
|
||||||
FIND_WWW_LIBRARY(LIBWWWCORE_LIBRARY REQUIRED wwwcore) # utils
|
|
||||||
FIND_WWW_LIBRARY(LIBWWWFILE_LIBRARY REQUIRED wwwfile) # core trans utils html
|
|
||||||
FIND_WWW_LIBRARY(LIBWWWHTML_LIBRARY REQUIRED wwwhtml) # core utils
|
|
||||||
FIND_WWW_LIBRARY(LIBWWWHTTP_LIBRARY REQUIRED wwwhttp) # md5 core mime stream utils
|
|
||||||
FIND_WWW_LIBRARY(LIBWWWMIME_LIBRARY REQUIRED wwwmime) # core cache stream utils
|
|
||||||
|
|
||||||
# Required for static or if underlinking
|
|
||||||
FIND_WWW_LIBRARY(LIBWWWCACHE_LIBRARY OPTIONAL wwwcache) # core trans utils
|
|
||||||
FIND_WWW_LIBRARY(LIBWWWSTREAM_LIBRARY OPTIONAL wwwstream) # core file utils
|
|
||||||
|
|
||||||
FIND_WWW_LIBRARY(LIBWWWTRANS_LIBRARY REQUIRED wwwtrans) # core utils
|
|
||||||
FIND_WWW_LIBRARY(LIBWWWUTILS_LIBRARY REQUIRED wwwutils)
|
|
||||||
|
|
||||||
|
|
||||||
# Required only if underlinking
|
|
||||||
|
|
||||||
# Unused protocols
|
|
||||||
FIND_WWW_LIBRARY(LIBWWWFTP_LIBRARY OPTIONAL wwwftp) # core file utils
|
|
||||||
FIND_WWW_LIBRARY(LIBWWWGOPHER_LIBRARY OPTIONAL wwwgopher) # core html utils file
|
|
||||||
FIND_WWW_LIBRARY(LIBWWWNEWS_LIBRARY OPTIONAL wwwnews) # core html mime stream utils
|
|
||||||
FIND_WWW_LIBRARY(LIBWWWTELNET_LIBRARY OPTIONAL wwwtelnet) # core utils
|
|
||||||
|
|
||||||
# Other used by app
|
|
||||||
FIND_WWW_LIBRARY(LIBWWWDIR_LIBRARY OPTIONAL wwwdir) # file
|
|
||||||
FIND_WWW_LIBRARY(LIBWWWINIT_LIBRARY OPTIONAL wwwinit) # app cache core file html utils
|
|
||||||
FIND_WWW_LIBRARY(LIBWWWMUX_LIBRARY OPTIONAL wwwmux) # core stream trans utils
|
|
||||||
FIND_WWW_LIBRARY(LIBWWWXML_LIBRARY OPTIONAL wwwxml) # core utils xmlparse
|
|
||||||
FIND_WWW_LIBRARY(LIBWWWZIP_LIBRARY OPTIONAL wwwzip) # core utils
|
|
||||||
FIND_WWW_LIBRARY(LIBXMLPARSE_LIBRARY OPTIONAL xmlparse) # xmltok
|
|
||||||
|
|
||||||
# Other used by other
|
|
||||||
FIND_WWW_LIBRARY(LIBXMLTOK_LIBRARY OPTIONAL xmltok)
|
|
||||||
FIND_WWW_LIBRARY(LIBWWWSSL_LIBRARY OPTIONAL wwwssl)
|
|
||||||
FIND_WWW_LIBRARY(LIBMD5_LIBRARY OPTIONAL md5)
|
|
||||||
FIND_WWW_LIBRARY(LIBPICS_LIBRARY OPTIONAL pics)
|
|
||||||
|
|
||||||
# Other external libraries
|
|
||||||
FIND_PACKAGE(EXPAT QUIET)
|
|
||||||
FIND_PACKAGE(OpenSSL QUIET)
|
|
||||||
FIND_WWW_LIBRARY(LIBREGEX_LIBRARY OPTIONAL gnu_regex)
|
|
||||||
|
|
||||||
# Now link all libs together
|
|
||||||
LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBWWWCACHE_LIBRARY HTLoadCache)
|
|
||||||
LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBWWWCACHE_LIBRARY HTCacheAppend)
|
|
||||||
LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBWWWFTP_LIBRARY HTLoadFTP)
|
|
||||||
LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBWWWGOPHER_LIBRARY HTLoadGopher)
|
|
||||||
LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBWWWNEWS_LIBRARY HTLoadNews)
|
|
||||||
LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBWWWTELNET_LIBRARY HTLoadTelnet)
|
|
||||||
|
|
||||||
LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBWWWSTREAM_LIBRARY HTStreamToChunk)
|
|
||||||
LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBWWWSTREAM_LIBRARY HTGuess_new)
|
|
||||||
LINK_WWW_LIBRARY(LIBWWWFILE_LIBRARY LIBWWWDIR_LIBRARY HTDir_new)
|
|
||||||
LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBWWWINIT_LIBRARY HTProtocolInit)
|
|
||||||
LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBWWWXML_LIBRARY HTXML_new)
|
|
||||||
LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBWWWZIP_LIBRARY HTZLib_inflate)
|
|
||||||
|
|
||||||
# libwwwxml can be linked to xmlparse or expat
|
|
||||||
LINK_WWW_LIBRARY(LIBWWWXML_LIBRARY LIBXMLPARSE_LIBRARY XML_ParserCreate)
|
|
||||||
|
|
||||||
IF(LIBXMLPARSE_LIBRARY_LINKED)
|
|
||||||
LINK_WWW_LIBRARY(LIBXMLPARSE_LIBRARY EXPAT_LIBRARY XmlInitEncoding)
|
|
||||||
ELSE(LIBXMLPARSE_LIBRARY_LINKED)
|
|
||||||
LINK_WWW_LIBRARY(LIBWWWXML_LIBRARY EXPAT_LIBRARY XML_ParserCreate)
|
|
||||||
ENDIF(LIBXMLPARSE_LIBRARY_LINKED)
|
|
||||||
|
|
||||||
LINK_WWW_LIBRARY(LIBWWWHTTP_LIBRARY LIBMD5_LIBRARY MD5Init)
|
|
||||||
LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBREGEX_LIBRARY regexec)
|
|
||||||
LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY OPENSSL_LIBRARIES SSL_new)
|
|
||||||
|
|
||||||
INCLUDE(FindPackageHandleStandardArgs)
|
|
||||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Libwww DEFAULT_MSG
|
|
||||||
LIBWWW_LIBRARIES
|
|
||||||
LIBWWW_INCLUDE_DIR
|
|
||||||
)
|
|
@ -0,0 +1,81 @@
|
|||||||
|
# Locate Lua library
|
||||||
|
# This module defines
|
||||||
|
# LUA53_FOUND, if false, do not try to link to Lua
|
||||||
|
# LUA_LIBRARIES
|
||||||
|
# LUA_INCLUDE_DIR, where to find lua.h
|
||||||
|
# LUA_VERSION_STRING, the version of Lua found (since CMake 2.8.8)
|
||||||
|
#
|
||||||
|
# Note that the expected include convention is
|
||||||
|
# #include "lua.h"
|
||||||
|
# and not
|
||||||
|
# #include <lua/lua.h>
|
||||||
|
# This is because, the lua location is not standardized and may exist
|
||||||
|
# in locations other than lua/
|
||||||
|
|
||||||
|
#=============================================================================
|
||||||
|
# Copyright 2007-2009 Kitware, Inc.
|
||||||
|
#
|
||||||
|
# Distributed under the OSI-approved BSD License (the "License");
|
||||||
|
# see accompanying file Copyright.txt for details.
|
||||||
|
#
|
||||||
|
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||||
|
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
# See the License for more information.
|
||||||
|
#=============================================================================
|
||||||
|
# (To distribute this file outside of CMake, substitute the full
|
||||||
|
# License text for the above reference.)
|
||||||
|
|
||||||
|
find_path(LUA_INCLUDE_DIR lua.h
|
||||||
|
HINTS
|
||||||
|
ENV LUA_DIR
|
||||||
|
PATH_SUFFIXES include/lua53 include/lua5.3 include/lua-5.3 include/lua include
|
||||||
|
PATHS
|
||||||
|
~/Library/Frameworks
|
||||||
|
/Library/Frameworks
|
||||||
|
/sw # Fink
|
||||||
|
/opt/local # DarwinPorts
|
||||||
|
/opt/csw # Blastwave
|
||||||
|
/opt
|
||||||
|
)
|
||||||
|
|
||||||
|
find_library(LUA_LIBRARY
|
||||||
|
NAMES lua53 lua5.3 lua-5.3 lua
|
||||||
|
HINTS
|
||||||
|
ENV LUA_DIR
|
||||||
|
PATH_SUFFIXES lib
|
||||||
|
PATHS
|
||||||
|
~/Library/Frameworks
|
||||||
|
/Library/Frameworks
|
||||||
|
/sw
|
||||||
|
/opt/local
|
||||||
|
/opt/csw
|
||||||
|
/opt
|
||||||
|
)
|
||||||
|
|
||||||
|
if(LUA_LIBRARY)
|
||||||
|
# include the math library for Unix
|
||||||
|
if(UNIX AND NOT APPLE AND NOT BEOS)
|
||||||
|
find_library(LUA_MATH_LIBRARY m)
|
||||||
|
set( LUA_LIBRARIES "${LUA_LIBRARY};${LUA_MATH_LIBRARY}" CACHE STRING "Lua Libraries")
|
||||||
|
# For Windows and Mac, don't need to explicitly include the math library
|
||||||
|
else()
|
||||||
|
set( LUA_LIBRARIES "${LUA_LIBRARY}" CACHE STRING "Lua Libraries")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(LUA_INCLUDE_DIR AND EXISTS "${LUA_INCLUDE_DIR}/lua.h")
|
||||||
|
file(STRINGS "${LUA_INCLUDE_DIR}/lua.h" lua_version_str REGEX "^#define[ \t]+LUA_RELEASE[ \t]+\"Lua .+\"")
|
||||||
|
|
||||||
|
string(REGEX REPLACE "^#define[ \t]+LUA_RELEASE[ \t]+\"Lua ([^\"]+)\".*" "\\1" LUA_VERSION_STRING "${lua_version_str}")
|
||||||
|
unset(lua_version_str)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
# handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if
|
||||||
|
# all listed variables are TRUE
|
||||||
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Lua53
|
||||||
|
REQUIRED_VARS LUA_LIBRARIES LUA_INCLUDE_DIR
|
||||||
|
VERSION_VAR LUA_VERSION_STRING)
|
||||||
|
|
||||||
|
mark_as_advanced(LUA_INCLUDE_DIR LUA_LIBRARIES LUA_LIBRARY LUA_MATH_LIBRARY)
|
||||||
|
|
@ -0,0 +1,398 @@
|
|||||||
|
# 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})
|
@ -0,0 +1,14 @@
|
|||||||
|
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()
|
@ -0,0 +1,74 @@
|
|||||||
|
# - 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()
|
@ -0,0 +1,63 @@
|
|||||||
|
IF(assimp_FIND_REQUIRED)
|
||||||
|
SET(ASSIMP_FIND_REQUIRED ON)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
FIND_PATH(
|
||||||
|
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
|
||||||
|
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()
|
||||||
|
FIND_PACKAGE(ZLIB)
|
||||||
|
IF(ZLIB_FOUND)
|
||||||
|
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()
|
||||||
|
|
||||||
|
IF (ASSIMP_FOUND)
|
||||||
|
IF (NOT ASSIMP_FIND_QUIETLY)
|
||||||
|
MESSAGE(STATUS "Found asset importer library: ${ASSIMP_LIBRARIES}")
|
||||||
|
ENDIF ()
|
||||||
|
ELSE (ASSIMP_FOUND)
|
||||||
|
IF (ASSIMP_FIND_REQUIRED)
|
||||||
|
MESSAGE(FATAL_ERROR "Could not find asset importer library")
|
||||||
|
ENDIF ()
|
||||||
|
ENDIF ()
|
@ -0,0 +1,131 @@
|
|||||||
|
# Define OSX_SDK to force a specific version such as : -DOSX_SDK=10.11
|
||||||
|
#
|
||||||
|
# Example:
|
||||||
|
# cmake ../code -DCMAKE_TOOLCHAIN_FILE=../code/CMakeModules/OSXToolChain.cmake -DWITH_NEL_TESTS=OFF -DWITH_RYZOM_SERVER=OFF -DWITH_NEL_TOOLS=OFF -DWITH_RYZOM_TOOLS=OFF -DWITH_LUA51=OFF -DWITH_LUA53=ON -DCMAKE_BUILD_TYPE=Release -DWITH_RYZOM_INSTALLER=OFF -DWITH_RYZOM_PATCH=ON -DWITH_NEL_TESTS=OFF -DWITH_NEL_TOOLS=OFF -DWITH_TOOLS=OFF -DWITH_NEL_SAMPLES=OFF -DWITH_WARNINGS=OFF -DWITH_QT5=OFF -DWITH_STATIC=ON -DWITH_STATIC_DRIVERS=ON -DWITH_STATIC_EXTERNAL=ON -DWITH_UNIX_STRUCTURE=OFF -DWITH_INSTALL_LIBRARIES=OFF -DWITH_RYZOM_SANDBOX=OFF -DOSX_SDK=10.11
|
||||||
|
|
||||||
|
# Don't forget to define environment variables:
|
||||||
|
#
|
||||||
|
# export MACOSX_DEPLOYMENT_TARGET=10.7
|
||||||
|
# export OSXCROSS_GCC_NO_STATIC_RUNTIME=1
|
||||||
|
# export PATH=$PATH:/home/src/osxcross/target/bin
|
||||||
|
#
|
||||||
|
# ln -s /usr/bin/hg /home/src/osxcross/target/bin/hg
|
||||||
|
#
|
||||||
|
# To install all dependencies:
|
||||||
|
# ./osxcross-macports install libxml2 jpeg curl libogg libvorbis freetype boost openssl zlib lua-5.3 giflib
|
||||||
|
|
||||||
|
# to compile Luabind
|
||||||
|
# export CMAKE_MODULE_PATH=$HOME/shard/tools/external/cmake/modules
|
||||||
|
# cmake .. -DCMAKE_TOOLCHAIN_FILE=$HOME/ryzomcore/code/CMakeModules/OSXToolChain.cmake -DWITH_SHARED=OFF -DWITH_STATIC=ON -DWITH_LUA51=OFF -DWITH_LUA53=ON -DCMAKE_INSTALL_PREFIX=$HOME/osxcross/target/external
|
||||||
|
|
||||||
|
IF(DEFINED CMAKE_CROSSCOMPILING)
|
||||||
|
# subsequent toolchain loading is not really needed
|
||||||
|
RETURN()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
# Force the compilers to Clang for OS X
|
||||||
|
|
||||||
|
# C
|
||||||
|
SET(CMAKE_C_COMPILER x86_64-apple-darwin15-clang)
|
||||||
|
SET(CMAKE_C_STANDARD_COMPUTED_DEFAULT "11")
|
||||||
|
SET(CMAKE_C_COMPILE_FEATURES "c_std_90;c_function_prototypes;c_std_99;c_restrict;c_variadic_macros;c_std_11;c_static_assert")
|
||||||
|
SET(CMAKE_C90_COMPILE_FEATURES "c_std_90;c_function_prototypes")
|
||||||
|
SET(CMAKE_C99_COMPILE_FEATURES "c_std_99;c_restrict;c_variadic_macros")
|
||||||
|
SET(CMAKE_C11_COMPILE_FEATURES "c_std_11;c_static_assert")
|
||||||
|
|
||||||
|
# C++
|
||||||
|
SET(CMAKE_CXX_COMPILER x86_64-apple-darwin15-clang++)
|
||||||
|
SET(CMAKE_CXX_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters;cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates;cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates;cxx_std_17")
|
||||||
|
SET(CMAKE_CXX98_COMPILE_FEATURES "cxx_std_98;cxx_template_template_parameters")
|
||||||
|
SET(CMAKE_CXX11_COMPILE_FEATURES "cxx_std_11;cxx_alias_templates;cxx_alignas;cxx_alignof;cxx_attributes;cxx_auto_type;cxx_constexpr;cxx_decltype;cxx_decltype_incomplete_return_types;cxx_default_function_template_args;cxx_defaulted_functions;cxx_defaulted_move_initializers;cxx_delegating_constructors;cxx_deleted_functions;cxx_enum_forward_declarations;cxx_explicit_conversions;cxx_extended_friend_declarations;cxx_extern_templates;cxx_final;cxx_func_identifier;cxx_generalized_initializers;cxx_inheriting_constructors;cxx_inline_namespaces;cxx_lambdas;cxx_local_type_template_args;cxx_long_long_type;cxx_noexcept;cxx_nonstatic_member_init;cxx_nullptr;cxx_override;cxx_range_for;cxx_raw_string_literals;cxx_reference_qualified_functions;cxx_right_angle_brackets;cxx_rvalue_references;cxx_sizeof_member;cxx_static_assert;cxx_strong_enums;cxx_thread_local;cxx_trailing_return_types;cxx_unicode_literals;cxx_uniform_initialization;cxx_unrestricted_unions;cxx_user_literals;cxx_variadic_macros;cxx_variadic_templates")
|
||||||
|
SET(CMAKE_CXX14_COMPILE_FEATURES "cxx_std_14;cxx_aggregate_default_initializers;cxx_attribute_deprecated;cxx_binary_literals;cxx_contextual_conversions;cxx_decltype_auto;cxx_digit_separators;cxx_generic_lambdas;cxx_lambda_init_captures;cxx_relaxed_constexpr;cxx_return_type_deduction;cxx_variable_templates")
|
||||||
|
SET(CMAKE_CXX17_COMPILE_FEATURES "cxx_std_17")
|
||||||
|
|
||||||
|
# make
|
||||||
|
SET(CMAKE_MAKE_PROGRAM make)
|
||||||
|
|
||||||
|
# Skip the platform compiler checks for cross compiling.
|
||||||
|
SET(CMAKE_CXX_COMPILER_FORCED TRUE)
|
||||||
|
SET(CMAKE_C_COMPILER_FORCED TRUE)
|
||||||
|
|
||||||
|
# Check if osxcross is installed
|
||||||
|
EXECUTE_PROCESS(COMMAND which ${CMAKE_CXX_COMPILER} OUTPUT_VARIABLE COMPILER_FULLPATH OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
|
||||||
|
IF(NOT COMPILER_FULLPATH)
|
||||||
|
MESSAGE(FATAL_ERROR "Unable to find ${CMAKE_CXX_COMPILER}, are you sure osxcross is installed and is in PATH?")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
# Default paths
|
||||||
|
GET_FILENAME_COMPONENT(CMAKE_OSX_TOOLCHAIN_ROOT ${COMPILER_FULLPATH} DIRECTORY)
|
||||||
|
|
||||||
|
# Parent directory
|
||||||
|
GET_FILENAME_COMPONENT(CMAKE_OSX_TOOLCHAIN_ROOT ${CMAKE_OSX_TOOLCHAIN_ROOT} DIRECTORY)
|
||||||
|
|
||||||
|
SET(CMAKE_OSX_SYSROOT ${CMAKE_OSX_TOOLCHAIN_ROOT}/SDK)
|
||||||
|
SET(MACPORTS_ROOT_DIR ${CMAKE_OSX_TOOLCHAIN_ROOT}/macports/pkgs/opt/local)
|
||||||
|
SET(EXTERNAL_OSX_PATH ${CMAKE_OSX_TOOLCHAIN_ROOT}/external)
|
||||||
|
|
||||||
|
# List of all SDKs that have been found
|
||||||
|
SET(OSX_SDKS)
|
||||||
|
|
||||||
|
FILE(GLOB _CMAKE_OSX_SDKS "${CMAKE_OSX_SYSROOT}/MacOSX*")
|
||||||
|
IF(_CMAKE_OSX_SDKS)
|
||||||
|
LIST(SORT _CMAKE_OSX_SDKS)
|
||||||
|
LIST(REVERSE _CMAKE_OSX_SDKS)
|
||||||
|
FOREACH(_CMAKE_OSX_SDK ${_CMAKE_OSX_SDKS})
|
||||||
|
STRING(REGEX REPLACE ".+MacOSX([0-9.]+)\\.sdk" "\\1" _OSX_SDK "${_CMAKE_OSX_SDK}")
|
||||||
|
LIST(APPEND OSX_SDKS ${_OSX_SDK})
|
||||||
|
ENDFOREACH()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
# Find and use the most recent OS X sdk
|
||||||
|
IF(NOT OSX_SDKS)
|
||||||
|
MESSAGE(FATAL_ERROR "No OS X SDK's found in default search path ${CMAKE_OSX_SYSROOT}.")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
# if a specific SDK is defined, try to use it
|
||||||
|
IF(OSX_SDK)
|
||||||
|
LIST(FIND OSX_SDKS "${OSX_SDK}" _INDEX)
|
||||||
|
IF(_INDEX EQUAL -1)
|
||||||
|
# if specified SDK doesn't exist, use the last one
|
||||||
|
LIST(GET OSX_SDKS 0 OSX_SDK)
|
||||||
|
ENDIF()
|
||||||
|
ELSE()
|
||||||
|
# use the last SDK
|
||||||
|
LIST(GET OSX_SDKS 0 OSX_SDK)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
MESSAGE(STATUS "Using OS X SDK ${OSX_SDK}")
|
||||||
|
|
||||||
|
# Define final OS X sysroot
|
||||||
|
SET(CMAKE_OSX_SYSROOT ${CMAKE_OSX_SYSROOT}/MacOSX${OSX_SDK}.sdk)
|
||||||
|
|
||||||
|
# Standard settings
|
||||||
|
SET(CMAKE_SYSTEM_NAME Darwin)
|
||||||
|
SET(CMAKE_SYSTEM "Darwin-15.0.0")
|
||||||
|
SET(CMAKE_SYSTEM_VERSION "15.0.0")
|
||||||
|
SET(CMAKE_SYSTEM_PROCESSOR "x86_64")
|
||||||
|
|
||||||
|
SET(UNIX ON)
|
||||||
|
SET(APPLE ON)
|
||||||
|
|
||||||
|
# Set the find root to the OS X developer roots and to user defined paths
|
||||||
|
SET(CMAKE_FIND_ROOT_PATH ${CMAKE_OSX_TOOLCHAIN_ROOT} ${CMAKE_OSX_SYSROOT} ${CMAKE_PREFIX_PATH} ${CMAKE_INSTALL_PREFIX} ${MACPORTS_ROOT_DIR} ${EXTERNAL_OSX_PATH} $ENV{EXTERNAL_OSX_PATH} CACHE STRING "OS X find search path root")
|
||||||
|
|
||||||
|
# default to searching for frameworks first
|
||||||
|
SET(CMAKE_FIND_FRAMEWORK FIRST)
|
||||||
|
|
||||||
|
# set up the default search directories for frameworks
|
||||||
|
SET(CMAKE_SYSTEM_FRAMEWORK_PATH
|
||||||
|
${CMAKE_OSX_SYSROOT}/System/Library/Frameworks
|
||||||
|
${CMAKE_OSX_SYSROOT}/System/Library/PrivateFrameworks
|
||||||
|
${CMAKE_OSX_SYSROOT}/Developer/Library/Frameworks
|
||||||
|
)
|
||||||
|
|
||||||
|
# only search the OS X sdks, not the remainder of the host filesystem
|
||||||
|
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY)
|
||||||
|
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||||
|
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
||||||
|
|
||||||
|
# determinate location for bin utils based on CMAKE_FIND_ROOT_PATH
|
||||||
|
INCLUDE(CMakeFindBinUtils)
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,84 @@
|
|||||||
|
/**
|
||||||
|
* \file fxaa.h
|
||||||
|
* \brief CFXAA
|
||||||
|
* \date 2014-08-03 21:41GMT
|
||||||
|
* \author Jan Boon (Kaetemi)
|
||||||
|
* CFXAA
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2014 by authors
|
||||||
|
*
|
||||||
|
* This file is part of NL3D.
|
||||||
|
* NL3D 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.
|
||||||
|
*
|
||||||
|
* NL3D 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 NL3D. If not, see
|
||||||
|
* <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef NL3D_FXAA_H
|
||||||
|
#define NL3D_FXAA_H
|
||||||
|
#include <nel/misc/types_nl.h>
|
||||||
|
|
||||||
|
// STL includes
|
||||||
|
|
||||||
|
// NeL includes
|
||||||
|
#include <nel/misc/smart_ptr.h>
|
||||||
|
#include <nel/misc/geom_ext.h>
|
||||||
|
|
||||||
|
// Project includes
|
||||||
|
#include <nel/3d/u_material.h>
|
||||||
|
#include <nel/3d/vertex_buffer.h>
|
||||||
|
|
||||||
|
#define NL_STEREO_MAX_USER_CAMERAS 8
|
||||||
|
|
||||||
|
namespace NL3D {
|
||||||
|
|
||||||
|
class ITexture;
|
||||||
|
class CTextureUser;
|
||||||
|
class CPixelProgram;
|
||||||
|
class CVertexProgram;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \brief CFXAA
|
||||||
|
* \date 2014-08-03 21:41GMT
|
||||||
|
* \author Jan Boon (Kaetemi)
|
||||||
|
* CFXAA
|
||||||
|
*/
|
||||||
|
class CFXAA
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
CFXAA(NL3D::UDriver *driver);
|
||||||
|
virtual ~CFXAA();
|
||||||
|
|
||||||
|
/// Apply effect to current render target. Render target must be managed by render target manager
|
||||||
|
virtual void applyEffect();
|
||||||
|
|
||||||
|
private:
|
||||||
|
UDriver *m_Driver;
|
||||||
|
|
||||||
|
NL3D::UMaterial m_Mat;
|
||||||
|
// NL3D::CVertexBuffer m_VB;
|
||||||
|
NLMISC::CQuadUV m_QuadUV;
|
||||||
|
CVertexProgram *m_VP;
|
||||||
|
CPixelProgram *m_PP;
|
||||||
|
|
||||||
|
uint m_Width;
|
||||||
|
uint m_Height;
|
||||||
|
|
||||||
|
}; /* class CFXAA */
|
||||||
|
|
||||||
|
} /* namespace NL3D */
|
||||||
|
|
||||||
|
#endif /* #ifndef NL3D_FXAA_H */
|
||||||
|
|
||||||
|
/* end of file */
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue