Merge branch 'develop' into feature/streamed-package
commit
8e4edcb954
@ -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_*
|
||||||
|
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,42 @@
|
|||||||
|
jobs:
|
||||||
|
- job: ubuntu16
|
||||||
|
timeoutInMinutes: 120
|
||||||
|
pool:
|
||||||
|
vmImage: 'Ubuntu-16.04'
|
||||||
|
steps:
|
||||||
|
- script: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y software-properties-common
|
||||||
|
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install cmake build-essential -y
|
||||||
|
sudo apt-get install gcc-8 g++-8 -y
|
||||||
|
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 60
|
||||||
|
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 60
|
||||||
|
sudo apt-get install bison autoconf automake -y
|
||||||
|
sudo apt-get install libpng12-dev -y
|
||||||
|
sudo apt-get install libjpeg-dev -y
|
||||||
|
sudo apt-get install libgif-dev libfreetype6-dev -y
|
||||||
|
sudo apt-get install freeglut3-dev -y
|
||||||
|
sudo apt-get install liblua5.1-dev libluabind-dev libcpptest-dev -y
|
||||||
|
sudo apt-get install libogg-dev libvorbis-dev libopenal-dev -y
|
||||||
|
sudo apt-get install libavcodec-dev libavformat-dev libavdevice-dev libswscale-dev libpostproc-dev -y
|
||||||
|
sudo apt-get install libmysqlclient-dev -y
|
||||||
|
sudo apt-get install libxml2-dev -y
|
||||||
|
sudo apt-get install libcurl4-openssl-dev libssl-dev -y
|
||||||
|
sudo apt-get install libsquish-dev -y
|
||||||
|
sudo apt-get install liblzma-dev -y
|
||||||
|
sudo apt-get install libgsf-1-dev -y
|
||||||
|
sudo apt-get install qtbase5-dev qttools5-dev qttools5-dev-tools
|
||||||
|
displayName: 'Dependencies'
|
||||||
|
- script: |
|
||||||
|
mkdir build
|
||||||
|
cmake --version
|
||||||
|
cd build
|
||||||
|
cmake -DWITH_STATIC=ON -DWITH_NEL_TESTS=OFF -DWITH_NEL_SAMPLES=ON -DWITH_LUA51=ON -DWITH_RYZOM=ON -DWITH_RYZOM_SERVER=ON -DWITH_RYZOM_CLIENT=ON -DWITH_RYZOM_TOOLS=ON -DWITH_NEL_TOOLS=ON -DWITH_NELNS=ON -DWITH_NELNS_LOGIN_SYSTEM=ON -DWITH_NELNS_SERVER=ON -DWITH_QT5=ON -DWITH_LIBGSF=ON ../code
|
||||||
|
cat CMakeCache.txt
|
||||||
|
displayName: 'CMake'
|
||||||
|
- script: |
|
||||||
|
cd build
|
||||||
|
make -j`nproc`
|
||||||
|
displayName: 'Make'
|
@ -0,0 +1,24 @@
|
|||||||
|
---
|
||||||
|
BasedOnStyle: WebKit
|
||||||
|
AllowShortFunctionsOnASingleLine: All
|
||||||
|
BraceWrapping:
|
||||||
|
AfterClass: true
|
||||||
|
AfterControlStatement: true
|
||||||
|
AfterEnum: true
|
||||||
|
AfterFunction: true
|
||||||
|
AfterNamespace: true
|
||||||
|
AfterObjCDeclaration: true
|
||||||
|
AfterStruct: true
|
||||||
|
AfterUnion: true
|
||||||
|
BeforeCatch: true
|
||||||
|
BeforeElse: true
|
||||||
|
IndentBraces: false
|
||||||
|
BreakBeforeBraces: Custom
|
||||||
|
BreakConstructorInitializersBeforeComma: 'false'
|
||||||
|
NamespaceIndentation: None
|
||||||
|
PointerAlignment: Right
|
||||||
|
SortIncludes: 'false'
|
||||||
|
TabWidth: '4'
|
||||||
|
UseTab: ForIndentation
|
||||||
|
|
||||||
|
...
|
@ -0,0 +1,23 @@
|
|||||||
|
; Top-most EditorConfig file
|
||||||
|
root = true
|
||||||
|
|
||||||
|
; 4-column tab indentation
|
||||||
|
[*.cpp]
|
||||||
|
indent_style = tab
|
||||||
|
indent_size = 4
|
||||||
|
|
||||||
|
[*.c]
|
||||||
|
indent_style = tab
|
||||||
|
indent_size = 4
|
||||||
|
|
||||||
|
[*.h]
|
||||||
|
indent_style = tab
|
||||||
|
indent_size = 4
|
||||||
|
|
||||||
|
[*.py]
|
||||||
|
indent_style = tab
|
||||||
|
indent_size = 4
|
||||||
|
|
||||||
|
[*.config]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 2
|
@ -1,79 +1,67 @@
|
|||||||
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()
|
||||||
|
|
||||||
|
IF(DESCRIBE)
|
||||||
|
SET(NL_VERSION "${DESCRIBE}")
|
||||||
|
ELSE()
|
||||||
|
SET(NL_VERSION "${NL_VERSION_MAJOR}.${NL_VERSION_MINOR}.${NL_VERSION_PATCH}.${REVISION}")
|
||||||
|
ENDIF()
|
||||||
|
SET(NL_VERSION_RC "${NL_VERSION_MAJOR},${NL_VERSION_MINOR},${NL_VERSION_PATCH},${REVISION}")
|
||||||
|
SET(NL_PRODUCT_VERSION "${NL_VERSION_MAJOR}.${NL_VERSION_MINOR}.${NL_VERSION_PATCH}")
|
||||||
|
|
||||||
|
SET(RYZOM_VERSION_SHORT "${RYZOM_VERSION_MAJOR}.${RYZOM_VERSION_MINOR}.${RYZOM_VERSION_PATCH}")
|
||||||
|
IF(DESCRIBE)
|
||||||
|
SET(RYZOM_VERSION "${DESCRIBE}")
|
||||||
|
ELSE()
|
||||||
|
SET(RYZOM_VERSION "${RYZOM_VERSION_SHORT}.${REVISION}")
|
||||||
|
ENDIF()
|
||||||
|
SET(RYZOM_VERSION_RC "${RYZOM_VERSION_MAJOR},${RYZOM_VERSION_MINOR},${RYZOM_VERSION_PATCH},${REVISION}")
|
||||||
|
SET(RYZOM_PRODUCT_VERSION "${RYZOM_VERSION_MAJOR}.${RYZOM_VERSION_MINOR}.${RYZOM_VERSION_PATCH}")
|
||||||
|
NOW(BUILD_DATE)
|
||||||
|
|
||||||
|
SET(COPYRIGHT "Copyright (C) ${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})
|
@ -1,57 +1,9 @@
|
|||||||
# - Locate FMOD library
|
INCLUDE(FindHelpers)
|
||||||
# This module defines
|
|
||||||
# FMOD_LIBRARY, the library to link against
|
|
||||||
# FMOD_FOUND, if false, do not try to link to FMOD
|
|
||||||
# FMOD_INCLUDE_DIR, where to find headers.
|
|
||||||
|
|
||||||
IF(FMOD_LIBRARY AND FMOD_INCLUDE_DIR)
|
|
||||||
# in cache already
|
|
||||||
SET(FMOD_FIND_QUIETLY TRUE)
|
|
||||||
ENDIF(FMOD_LIBRARY AND FMOD_INCLUDE_DIR)
|
|
||||||
|
|
||||||
|
|
||||||
FIND_PATH(FMOD_INCLUDE_DIR
|
|
||||||
fmod.h
|
|
||||||
PATHS
|
|
||||||
$ENV{FMOD_DIR}/include
|
|
||||||
/usr/local/include
|
|
||||||
/usr/include
|
|
||||||
/sw/include
|
|
||||||
/opt/local/include
|
|
||||||
/opt/csw/include
|
|
||||||
/opt/include
|
|
||||||
PATH_SUFFIXES fmod fmod3
|
|
||||||
)
|
|
||||||
|
|
||||||
IF(TARGET_X64)
|
IF(TARGET_X64)
|
||||||
SET(FMOD_LIBRARY_NAMES fmod64 fmod)
|
SET(FMOD_BASE fmod64)
|
||||||
ELSE(TARGET_X64)
|
ELSE()
|
||||||
SET(FMOD_LIBRARY_NAMES fmodvc fmod)
|
SET(FMOD_BASE fmodvc)
|
||||||
ENDIF(TARGET_X64)
|
ENDIF()
|
||||||
|
|
||||||
FIND_LIBRARY(FMOD_LIBRARY
|
|
||||||
NAMES
|
|
||||||
${FMOD_LIBRARY_NAMES}
|
|
||||||
PATHS
|
|
||||||
$ENV{FMOD_DIR}/lib
|
|
||||||
/usr/local/lib
|
|
||||||
/usr/lib
|
|
||||||
/usr/local/X11R6/lib
|
|
||||||
/usr/X11R6/lib
|
|
||||||
/sw/lib
|
|
||||||
/opt/local/lib
|
|
||||||
/opt/csw/lib
|
|
||||||
/opt/lib
|
|
||||||
/usr/freeware/lib64
|
|
||||||
)
|
|
||||||
|
|
||||||
IF(FMOD_LIBRARY AND FMOD_INCLUDE_DIR)
|
FIND_PACKAGE_HELPER(FMOD fmod.h RELEASE ${FMOD_BASE} DEBUG ${FMOD_BASE}d SUFFIXES fmod3)
|
||||||
SET(FMOD_FOUND "YES")
|
|
||||||
IF(NOT FMOD_FIND_QUIETLY)
|
|
||||||
MESSAGE(STATUS "Found FMOD: ${FMOD_LIBRARY}")
|
|
||||||
ENDIF(NOT FMOD_FIND_QUIETLY)
|
|
||||||
ELSE(FMOD_LIBRARY AND FMOD_INCLUDE_DIR)
|
|
||||||
IF(NOT FMOD_FIND_QUIETLY)
|
|
||||||
MESSAGE(STATUS "Warning: Unable to find FMOD!")
|
|
||||||
ENDIF(NOT FMOD_FIND_QUIETLY)
|
|
||||||
ENDIF(FMOD_LIBRARY AND FMOD_INCLUDE_DIR)
|
|
||||||
|
@ -0,0 +1,217 @@
|
|||||||
|
# - Try to find GLib2
|
||||||
|
# Once done this will define
|
||||||
|
#
|
||||||
|
# GLIB2_FOUND - system has GLib2
|
||||||
|
# GLIB2_INCLUDE_DIRS - the GLib2 include directory
|
||||||
|
# GLIB2_LIBRARIES - Link these to use GLib2
|
||||||
|
#
|
||||||
|
# HAVE_GLIB_GREGEX_H glib has gregex.h header and
|
||||||
|
# supports g_regex_match_simple
|
||||||
|
#
|
||||||
|
# Copyright (c) 2006 Andreas Schneider <mail@cynapses.org>
|
||||||
|
# Copyright (c) 2006 Philippe Bernery <philippe.bernery@gmail.com>
|
||||||
|
# Copyright (c) 2007 Daniel Gollub <dgollub@suse.de>
|
||||||
|
# Copyright (c) 2007 Alban Browaeys <prahal@yahoo.com>
|
||||||
|
# Copyright (c) 2008 Michael Bell <michael.bell@web.de>
|
||||||
|
# Copyright (c) 2008 Bjoern Ricks <bjoern.ricks@googlemail.com>
|
||||||
|
#
|
||||||
|
# Redistribution and use is allowed according to the terms of the New
|
||||||
|
# BSD license.
|
||||||
|
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
|
IF (GLIB2_LIBRARIES AND GLIB2_INCLUDE_DIRS )
|
||||||
|
# in cache already
|
||||||
|
SET(GLIB2_FOUND TRUE)
|
||||||
|
ELSE (GLIB2_LIBRARIES AND GLIB2_INCLUDE_DIRS )
|
||||||
|
|
||||||
|
INCLUDE(FindPkgConfig)
|
||||||
|
|
||||||
|
## Glib
|
||||||
|
IF ( GLIB2_FIND_REQUIRED )
|
||||||
|
SET( _pkgconfig_REQUIRED "REQUIRED" )
|
||||||
|
ELSE ( GLIB2_FIND_REQUIRED )
|
||||||
|
SET( _pkgconfig_REQUIRED "" )
|
||||||
|
ENDIF ( GLIB2_FIND_REQUIRED )
|
||||||
|
|
||||||
|
IF ( GLIB2_MIN_VERSION )
|
||||||
|
PKG_SEARCH_MODULE( GLIB2 ${_pkgconfig_REQUIRED} glib-2.0>=${GLIB2_MIN_VERSION} )
|
||||||
|
ELSE ( GLIB2_MIN_VERSION )
|
||||||
|
PKG_SEARCH_MODULE( GLIB2 ${_pkgconfig_REQUIRED} glib-2.0 )
|
||||||
|
ENDIF ( GLIB2_MIN_VERSION )
|
||||||
|
IF ( PKG_CONFIG_FOUND )
|
||||||
|
IF ( GLIB2_FOUND )
|
||||||
|
SET ( GLIB2_CORE_FOUND TRUE )
|
||||||
|
ELSE ( GLIB2_FOUND )
|
||||||
|
SET ( GLIB2_CORE_FOUND FALSE )
|
||||||
|
ENDIF ( GLIB2_FOUND )
|
||||||
|
ENDIF ( PKG_CONFIG_FOUND )
|
||||||
|
|
||||||
|
# Look for glib2 include dir and libraries w/o pkgconfig
|
||||||
|
IF ( NOT GLIB2_FOUND AND NOT PKG_CONFIG_FOUND )
|
||||||
|
FIND_PATH(
|
||||||
|
_glibconfig_include_DIR
|
||||||
|
NAMES
|
||||||
|
glibconfig.h
|
||||||
|
PATHS
|
||||||
|
/opt/gnome/lib64
|
||||||
|
/opt/gnome/lib
|
||||||
|
/opt/lib/
|
||||||
|
/opt/local/lib
|
||||||
|
/sw/lib/
|
||||||
|
/usr/lib64
|
||||||
|
/usr/lib
|
||||||
|
/usr/local/include
|
||||||
|
${CMAKE_LIBRARY_PATH}
|
||||||
|
PATH_SUFFIXES
|
||||||
|
glib-2.0/include
|
||||||
|
)
|
||||||
|
|
||||||
|
FIND_PATH(
|
||||||
|
_glib2_include_DIR
|
||||||
|
NAMES
|
||||||
|
glib.h
|
||||||
|
PATHS
|
||||||
|
/opt/gnome/include
|
||||||
|
/opt/local/include
|
||||||
|
/sw/include
|
||||||
|
/usr/include
|
||||||
|
/usr/local/include
|
||||||
|
PATH_SUFFIXES
|
||||||
|
glib-2.0
|
||||||
|
)
|
||||||
|
|
||||||
|
#MESSAGE(STATUS "Glib headers: ${_glib2_include_DIR}")
|
||||||
|
|
||||||
|
FIND_LIBRARY(
|
||||||
|
_glib2_link_DIR
|
||||||
|
NAMES
|
||||||
|
glib-2.0
|
||||||
|
glib
|
||||||
|
PATHS
|
||||||
|
/opt/gnome/lib
|
||||||
|
/opt/local/lib
|
||||||
|
/sw/lib
|
||||||
|
/usr/lib
|
||||||
|
/usr/local/lib
|
||||||
|
)
|
||||||
|
IF ( _glib2_include_DIR AND _glib2_link_DIR )
|
||||||
|
SET ( _glib2_FOUND TRUE )
|
||||||
|
ENDIF ( _glib2_include_DIR AND _glib2_link_DIR )
|
||||||
|
|
||||||
|
|
||||||
|
IF ( _glib2_FOUND )
|
||||||
|
SET ( GLIB2_INCLUDE_DIRS ${_glib2_include_DIR} ${_glibconfig_include_DIR} )
|
||||||
|
SET ( GLIB2_LIBRARIES ${_glib2_link_DIR} )
|
||||||
|
SET ( GLIB2_CORE_FOUND TRUE )
|
||||||
|
ELSE ( _glib2_FOUND )
|
||||||
|
SET ( GLIB2_CORE_FOUND FALSE )
|
||||||
|
ENDIF ( _glib2_FOUND )
|
||||||
|
|
||||||
|
# Handle dependencies
|
||||||
|
# libintl
|
||||||
|
IF ( NOT LIBINTL_FOUND )
|
||||||
|
FIND_PATH(LIBINTL_INCLUDE_DIR
|
||||||
|
NAMES
|
||||||
|
libintl.h
|
||||||
|
PATHS
|
||||||
|
/opt/gnome/include
|
||||||
|
/opt/local/include
|
||||||
|
/sw/include
|
||||||
|
/usr/include
|
||||||
|
/usr/local/include
|
||||||
|
)
|
||||||
|
|
||||||
|
FIND_LIBRARY(LIBINTL_LIBRARY
|
||||||
|
NAMES
|
||||||
|
intl
|
||||||
|
PATHS
|
||||||
|
/opt/gnome/lib
|
||||||
|
/opt/local/lib
|
||||||
|
/sw/lib
|
||||||
|
/usr/local/lib
|
||||||
|
/usr/lib
|
||||||
|
)
|
||||||
|
|
||||||
|
IF (LIBINTL_LIBRARY AND LIBINTL_INCLUDE_DIR)
|
||||||
|
SET (LIBINTL_FOUND TRUE)
|
||||||
|
ENDIF (LIBINTL_LIBRARY AND LIBINTL_INCLUDE_DIR)
|
||||||
|
ENDIF ( NOT LIBINTL_FOUND )
|
||||||
|
|
||||||
|
# libiconv
|
||||||
|
IF ( NOT LIBICONV_FOUND )
|
||||||
|
FIND_PATH(LIBICONV_INCLUDE_DIR
|
||||||
|
NAMES
|
||||||
|
iconv.h
|
||||||
|
PATHS
|
||||||
|
/opt/gnome/include
|
||||||
|
/opt/local/include
|
||||||
|
/opt/local/include
|
||||||
|
/sw/include
|
||||||
|
/sw/include
|
||||||
|
/usr/local/include
|
||||||
|
/usr/include
|
||||||
|
PATH_SUFFIXES
|
||||||
|
glib-2.0
|
||||||
|
)
|
||||||
|
|
||||||
|
FIND_LIBRARY(LIBICONV_LIBRARY
|
||||||
|
NAMES
|
||||||
|
iconv
|
||||||
|
PATHS
|
||||||
|
/opt/gnome/lib
|
||||||
|
/opt/local/lib
|
||||||
|
/sw/lib
|
||||||
|
/usr/lib
|
||||||
|
/usr/local/lib
|
||||||
|
)
|
||||||
|
|
||||||
|
IF (LIBICONV_LIBRARY AND LIBICONV_INCLUDE_DIR)
|
||||||
|
SET (LIBICONV_FOUND TRUE)
|
||||||
|
ENDIF (LIBICONV_LIBRARY AND LIBICONV_INCLUDE_DIR)
|
||||||
|
ENDIF ( NOT LIBICONV_FOUND )
|
||||||
|
|
||||||
|
IF (LIBINTL_FOUND)
|
||||||
|
SET (GLIB2_LIBRARIES ${GLIB2_LIBRARIES} ${LIBINTL_LIBRARY})
|
||||||
|
SET (GLIB2_INCLUDE_DIRS ${GLIB2_INCLUDE_DIRS} ${LIBINTL_INCLUDE_DIR})
|
||||||
|
ENDIF (LIBINTL_FOUND)
|
||||||
|
|
||||||
|
IF (LIBICONV_FOUND)
|
||||||
|
SET (GLIB2_LIBRARIES ${GLIB2_LIBRARIES} ${LIBICONV_LIBRARY})
|
||||||
|
SET (GLIB2_INCLUDE_DIRS ${GLIB2_INCLUDE_DIRS} ${LIBICONV_INCLUDE_DIR})
|
||||||
|
ENDIF (LIBICONV_FOUND)
|
||||||
|
|
||||||
|
ENDIF ( NOT GLIB2_FOUND AND NOT PKG_CONFIG_FOUND )
|
||||||
|
##
|
||||||
|
|
||||||
|
IF (GLIB2_CORE_FOUND AND GLIB2_INCLUDE_DIRS AND GLIB2_LIBRARIES)
|
||||||
|
SET (GLIB2_FOUND TRUE)
|
||||||
|
ENDIF (GLIB2_CORE_FOUND AND GLIB2_INCLUDE_DIRS AND GLIB2_LIBRARIES)
|
||||||
|
|
||||||
|
IF (GLIB2_FOUND)
|
||||||
|
IF (NOT GLIB2_FIND_QUIETLY)
|
||||||
|
MESSAGE (STATUS "Found GLib2: ${GLIB2_LIBRARIES} ${GLIB2_INCLUDE_DIRS}")
|
||||||
|
ENDIF (NOT GLIB2_FIND_QUIETLY)
|
||||||
|
ELSE (GLIB2_FOUND)
|
||||||
|
IF (GLIB2_FIND_REQUIRED)
|
||||||
|
MESSAGE (SEND_ERROR "Could not find GLib2")
|
||||||
|
ENDIF (GLIB2_FIND_REQUIRED)
|
||||||
|
ENDIF (GLIB2_FOUND)
|
||||||
|
|
||||||
|
# show the GLIB2_INCLUDE_DIRS and GLIB2_LIBRARIES variables only in the advanced view
|
||||||
|
MARK_AS_ADVANCED(GLIB2_INCLUDE_DIRS GLIB2_LIBRARIES)
|
||||||
|
MARK_AS_ADVANCED(LIBICONV_INCLUDE_DIR LIBICONV_LIBRARY)
|
||||||
|
MARK_AS_ADVANCED(LIBINTL_INCLUDE_DIR LIBINTL_LIBRARY)
|
||||||
|
|
||||||
|
ENDIF (GLIB2_LIBRARIES AND GLIB2_INCLUDE_DIRS)
|
||||||
|
|
||||||
|
IF ( GLIB2_FOUND )
|
||||||
|
# Check if system has a newer version of glib
|
||||||
|
# which supports g_regex_match_simple
|
||||||
|
INCLUDE( CheckIncludeFiles )
|
||||||
|
SET( CMAKE_REQUIRED_INCLUDES ${GLIB2_INCLUDE_DIRS} )
|
||||||
|
CHECK_INCLUDE_FILES ( glib/gregex.h HAVE_GLIB_GREGEX_H )
|
||||||
|
# Reset CMAKE_REQUIRED_INCLUDES
|
||||||
|
SET( CMAKE_REQUIRED_INCLUDES "" )
|
||||||
|
ENDIF( GLIB2_FOUND )
|
@ -0,0 +1,51 @@
|
|||||||
|
# - Try to find GObject2
|
||||||
|
# Find GObject2 headers, libraries and the answer to all questions.
|
||||||
|
#
|
||||||
|
# GOBJECT2_FOUND True if GOBJECT2 got found
|
||||||
|
# GOBJECT2_INCLUDE_DIRS Location of GOBJECT2 headers
|
||||||
|
# GOBJECT2_LIBRARIES List of libraries to use GOBJECT2
|
||||||
|
#
|
||||||
|
# Copyright (c) 2008 Bjoern Ricks <bjoern.ricks@googlemail.com>
|
||||||
|
#
|
||||||
|
# Redistribution and use is allowed according to the terms of the New
|
||||||
|
# BSD license.
|
||||||
|
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||||
|
#
|
||||||
|
|
||||||
|
INCLUDE( FindPkgConfig )
|
||||||
|
|
||||||
|
IF ( GOBJECT2_FIND_REQUIRED )
|
||||||
|
SET( _pkgconfig_REQUIRED "REQUIRED" )
|
||||||
|
ELSE( GOBJECT2_FIND_REQUIRED )
|
||||||
|
SET( _pkgconfig_REQUIRED "" )
|
||||||
|
ENDIF ( GOBJECT2_FIND_REQUIRED )
|
||||||
|
|
||||||
|
IF ( GOBJECT2_MIN_VERSION )
|
||||||
|
PKG_SEARCH_MODULE( GOBJECT2 ${_pkgconfig_REQUIRED} gobject-2.0>=${GOBJECT2_MIN_VERSION} )
|
||||||
|
ELSE ( GOBJECT2_MIN_VERSION )
|
||||||
|
PKG_SEARCH_MODULE( GOBJECT2 ${_pkgconfig_REQUIRED} gobject-2.0 )
|
||||||
|
ENDIF ( GOBJECT2_MIN_VERSION )
|
||||||
|
|
||||||
|
|
||||||
|
IF( NOT GOBJECT2_FOUND AND NOT PKG_CONFIG_FOUND )
|
||||||
|
FIND_PATH( GOBJECT2_INCLUDE_DIRS gobject/gobject.h PATH_SUFFIXES glib-2.0)
|
||||||
|
FIND_LIBRARY( GOBJECT2_LIBRARIES gobject-2.0 )
|
||||||
|
|
||||||
|
# Report results
|
||||||
|
IF ( GOBJECT2_LIBRARIES AND GOBJECT2_INCLUDE_DIRS )
|
||||||
|
SET( GOBJECT2_FOUND 1 )
|
||||||
|
IF ( NOT GOBJECT2_FIND_QUIETLY )
|
||||||
|
MESSAGE( STATUS "Found GOBJECT2: ${GOBJECT2_LIBRARIES}" )
|
||||||
|
ENDIF ( NOT GOBJECT2_FIND_QUIETLY )
|
||||||
|
ELSE ( GOBJECT2_LIBRARIES AND GOBJECT2_INCLUDE_DIRS )
|
||||||
|
IF ( GOBJECT2_FIND_REQUIRED )
|
||||||
|
MESSAGE( SEND_ERROR "Could NOT find GOBJECT2" )
|
||||||
|
ELSE ( GOBJECT2_FIND_REQUIRED )
|
||||||
|
IF ( NOT GOBJECT2_FIND_QUIETLY )
|
||||||
|
MESSAGE( STATUS "Could NOT find GOBJECT2" )
|
||||||
|
ENDIF ( NOT GOBJECT2_FIND_QUIETLY )
|
||||||
|
ENDIF ( GOBJECT2_FIND_REQUIRED )
|
||||||
|
ENDIF ( GOBJECT2_LIBRARIES AND GOBJECT2_INCLUDE_DIRS )
|
||||||
|
ENDIF( NOT GOBJECT2_FOUND AND NOT PKG_CONFIG_FOUND )
|
||||||
|
|
||||||
|
MARK_AS_ADVANCED( GOBJECT2_LIBRARIES GOBJECT2_INCLUDE_DIRS )
|
@ -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()
|
@ -0,0 +1,57 @@
|
|||||||
|
# - Try to find libGSF
|
||||||
|
#
|
||||||
|
# Once done this will define
|
||||||
|
#
|
||||||
|
# LIBGSF_FOUND - System has LibGSF
|
||||||
|
# LIBGSF_INCLUDE_DIR - The LibGSF include directory
|
||||||
|
# LIBGSF_LIBRARIES - The libraries needed to use LibGSF
|
||||||
|
# LIBGSF_DEFINITIONS - Compiler switches required for using LibGSF
|
||||||
|
# LIBGSF_GSF_EXECUTABLE - The archive utility
|
||||||
|
# LIBGSF_GSFOFFICETHUMBNAILER_EXECUTABLE - The office files thumbnailer for the GNOME desktop
|
||||||
|
# LIBGSF_GSFVBADUMP_EXECUTABLE - The utility to extract Visual Basic for Applications macros
|
||||||
|
|
||||||
|
# Copyright (c) 2009, Pau Garcia i Quiles <pgquiles@elpauer.org>
|
||||||
|
# Based off FindLibXml2.cmake from CMake 2.6.4 by Alexander Neundorf <neundorf@kde.org>
|
||||||
|
#
|
||||||
|
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||||
|
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||||
|
|
||||||
|
|
||||||
|
IF (LIBGSF_INCLUDE_DIR AND LIBGSF_LIBRARIES)
|
||||||
|
# in cache already
|
||||||
|
SET(LIBGSF_FIND_QUIETLY TRUE)
|
||||||
|
ENDIF (LIBGSF_INCLUDE_DIR AND LIBGSF_LIBRARIES)
|
||||||
|
|
||||||
|
IF (NOT WIN32)
|
||||||
|
# use pkg-config to get the directories and then use these values
|
||||||
|
# in the FIND_PATH() and FIND_LIBRARY() calls
|
||||||
|
FIND_PACKAGE(PkgConfig)
|
||||||
|
PKG_CHECK_MODULES(PC_LIBGSF libgsf-1)
|
||||||
|
SET(LIBGSF_DEFINITIONS ${PC_LIBGSF_CFLAGS_OTHER})
|
||||||
|
ENDIF (NOT WIN32)
|
||||||
|
|
||||||
|
FIND_PATH(LIBGSF_INCLUDE_DIR gsf/gsf.h
|
||||||
|
HINTS
|
||||||
|
${PC_LIBGSF_INCLUDEDIR}
|
||||||
|
${PC_LIBGSF_INCLUDE_DIRS}
|
||||||
|
PATH_SUFFIXES libgsf-1
|
||||||
|
)
|
||||||
|
|
||||||
|
FIND_LIBRARY(LIBGSF_LIBRARIES NAMES gsf-1 libgsf-1
|
||||||
|
HINTS
|
||||||
|
${PC_LIBGSF_LIBDIR}
|
||||||
|
${PC_LIBGSF_LIBRARY_DIRS}
|
||||||
|
)
|
||||||
|
|
||||||
|
FIND_PROGRAM(LIBGSF_GSF_EXECUTABLE gsf)
|
||||||
|
FIND_PROGRAM(LIBGSF_GSFOFFICETHUMBNAILER_EXECUTABLE gsf-office-thumbnailer)
|
||||||
|
FIND_PROGRAM(LIBGSF_GSFVBADUMP_EXECUTABLE gsf-vba-dump)
|
||||||
|
|
||||||
|
INCLUDE(FindPackageHandleStandardArgs)
|
||||||
|
|
||||||
|
# handle the QUIETLY and REQUIRED arguments and set LIBGSF_FOUND to TRUE if
|
||||||
|
# all listed variables are TRUE
|
||||||
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBGSF DEFAULT_MSG LIBGSF_LIBRARIES LIBGSF_INCLUDE_DIR)
|
||||||
|
|
||||||
|
MARK_AS_ADVANCED(LIBGSF_INCLUDE_DIR LIBGSF_LIBRARIES LIBGSF_GSF_EXECUTABLE LIBGSF_GSFOFFICETHUMBNAILER_EXECUTABLE LIBGSF_GSFVBADUMP_EXECUTABLE )
|
||||||
|
|
@ -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)
|
||||||
|
|
@ -1,101 +1,119 @@
|
|||||||
# - Find MS Visual C++
|
# - Find MS Visual C++
|
||||||
#
|
#
|
||||||
|
# VC_DIR - where to find Visual C++
|
||||||
# VC_INCLUDE_DIR - where to find headers
|
# VC_INCLUDE_DIR - where to find headers
|
||||||
# VC_INCLUDE_DIRS - where to find headers
|
# VC_INCLUDE_DIRS - where to find headers
|
||||||
# VC_LIBRARY_DIR - where to find libraries
|
# VC_LIBRARY_DIR - where to find libraries
|
||||||
# VC_FOUND - True if MSVC found.
|
# VC_FOUND - True if MSVC found
|
||||||
|
|
||||||
MACRO(DETECT_VC_VERSION_HELPER _ROOT _VERSION)
|
IF(CMAKE_CXX_COMPILER)
|
||||||
# Software/Wow6432Node/...
|
SET(_COMPILER ${CMAKE_CXX_COMPILER})
|
||||||
GET_FILENAME_COMPONENT(VC${_VERSION}_DIR "[${_ROOT}\\SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VC7;${_VERSION}]" ABSOLUTE)
|
SET(_VERSION ${CMAKE_CXX_COMPILER_VERSION})
|
||||||
|
ELSEIF(CMAKE_C_COMPILER)
|
||||||
IF(VC${_VERSION}_DIR AND VC${_VERSION}_DIR STREQUAL "/registry")
|
SET(_COMPILER ${CMAKE_C_COMPILER})
|
||||||
SET(VC${_VERSION}_DIR)
|
SET(_VERSION ${CMAKE_C_COMPILER_VERSION})
|
||||||
GET_FILENAME_COMPONENT(VC${_VERSION}_DIR "[${_ROOT}\\SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VS7;${_VERSION}]" ABSOLUTE)
|
ELSE()
|
||||||
IF(VC${_VERSION}_DIR AND NOT VC${_VERSION}_DIR STREQUAL "/registry")
|
MESSAGE(FATAL_ERROR "No way to determine Visual C++ location")
|
||||||
SET(VC${_VERSION}_DIR "${VC${_VERSION}_DIR}VC/")
|
ENDIF()
|
||||||
ENDIF(VC${_VERSION}_DIR AND NOT VC${_VERSION}_DIR STREQUAL "/registry")
|
|
||||||
ENDIF(VC${_VERSION}_DIR AND VC${_VERSION}_DIR STREQUAL "/registry")
|
IF(MSVC_VERSION LESS 1910)
|
||||||
|
IF(MSVC_VERSION LESS 1500)
|
||||||
IF(VC${_VERSION}_DIR AND NOT VC${_VERSION}_DIR STREQUAL "/registry")
|
MESSAGE(FATAL_ERROR "Unsupported version of Visual C++ (minimum version is 2008)")
|
||||||
SET(VC${_VERSION}_FOUND ON)
|
ELSEIF(MSVC_VERSION LESS 1600)
|
||||||
DETECT_EXPRESS_VERSION(${_VERSION})
|
SET(MSVC_TOOLSET "90")
|
||||||
IF(NOT MSVC_FIND_QUIETLY)
|
SET(_NAME "2008")
|
||||||
SET(_VERSION_STR ${_VERSION})
|
ELSEIF(MSVC_VERSION LESS 1700)
|
||||||
IF(MSVC_EXPRESS)
|
SET(MSVC_TOOLSET "100")
|
||||||
SET(_VERSION_STR "${_VERSION_STR} Express")
|
SET(_NAME "2010")
|
||||||
ENDIF(MSVC_EXPRESS)
|
ELSEIF(MSVC_VERSION LESS 1800)
|
||||||
MESSAGE(STATUS "Found Visual C++ ${_VERSION_STR} in ${VC${_VERSION}_DIR}")
|
SET(MSVC_TOOLSET "110")
|
||||||
ENDIF(NOT MSVC_FIND_QUIETLY)
|
SET(_NAME "2012")
|
||||||
ELSEIF(VC${_VERSION}_DIR AND NOT VC${_VERSION}_DIR STREQUAL "/registry")
|
ELSEIF(MSVC_VERSION LESS 1900)
|
||||||
SET(VC${_VERSION}_FOUND OFF)
|
SET(MSVC_TOOLSET "120")
|
||||||
SET(VC${_VERSION}_DIR "")
|
SET(_NAME "2013")
|
||||||
ENDIF(VC${_VERSION}_DIR AND NOT VC${_VERSION}_DIR STREQUAL "/registry")
|
ELSE()
|
||||||
ENDMACRO(DETECT_VC_VERSION_HELPER)
|
SET(MSVC_TOOLSET "140")
|
||||||
|
SET(_NAME "2015")
|
||||||
MACRO(DETECT_VC_VERSION _VERSION)
|
ENDIF()
|
||||||
SET(VC${_VERSION}_FOUND OFF)
|
|
||||||
DETECT_VC_VERSION_HELPER("HKEY_CURRENT_USER" ${_VERSION})
|
STRING(REGEX REPLACE "/bin/.+" "" VC_DIR ${_COMPILER})
|
||||||
|
|
||||||
IF(NOT VC${_VERSION}_FOUND)
|
MESSAGE(STATUS "Found Visual C++ ${_NAME} (${_VERSION}) in ${VC_DIR}")
|
||||||
DETECT_VC_VERSION_HELPER("HKEY_LOCAL_MACHINE" ${_VERSION})
|
ELSE()
|
||||||
ENDIF(NOT VC${_VERSION}_FOUND)
|
# Toolset = version of runtime DLLs
|
||||||
|
SET(MSVC_TOOLSET "140")
|
||||||
IF(VC${_VERSION}_FOUND)
|
|
||||||
|
IF(MSVC_VERSION LESS 1920)
|
||||||
|
SET(_NAME "2017")
|
||||||
|
ELSE()
|
||||||
|
SET(_NAME "2019")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
STRING(REGEX REPLACE "/MSVC/.+" "/MSVC" VC_DIR ${_COMPILER})
|
||||||
|
|
||||||
|
FILE(GLOB MSVC_TOOLCHAIN_VERSIONS RELATIVE ${VC_DIR} "${VC_DIR}/*")
|
||||||
|
|
||||||
|
IF(MSVC_TOOLCHAIN_VERSIONS)
|
||||||
|
LIST(SORT MSVC_TOOLCHAIN_VERSIONS)
|
||||||
|
LIST(REVERSE MSVC_TOOLCHAIN_VERSIONS)
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF(MSVC_TOOLCHAIN_VERSIONS)
|
||||||
|
LIST(GET MSVC_TOOLCHAIN_VERSIONS 0 MSVC_TOOLCHAIN_VERSION)
|
||||||
|
|
||||||
|
SET(VC_DIR "${VC_DIR}/${MSVC_TOOLCHAIN_VERSION}")
|
||||||
|
|
||||||
|
MESSAGE(STATUS "Found Visual C++ ${_NAME} (${_VERSION} with toolchain ${MSVC_TOOLCHAIN_VERSION}) in ${VC_DIR}")
|
||||||
|
ELSE()
|
||||||
|
MESSAGE(FATAL_ERROR "Unable to find Visual C++ in ${VC_DIR}")
|
||||||
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF(NOT VC_INCLUDE_DIR AND VC_DIR AND EXISTS "${VC_DIR}")
|
||||||
|
SET(VC_INCLUDE_DIR "${VC_DIR}/include")
|
||||||
|
IF(EXISTS "${VC_INCLUDE_DIR}")
|
||||||
SET(VC_FOUND ON)
|
SET(VC_FOUND ON)
|
||||||
SET(VC_DIR "${VC${_VERSION}_DIR}")
|
ENDIF()
|
||||||
ENDIF(VC${_VERSION}_FOUND)
|
ENDIF()
|
||||||
ENDMACRO(DETECT_VC_VERSION)
|
|
||||||
|
|
||||||
MACRO(DETECT_EXPRESS_VERSION _VERSION)
|
SET(MSVC_REDIST_DIR "${EXTERNAL_PATH}/redist")
|
||||||
GET_FILENAME_COMPONENT(MSVC_EXPRESS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\${_VERSION}\\Setup\\VC;ProductDir]" ABSOLUTE)
|
|
||||||
|
|
||||||
IF(MSVC_EXPRESS AND NOT MSVC_EXPRESS STREQUAL "/registry")
|
IF(NOT EXISTS "${MSVC_REDIST_DIR}")
|
||||||
SET(MSVC_EXPRESS ON)
|
SET(MSVC_REDIST_DIR "${VC_DIR}/redist")
|
||||||
ENDIF(MSVC_EXPRESS AND NOT MSVC_EXPRESS STREQUAL "/registry")
|
|
||||||
ENDMACRO(DETECT_EXPRESS_VERSION)
|
|
||||||
|
|
||||||
IF(MSVC12)
|
IF(NOT EXISTS "${MSVC_REDIST_DIR}")
|
||||||
DETECT_VC_VERSION("12.0")
|
SET(MSVC_REDIST_DIR)
|
||||||
SET(MSVC_TOOLSET "120")
|
ENDIF()
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
IF(NOT MSVC12_REDIST_DIR)
|
IF(MSVC_REDIST_DIR)
|
||||||
|
IF(MSVC_VERSION GREATER 1909)
|
||||||
|
# If you have VC++ 2017 Express, put x64/Microsoft.VC141.CRT/*.dll in ${EXTERNAL_PATH}/redist
|
||||||
|
# original files whould be in ${VC_DIR}/Redist/MSVC/14.11.25325/x64/Microsoft.VC141.CRT
|
||||||
|
SET(MSVC14_REDIST_DIR "${MSVC_REDIST_DIR}")
|
||||||
|
ELSEIF(MSVC14)
|
||||||
|
SET(MSVC14_REDIST_DIR "${MSVC_REDIST_DIR}")
|
||||||
|
ELSEIF(MSVC12)
|
||||||
# If you have VC++ 2013 Express, put x64/Microsoft.VC120.CRT/*.dll in ${EXTERNAL_PATH}/redist
|
# If you have VC++ 2013 Express, put x64/Microsoft.VC120.CRT/*.dll in ${EXTERNAL_PATH}/redist
|
||||||
SET(MSVC12_REDIST_DIR "${EXTERNAL_PATH}/redist")
|
SET(MSVC12_REDIST_DIR "${MSVC_REDIST_DIR}")
|
||||||
ENDIF(NOT MSVC12_REDIST_DIR)
|
|
||||||
ELSEIF(MSVC11)
|
ELSEIF(MSVC11)
|
||||||
DETECT_VC_VERSION("11.0")
|
|
||||||
SET(MSVC_TOOLSET "110")
|
|
||||||
|
|
||||||
IF(NOT MSVC11_REDIST_DIR)
|
|
||||||
# If you have VC++ 2012 Express, put x64/Microsoft.VC110.CRT/*.dll in ${EXTERNAL_PATH}/redist
|
# If you have VC++ 2012 Express, put x64/Microsoft.VC110.CRT/*.dll in ${EXTERNAL_PATH}/redist
|
||||||
SET(MSVC11_REDIST_DIR "${EXTERNAL_PATH}/redist")
|
SET(MSVC11_REDIST_DIR "${MSVC_REDIST_DIR}")
|
||||||
ENDIF(NOT MSVC11_REDIST_DIR)
|
|
||||||
ELSEIF(MSVC10)
|
ELSEIF(MSVC10)
|
||||||
DETECT_VC_VERSION("10.0")
|
|
||||||
SET(MSVC_TOOLSET "100")
|
|
||||||
|
|
||||||
IF(NOT MSVC10_REDIST_DIR)
|
|
||||||
# If you have VC++ 2010 Express, put x64/Microsoft.VC100.CRT/*.dll in ${EXTERNAL_PATH}/redist
|
# If you have VC++ 2010 Express, put x64/Microsoft.VC100.CRT/*.dll in ${EXTERNAL_PATH}/redist
|
||||||
SET(MSVC10_REDIST_DIR "${EXTERNAL_PATH}/redist")
|
SET(MSVC10_REDIST_DIR "${MSVC_REDIST_DIR}")
|
||||||
ENDIF(NOT MSVC10_REDIST_DIR)
|
|
||||||
ELSEIF(MSVC90)
|
ELSEIF(MSVC90)
|
||||||
DETECT_VC_VERSION("9.0")
|
SET(MSVC90_REDIST_DIR "${MSVC_REDIST_DIR}")
|
||||||
SET(MSVC_TOOLSET "90")
|
|
||||||
ELSEIF(MSVC80)
|
ELSEIF(MSVC80)
|
||||||
DETECT_VC_VERSION("8.0")
|
SET(MSVC80_REDIST_DIR "${MSVC_REDIST_DIR}")
|
||||||
SET(MSVC_TOOLSET "80")
|
ENDIF()
|
||||||
ENDIF(MSVC12)
|
ENDIF()
|
||||||
|
|
||||||
# If you plan to use VC++ compilers with WINE, set VC_DIR environment variable
|
|
||||||
IF(NOT VC_DIR)
|
|
||||||
SET(VC_DIR $ENV{VC_DIR})
|
|
||||||
ENDIF(NOT VC_DIR)
|
|
||||||
|
|
||||||
IF(NOT VC_DIR)
|
IF(VC_INCLUDE_DIR)
|
||||||
STRING(REGEX REPLACE "/bin/.+" "" VC_DIR ${CMAKE_CXX_COMPILER})
|
MESSAGE(STATUS "Using VC++ headers from ${VC_INCLUDE_DIR}")
|
||||||
ENDIF(NOT VC_DIR)
|
ELSE()
|
||||||
|
MESSAGE(FATAL_ERROR "Unable to find VC++ headers")
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
SET(VC_INCLUDE_DIR "${VC_DIR}/include")
|
|
||||||
SET(VC_INCLUDE_DIRS ${VC_INCLUDE_DIR})
|
SET(VC_INCLUDE_DIRS ${VC_INCLUDE_DIR})
|
||||||
INCLUDE_DIRECTORIES(${VC_INCLUDE_DIR})
|
INCLUDE_DIRECTORIES(${VC_INCLUDE_DIR})
|
||||||
|
@ -0,0 +1,418 @@
|
|||||||
|
# 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()
|
||||||
|
|
||||||
|
IF(CMAKE_DL_LIBS)
|
||||||
|
LIST(APPEND NELMISC_LIBRARIES ${CMAKE_DL_LIBS})
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
FIND_PACKAGE(Threads)
|
||||||
|
|
||||||
|
IF(Threads_FOUND)
|
||||||
|
LIST(APPEND NELMISC_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
IF(UNIX AND NOT APPLE)
|
||||||
|
LIST(APPEND NELMISC_LIBRARIES rt)
|
||||||
|
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
|
||||||
|
DIR ${NEL_DIR}
|
||||||
|
QUIET)
|
||||||
|
|
||||||
|
IF(${_UPNAME}_FOUND)
|
||||||
|
LIST(APPEND NEL_MODULES_FOUND ${COMPONENT})
|
||||||
|
|
||||||
|
# all NeL libraries depend on nelmisc in static
|
||||||
|
IF(NEL_STATIC)
|
||||||
|
LIST(APPEND ${_UPNAME}_LIBRARIES ${NELMISC_LIBRARIES})
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
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)
|
||||||
|
|
||||||
|
IF(LUABIND_FOUND)
|
||||||
|
LIST(APPEND ${_UPNAME}_LIBRARIES ${LUABIND_LIBRARIES})
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
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 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})
|
@ -1,49 +1,3 @@
|
|||||||
# - Locate Ogg library
|
INCLUDE(FindHelpers)
|
||||||
# This module defines
|
|
||||||
# OGG_LIBRARY, the library to link against
|
|
||||||
# OGG_FOUND, if false, do not try to link to OGG
|
|
||||||
# OGG_INCLUDE_DIR, where to find headers.
|
|
||||||
|
|
||||||
IF(OGG_LIBRARY AND OGG_INCLUDE_DIR)
|
FIND_PACKAGE_HELPER(Ogg ogg/ogg.h)
|
||||||
# in cache already
|
|
||||||
SET(OGG_FIND_QUIETLY TRUE)
|
|
||||||
ENDIF(OGG_LIBRARY AND OGG_INCLUDE_DIR)
|
|
||||||
|
|
||||||
|
|
||||||
FIND_PATH(OGG_INCLUDE_DIR
|
|
||||||
ogg/ogg.h
|
|
||||||
PATHS
|
|
||||||
$ENV{OGG_DIR}/include
|
|
||||||
/usr/local/include
|
|
||||||
/usr/include
|
|
||||||
/sw/include
|
|
||||||
/opt/local/include
|
|
||||||
/opt/csw/include
|
|
||||||
/opt/include
|
|
||||||
)
|
|
||||||
|
|
||||||
FIND_LIBRARY(OGG_LIBRARY
|
|
||||||
NAMES ogg libogg
|
|
||||||
PATHS
|
|
||||||
$ENV{OGG_DIR}/lib
|
|
||||||
/usr/local/lib
|
|
||||||
/usr/lib
|
|
||||||
/usr/local/X11R6/lib
|
|
||||||
/usr/X11R6/lib
|
|
||||||
/sw/lib
|
|
||||||
/opt/local/lib
|
|
||||||
/opt/csw/lib
|
|
||||||
/opt/lib
|
|
||||||
/usr/freeware/lib64
|
|
||||||
)
|
|
||||||
|
|
||||||
IF(OGG_LIBRARY AND OGG_INCLUDE_DIR)
|
|
||||||
SET(OGG_FOUND "YES")
|
|
||||||
IF(NOT OGG_FIND_QUIETLY)
|
|
||||||
MESSAGE(STATUS "Found Ogg: ${OGG_LIBRARY}")
|
|
||||||
ENDIF(NOT OGG_FIND_QUIETLY)
|
|
||||||
ELSE(OGG_LIBRARY AND OGG_INCLUDE_DIR)
|
|
||||||
IF(NOT OGG_FIND_QUIETLY)
|
|
||||||
MESSAGE(STATUS "Warning: Unable to find Ogg!")
|
|
||||||
ENDIF(NOT OGG_FIND_QUIETLY)
|
|
||||||
ENDIF(OGG_LIBRARY AND OGG_INCLUDE_DIR)
|
|
||||||
|
@ -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()
|
@ -1,91 +1,5 @@
|
|||||||
# Look for a directory containing STLport.
|
INCLUDE(FindHelpers)
|
||||||
#
|
|
||||||
# The following values are defined
|
|
||||||
# STLPORT_INCLUDE_DIR - where to find vector, etc.
|
|
||||||
# STLPORT_LIBRARIES - link against these to use STLport
|
|
||||||
# STLPORT_FOUND - True if the STLport is available.
|
|
||||||
|
|
||||||
# also defined, but not for general use are
|
FIND_PACKAGE_HELPER(STLport iostream
|
||||||
IF(STLPORT_LIBRARIES AND STLPORT_INCLUDE_DIR)
|
RELEASE stlport_cygwin stlport_gcc stlport_x stlport_x.5.2 stlport_statix stlport_static
|
||||||
# in cache already
|
DEBUG stlport_cygwin_debug stlport_cygwin_stldebug stlport_gcc_debug stlport_gcc_stldebug stlportstld_x stlportstld_x.5.2 stlportd_statix stlportd_static)
|
||||||
SET(STLPORT_FIND_QUIETLY TRUE)
|
|
||||||
ENDIF(STLPORT_LIBRARIES AND STLPORT_INCLUDE_DIR)
|
|
||||||
|
|
||||||
FIND_PATH(STLPORT_INCLUDE_DIR
|
|
||||||
iostream
|
|
||||||
PATHS
|
|
||||||
/usr/local/include
|
|
||||||
/usr/include
|
|
||||||
/sw/include
|
|
||||||
/opt/local/include
|
|
||||||
/opt/csw/include
|
|
||||||
/opt/include
|
|
||||||
PATH_SUFFIXES stlport
|
|
||||||
)
|
|
||||||
|
|
||||||
FIND_LIBRARY(STLPORT_LIBRARY_DEBUG
|
|
||||||
NAMES
|
|
||||||
stlport_cygwin_debug
|
|
||||||
stlport_cygwin_stldebug
|
|
||||||
stlport_gcc_debug
|
|
||||||
stlport_gcc_stldebug
|
|
||||||
stlportstld_x
|
|
||||||
stlportstld_x.5.2
|
|
||||||
stlportd
|
|
||||||
stlportd_statix
|
|
||||||
stlportd_static
|
|
||||||
PATHS
|
|
||||||
/usr/local/lib
|
|
||||||
/usr/lib
|
|
||||||
/usr/local/X11R6/lib
|
|
||||||
/usr/X11R6/lib
|
|
||||||
/sw/lib
|
|
||||||
/opt/local/lib
|
|
||||||
/opt/csw/lib
|
|
||||||
/opt/lib
|
|
||||||
/usr/freeware/lib64
|
|
||||||
)
|
|
||||||
|
|
||||||
FIND_LIBRARY(STLPORT_LIBRARY_RELEASE
|
|
||||||
NAMES
|
|
||||||
stlport_cygwin
|
|
||||||
stlport_gcc
|
|
||||||
stlport
|
|
||||||
stlport_x
|
|
||||||
stlport_x.5.2
|
|
||||||
stlport_statix
|
|
||||||
stlport_static
|
|
||||||
PATHS
|
|
||||||
/usr/local/lib
|
|
||||||
/usr/lib
|
|
||||||
/usr/local/X11R6/lib
|
|
||||||
/usr/X11R6/lib
|
|
||||||
/sw/lib
|
|
||||||
/opt/local/lib
|
|
||||||
/opt/csw/lib
|
|
||||||
/opt/lib
|
|
||||||
/usr/freeware/lib64
|
|
||||||
)
|
|
||||||
|
|
||||||
IF(STLPORT_INCLUDE_DIR)
|
|
||||||
IF(STLPORT_LIBRARY_RELEASE)
|
|
||||||
SET(STLPORT_FOUND TRUE)
|
|
||||||
|
|
||||||
SET(STLPORT_LIBRARIES ${STLPORT_LIBRARY_RELEASE})
|
|
||||||
IF(STLPORT_LIBRARY_DEBUG)
|
|
||||||
SET(STLPORT_LIBRARIES optimized ${STLPORT_LIBRARIES} debug ${STLPORT_LIBRARY_DEBUG})
|
|
||||||
ENDIF(STLPORT_LIBRARY_DEBUG)
|
|
||||||
ENDIF(STLPORT_LIBRARY_RELEASE)
|
|
||||||
ENDIF(STLPORT_INCLUDE_DIR)
|
|
||||||
|
|
||||||
IF(STLPORT_FOUND)
|
|
||||||
IF(NOT STLPORT_FIND_QUIETLY)
|
|
||||||
MESSAGE(STATUS "Found STLport: ${STLPORT_LIBRARIES}")
|
|
||||||
ENDIF(NOT STLPORT_FIND_QUIETLY)
|
|
||||||
ELSE(STLPORT_FOUND)
|
|
||||||
IF(NOT STLPORT_FIND_QUIETLY)
|
|
||||||
MESSAGE(STATUS "Warning: Unable to find STLport!")
|
|
||||||
ENDIF(NOT STLPORT_FIND_QUIETLY)
|
|
||||||
ENDIF(STLPORT_FOUND)
|
|
||||||
|
|
||||||
MARK_AS_ADVANCED(STLPORT_LIBRARY_RELEASE STLPORT_LIBRARY_DEBUG)
|
|
||||||
|
@ -1,83 +1,14 @@
|
|||||||
#
|
INCLUDE(FindHelpers)
|
||||||
# Find the LibSquish includes and library
|
|
||||||
#
|
|
||||||
# This module defines
|
|
||||||
# SQUISH_INCLUDE_DIR, where to find squish.h
|
|
||||||
# SQUISH_LIBRARIES, where to find the Squish libraries.
|
|
||||||
# SQUISH_FOUND, If false, do not try to use Squish.
|
|
||||||
|
|
||||||
# also defined, but not for general use are
|
FIND_PACKAGE_HELPER(Squish squish.h)
|
||||||
IF(SQUISH_LIBRARIES AND SQUISH_INCLUDE_DIR)
|
|
||||||
# in cache already
|
|
||||||
SET(SQUISH_FIND_QUIETLY TRUE)
|
|
||||||
ENDIF(SQUISH_LIBRARIES AND SQUISH_INCLUDE_DIR)
|
|
||||||
|
|
||||||
FIND_PATH(SQUISH_INCLUDE_DIR
|
|
||||||
squish.h
|
|
||||||
PATHS
|
|
||||||
/usr/local/include
|
|
||||||
/usr/include
|
|
||||||
/sw/include
|
|
||||||
/opt/local/include
|
|
||||||
/opt/csw/include
|
|
||||||
/opt/include
|
|
||||||
PATH_SUFFIXES cppunit
|
|
||||||
)
|
|
||||||
|
|
||||||
FIND_LIBRARY(SQUISH_LIBRARY_RELEASE
|
|
||||||
squish
|
|
||||||
PATHS
|
|
||||||
/usr/local/lib
|
|
||||||
/usr/lib
|
|
||||||
/usr/local/X11R6/lib
|
|
||||||
/usr/X11R6/lib
|
|
||||||
/sw/lib
|
|
||||||
/opt/local/lib
|
|
||||||
/opt/csw/lib
|
|
||||||
/opt/lib
|
|
||||||
/usr/freeware/lib64
|
|
||||||
)
|
|
||||||
|
|
||||||
FIND_LIBRARY(SQUISH_LIBRARY_DEBUG
|
|
||||||
squishd
|
|
||||||
PATHS
|
|
||||||
/usr/local/lib
|
|
||||||
/usr/lib
|
|
||||||
/usr/local/X11R6/lib
|
|
||||||
/usr/X11R6/lib
|
|
||||||
/sw/lib
|
|
||||||
/opt/local/lib
|
|
||||||
/opt/csw/lib
|
|
||||||
/opt/lib
|
|
||||||
/usr/freeware/lib64
|
|
||||||
)
|
|
||||||
|
|
||||||
IF(SQUISH_INCLUDE_DIR)
|
|
||||||
IF(SQUISH_LIBRARY_RELEASE)
|
|
||||||
SET(SQUISH_FOUND "YES")
|
|
||||||
SET(SQUISH_LIBRARIES "optimized;${SQUISH_LIBRARY_RELEASE}")
|
|
||||||
IF(SQUISH_LIBRARY_DEBUG)
|
|
||||||
SET(SQUISH_LIBRARIES "${SQUISH_LIBRARIES};debug;${SQUISH_LIBRARY_DEBUG}")
|
|
||||||
ELSE(SQUISH_LIBRARY_DEBUG)
|
|
||||||
SET(SQUISH_LIBRARIES "${SQUISH_LIBRARIES};debug;${SQUISH_LIBRARY_RELEASE}")
|
|
||||||
MESSAGE("Debug Squish NOT found, using the release version!")
|
|
||||||
ENDIF(SQUISH_LIBRARY_DEBUG)
|
|
||||||
ENDIF(SQUISH_LIBRARY_RELEASE)
|
|
||||||
ENDIF(SQUISH_INCLUDE_DIR)
|
|
||||||
|
|
||||||
IF(SQUISH_FOUND)
|
IF(SQUISH_FOUND)
|
||||||
IF(NOT SQUISH_FIND_QUIETLY)
|
IF(NOT SQUISH_FIND_QUIETLY)
|
||||||
MESSAGE(STATUS "Found Squish: ${SQUISH_LIBRARIES}")
|
MESSAGE(STATUS "Found Squish: ${SQUISH_LIBRARIES}")
|
||||||
ENDIF(NOT SQUISH_FIND_QUIETLY)
|
ENDIF()
|
||||||
FILE(STRINGS ${SQUISH_INCLUDE_DIR}/squish.h METRIC REGEX "metric = 0")
|
FILE(STRINGS ${SQUISH_INCLUDE_DIR}/squish.h METRIC REGEX "metric = 0")
|
||||||
IF(METRIC)
|
IF(METRIC)
|
||||||
SET(SQUISH_COMPRESS_HAS_METRIC ON)
|
SET(SQUISH_COMPRESS_HAS_METRIC ON)
|
||||||
SET(SQUISH_DEFINITIONS -DSQUISH_COMPRESS_HAS_METRIC)
|
SET(SQUISH_DEFINITIONS -DSQUISH_COMPRESS_HAS_METRIC)
|
||||||
ENDIF(METRIC)
|
ENDIF()
|
||||||
ELSE(SQUISH_FOUND)
|
ENDIF()
|
||||||
IF(NOT SQUISH_FIND_QUIETLY)
|
|
||||||
MESSAGE(STATUS "Warning: Unable to find Squish!")
|
|
||||||
ENDIF(NOT SQUISH_FIND_QUIETLY)
|
|
||||||
ENDIF(SQUISH_FOUND)
|
|
||||||
|
|
||||||
MARK_AS_ADVANCED(SQUISH_LIBRARY_RELEASE SQUISH_LIBRARY_DEBUG)
|
|
||||||
|
@ -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()
|
@ -1,65 +1,8 @@
|
|||||||
# - Locate Vorbis library
|
INCLUDE(FindHelpers)
|
||||||
# This module defines
|
|
||||||
# VORBIS_LIBRARY, the library to link against
|
|
||||||
# VORBIS_FOUND, if false, do not try to link to VORBIS
|
|
||||||
# VORBIS_INCLUDE_DIR, where to find headers.
|
|
||||||
|
|
||||||
IF(VORBIS_LIBRARY AND VORBIS_INCLUDE_DIR)
|
FIND_PACKAGE_HELPER(Vorbis vorbisenc.h)
|
||||||
# in cache already
|
FIND_PACKAGE_HELPER(VorbisFile vorbisfile.h SUFFIXES vorbis)
|
||||||
SET(VORBIS_FIND_QUIETLY TRUE)
|
|
||||||
ENDIF(VORBIS_LIBRARY AND VORBIS_INCLUDE_DIR)
|
|
||||||
|
|
||||||
|
IF(VORBISFILE_FOUND)
|
||||||
FIND_PATH(VORBIS_INCLUDE_DIR
|
SET(VORBIS_LIBRARIES ${VORBIS_LIBRARIES} ${VORBISFILE_LIBRARIES})
|
||||||
vorbis/vorbisfile.h
|
ENDIF()
|
||||||
PATHS
|
|
||||||
$ENV{VORBIS_DIR}/include
|
|
||||||
/usr/local/include
|
|
||||||
/usr/include
|
|
||||||
/sw/include
|
|
||||||
/opt/local/include
|
|
||||||
/opt/csw/include
|
|
||||||
/opt/include
|
|
||||||
)
|
|
||||||
|
|
||||||
FIND_LIBRARY(VORBIS_LIBRARY
|
|
||||||
NAMES vorbis libvorbis
|
|
||||||
PATHS
|
|
||||||
$ENV{VORBIS_DIR}/lib
|
|
||||||
/usr/local/lib
|
|
||||||
/usr/lib
|
|
||||||
/usr/local/X11R6/lib
|
|
||||||
/usr/X11R6/lib
|
|
||||||
/sw/lib
|
|
||||||
/opt/local/lib
|
|
||||||
/opt/csw/lib
|
|
||||||
/opt/lib
|
|
||||||
/usr/freeware/lib64
|
|
||||||
)
|
|
||||||
|
|
||||||
FIND_LIBRARY(VORBISFILE_LIBRARY
|
|
||||||
NAMES vorbisfile libvorbisfile
|
|
||||||
PATHS
|
|
||||||
$ENV{VORBIS_DIR}/lib
|
|
||||||
/usr/local/lib
|
|
||||||
/usr/lib
|
|
||||||
/usr/local/X11R6/lib
|
|
||||||
/usr/X11R6/lib
|
|
||||||
/sw/lib
|
|
||||||
/opt/local/lib
|
|
||||||
/opt/csw/lib
|
|
||||||
/opt/lib
|
|
||||||
/usr/freeware/lib64
|
|
||||||
)
|
|
||||||
|
|
||||||
IF(VORBIS_LIBRARY AND VORBISFILE_LIBRARY AND VORBIS_INCLUDE_DIR)
|
|
||||||
SET(VORBIS_FOUND "YES")
|
|
||||||
SET(VORBIS_LIBRARIES ${VORBIS_LIBRARY} ${VORBISFILE_LIBRARY})
|
|
||||||
IF(NOT VORBIS_FIND_QUIETLY)
|
|
||||||
MESSAGE(STATUS "Found Vorbis: ${VORBIS_LIBRARY}")
|
|
||||||
ENDIF(NOT VORBIS_FIND_QUIETLY)
|
|
||||||
ELSE(VORBIS_LIBRARY AND VORBISFILE_LIBRARY AND VORBIS_INCLUDE_DIR)
|
|
||||||
IF(NOT VORBIS_FIND_QUIETLY)
|
|
||||||
MESSAGE(STATUS "Warning: Unable to find Vorbis!")
|
|
||||||
ENDIF(NOT VORBIS_FIND_QUIETLY)
|
|
||||||
ENDIF(VORBIS_LIBRARY AND VORBISFILE_LIBRARY AND VORBIS_INCLUDE_DIR)
|
|
||||||
|
@ -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,143 @@
|
|||||||
|
# Define OSX_SDK to force a specific version such as : -DOSX_SDK=10.11
|
||||||
|
#
|
||||||
|
# Example:
|
||||||
|
# cmake .. -DCMAKE_TOOLCHAIN_FILE=$CMAKE_MODULE_PATH/OSXToolChain.cmake -DOSX_SDK=10.14 <other flags>
|
||||||
|
|
||||||
|
# Don't forget to define environment variables:
|
||||||
|
#
|
||||||
|
# export MACOSX_DEPLOYMENT_TARGET=10.8
|
||||||
|
# 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
|
||||||
|
# cmake .. -DCMAKE_TOOLCHAIN_FILE=$CMAKE_MODULE_PATH/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()
|
||||||
|
|
||||||
|
# OSXCROSS_TARGET
|
||||||
|
# OSXCROSS_SDK
|
||||||
|
|
||||||
|
# Force the compilers to Clang for OS X
|
||||||
|
|
||||||
|
SET(OSXCROSS_HOST "x86_64-apple-darwin18")
|
||||||
|
|
||||||
|
# C
|
||||||
|
SET(CMAKE_C_COMPILER ${OSXCROSS_HOST}-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 ${OSXCROSS_HOST}-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-18.0.0")
|
||||||
|
SET(CMAKE_SYSTEM_VERSION "18.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 NEVER)
|
||||||
|
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||||
|
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
||||||
|
SET(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
|
||||||
|
|
||||||
|
# determinate location for bin utils based on CMAKE_FIND_ROOT_PATH
|
||||||
|
INCLUDE(CMakeFindBinUtils)
|
||||||
|
|
||||||
|
set(CMAKE_AR "${OSXCROSS_HOST}-ar" CACHE FILEPATH "ar")
|
||||||
|
set(CMAKE_RANLIB "${OSXCROSS_HOST}-ranlib" CACHE FILEPATH "ranlib")
|
||||||
|
set(CMAKE_INSTALL_NAME_TOOL "${OSXCROSS_HOST}-install_name_tool" CACHE FILEPATH "install_name_tool")
|
||||||
|
|
||||||
|
set(ENV{PKG_CONFIG_LIBDIR} "${MACPORTS_ROOT_DIR}/lib/pkgconfig")
|
||||||
|
set(ENV{PKG_CONFIG_SYSROOT_DIR} "${CMAKE_OSX_TOOLCHAIN_ROOT}/macports/pkgs")
|
File diff suppressed because it is too large
Load Diff
@ -1,20 +1,19 @@
|
|||||||
/* 7zAlloc.h */
|
/* 7zAlloc.h -- Allocation functions
|
||||||
|
2017-04-03 : Igor Pavlov : Public domain */
|
||||||
|
|
||||||
#ifndef __7Z_ALLOC_H
|
#ifndef __7Z_ALLOC_H
|
||||||
#define __7Z_ALLOC_H
|
#define __7Z_ALLOC_H
|
||||||
|
|
||||||
#include <stddef.h>
|
#include "7zTypes.h"
|
||||||
|
|
||||||
typedef struct _ISzAlloc
|
EXTERN_C_BEGIN
|
||||||
{
|
|
||||||
void *(*Alloc)(size_t size);
|
|
||||||
void (*Free)(void *address); /* address can be 0 */
|
|
||||||
} ISzAlloc;
|
|
||||||
|
|
||||||
void *SzAlloc(size_t size);
|
void *SzAlloc(ISzAllocPtr p, size_t size);
|
||||||
void SzFree(void *address);
|
void SzFree(ISzAllocPtr p, void *address);
|
||||||
|
|
||||||
void *SzAllocTemp(size_t size);
|
void *SzAllocTemp(ISzAllocPtr p, size_t size);
|
||||||
void SzFreeTemp(void *address);
|
void SzFreeTemp(ISzAllocPtr p, void *address);
|
||||||
|
|
||||||
|
EXTERN_C_END
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,76 +1,128 @@
|
|||||||
/* 7zCrc.c */
|
/* 7zCrc.c -- CRC32 init
|
||||||
|
2017-06-06 : Igor Pavlov : Public domain */
|
||||||
|
|
||||||
|
#include "Precomp.h"
|
||||||
|
|
||||||
#include "7zCrc.h"
|
#include "7zCrc.h"
|
||||||
|
#include "CpuArch.h"
|
||||||
|
|
||||||
#define kCrcPoly 0xEDB88320
|
#define kCrcPoly 0xEDB88320
|
||||||
|
|
||||||
UInt32 g_CrcTable[256];
|
#ifdef MY_CPU_LE
|
||||||
|
#define CRC_NUM_TABLES 8
|
||||||
|
#else
|
||||||
|
#define CRC_NUM_TABLES 9
|
||||||
|
|
||||||
void InitCrcTable()
|
#define CRC_UINT32_SWAP(v) ((v >> 24) | ((v >> 8) & 0xFF00) | ((v << 8) & 0xFF0000) | (v << 24))
|
||||||
{
|
|
||||||
UInt32 i;
|
UInt32 MY_FAST_CALL CrcUpdateT1_BeT4(UInt32 v, const void *data, size_t size, const UInt32 *table);
|
||||||
for (i = 0; i < 256; i++)
|
UInt32 MY_FAST_CALL CrcUpdateT1_BeT8(UInt32 v, const void *data, size_t size, const UInt32 *table);
|
||||||
{
|
#endif
|
||||||
UInt32 r = i;
|
|
||||||
int j;
|
#ifndef MY_CPU_BE
|
||||||
for (j = 0; j < 8; j++)
|
UInt32 MY_FAST_CALL CrcUpdateT4(UInt32 v, const void *data, size_t size, const UInt32 *table);
|
||||||
if (r & 1)
|
UInt32 MY_FAST_CALL CrcUpdateT8(UInt32 v, const void *data, size_t size, const UInt32 *table);
|
||||||
r = (r >> 1) ^ kCrcPoly;
|
#endif
|
||||||
else
|
|
||||||
r >>= 1;
|
typedef UInt32 (MY_FAST_CALL *CRC_FUNC)(UInt32 v, const void *data, size_t size, const UInt32 *table);
|
||||||
g_CrcTable[i] = r;
|
|
||||||
}
|
CRC_FUNC g_CrcUpdateT4;
|
||||||
}
|
CRC_FUNC g_CrcUpdateT8;
|
||||||
|
CRC_FUNC g_CrcUpdate;
|
||||||
|
|
||||||
void CrcInit(UInt32 *crc) { *crc = 0xFFFFFFFF; }
|
UInt32 g_CrcTable[256 * CRC_NUM_TABLES];
|
||||||
UInt32 CrcGetDigest(UInt32 *crc) { return *crc ^ 0xFFFFFFFF; }
|
|
||||||
|
|
||||||
void CrcUpdateByte(UInt32 *crc, Byte b)
|
UInt32 MY_FAST_CALL CrcUpdate(UInt32 v, const void *data, size_t size)
|
||||||
{
|
{
|
||||||
*crc = g_CrcTable[((Byte)(*crc)) ^ b] ^ (*crc >> 8);
|
return g_CrcUpdate(v, data, size, g_CrcTable);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CrcUpdateUInt16(UInt32 *crc, UInt16 v)
|
UInt32 MY_FAST_CALL CrcCalc(const void *data, size_t size)
|
||||||
{
|
{
|
||||||
CrcUpdateByte(crc, (Byte)v);
|
return g_CrcUpdate(CRC_INIT_VAL, data, size, g_CrcTable) ^ CRC_INIT_VAL;
|
||||||
CrcUpdateByte(crc, (Byte)(v >> 8));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CrcUpdateUInt32(UInt32 *crc, UInt32 v)
|
#define CRC_UPDATE_BYTE_2(crc, b) (table[((crc) ^ (b)) & 0xFF] ^ ((crc) >> 8))
|
||||||
|
|
||||||
|
UInt32 MY_FAST_CALL CrcUpdateT1(UInt32 v, const void *data, size_t size, const UInt32 *table)
|
||||||
{
|
{
|
||||||
int i;
|
const Byte *p = (const Byte *)data;
|
||||||
for (i = 0; i < 4; i++)
|
const Byte *pEnd = p + size;
|
||||||
CrcUpdateByte(crc, (Byte)(v >> (8 * i)));
|
for (; p != pEnd; p++)
|
||||||
|
v = CRC_UPDATE_BYTE_2(v, *p);
|
||||||
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CrcUpdateUInt64(UInt32 *crc, UInt64 v)
|
void MY_FAST_CALL CrcGenerateTable()
|
||||||
{
|
{
|
||||||
int i;
|
UInt32 i;
|
||||||
for (i = 0; i < 8; i++)
|
for (i = 0; i < 256; i++)
|
||||||
{
|
{
|
||||||
CrcUpdateByte(crc, (Byte)(v));
|
UInt32 r = i;
|
||||||
v >>= 8;
|
unsigned j;
|
||||||
|
for (j = 0; j < 8; j++)
|
||||||
|
r = (r >> 1) ^ (kCrcPoly & ((UInt32)0 - (r & 1)));
|
||||||
|
g_CrcTable[i] = r;
|
||||||
}
|
}
|
||||||
|
for (i = 256; i < 256 * CRC_NUM_TABLES; i++)
|
||||||
|
{
|
||||||
|
UInt32 r = g_CrcTable[(size_t)i - 256];
|
||||||
|
g_CrcTable[i] = g_CrcTable[r & 0xFF] ^ (r >> 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CrcUpdate(UInt32 *crc, const void *data, size_t size)
|
#if CRC_NUM_TABLES < 4
|
||||||
|
|
||||||
|
g_CrcUpdate = CrcUpdateT1;
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
#ifdef MY_CPU_LE
|
||||||
|
|
||||||
|
g_CrcUpdateT4 = CrcUpdateT4;
|
||||||
|
g_CrcUpdate = CrcUpdateT4;
|
||||||
|
|
||||||
|
#if CRC_NUM_TABLES >= 8
|
||||||
|
g_CrcUpdateT8 = CrcUpdateT8;
|
||||||
|
|
||||||
|
#ifdef MY_CPU_X86_OR_AMD64
|
||||||
|
if (!CPU_Is_InOrder())
|
||||||
|
#endif
|
||||||
|
g_CrcUpdate = CrcUpdateT8;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#else
|
||||||
{
|
{
|
||||||
UInt32 v = *crc;
|
#ifndef MY_CPU_BE
|
||||||
const Byte *p = (const Byte *)data;
|
UInt32 k = 0x01020304;
|
||||||
for (; size > 0 ; size--, p++)
|
const Byte *p = (const Byte *)&k;
|
||||||
v = g_CrcTable[((Byte)(v)) ^ *p] ^ (v >> 8);
|
if (p[0] == 4 && p[1] == 3)
|
||||||
*crc = v;
|
{
|
||||||
|
g_CrcUpdateT4 = CrcUpdateT4;
|
||||||
|
g_CrcUpdate = CrcUpdateT4;
|
||||||
|
#if CRC_NUM_TABLES >= 8
|
||||||
|
g_CrcUpdateT8 = CrcUpdateT8;
|
||||||
|
g_CrcUpdate = CrcUpdateT8;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
else if (p[0] != 1 || p[1] != 2)
|
||||||
UInt32 CrcCalculateDigest(const void *data, size_t size)
|
g_CrcUpdate = CrcUpdateT1;
|
||||||
|
else
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
UInt32 crc;
|
for (i = 256 * CRC_NUM_TABLES - 1; i >= 256; i--)
|
||||||
CrcInit(&crc);
|
{
|
||||||
CrcUpdate(&crc, data, size);
|
UInt32 x = g_CrcTable[(size_t)i - 256];
|
||||||
return CrcGetDigest(&crc);
|
g_CrcTable[i] = CRC_UINT32_SWAP(x);
|
||||||
|
}
|
||||||
|
g_CrcUpdateT4 = CrcUpdateT1_BeT4;
|
||||||
|
g_CrcUpdate = CrcUpdateT1_BeT4;
|
||||||
|
#if CRC_NUM_TABLES >= 8
|
||||||
|
g_CrcUpdateT8 = CrcUpdateT1_BeT8;
|
||||||
|
g_CrcUpdate = CrcUpdateT1_BeT8;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
int CrcVerifyDigest(UInt32 digest, const void *data, size_t size)
|
#endif
|
||||||
{
|
|
||||||
return (CrcCalculateDigest(data, size) == digest);
|
|
||||||
}
|
}
|
||||||
|
@ -1,24 +1,25 @@
|
|||||||
/* 7zCrc.h */
|
/* 7zCrc.h -- CRC32 calculation
|
||||||
|
2013-01-18 : Igor Pavlov : Public domain */
|
||||||
|
|
||||||
#ifndef __7Z_CRC_H
|
#ifndef __7Z_CRC_H
|
||||||
#define __7Z_CRC_H
|
#define __7Z_CRC_H
|
||||||
|
|
||||||
#include <stddef.h>
|
|
||||||
|
|
||||||
#include "7zTypes.h"
|
#include "7zTypes.h"
|
||||||
|
|
||||||
extern UInt32 g_CrcTable[256];
|
EXTERN_C_BEGIN
|
||||||
void InitCrcTable();
|
|
||||||
|
extern UInt32 g_CrcTable[];
|
||||||
|
|
||||||
|
/* Call CrcGenerateTable one time before other CRC functions */
|
||||||
|
void MY_FAST_CALL CrcGenerateTable(void);
|
||||||
|
|
||||||
|
#define CRC_INIT_VAL 0xFFFFFFFF
|
||||||
|
#define CRC_GET_DIGEST(crc) ((crc) ^ CRC_INIT_VAL)
|
||||||
|
#define CRC_UPDATE_BYTE(crc, b) (g_CrcTable[((crc) ^ (b)) & 0xFF] ^ ((crc) >> 8))
|
||||||
|
|
||||||
void CrcInit(UInt32 *crc);
|
UInt32 MY_FAST_CALL CrcUpdate(UInt32 crc, const void *data, size_t size);
|
||||||
UInt32 CrcGetDigest(UInt32 *crc);
|
UInt32 MY_FAST_CALL CrcCalc(const void *data, size_t size);
|
||||||
void CrcUpdateByte(UInt32 *crc, Byte v);
|
|
||||||
void CrcUpdateUInt16(UInt32 *crc, UInt16 v);
|
|
||||||
void CrcUpdateUInt32(UInt32 *crc, UInt32 v);
|
|
||||||
void CrcUpdateUInt64(UInt32 *crc, UInt64 v);
|
|
||||||
void CrcUpdate(UInt32 *crc, const void *data, size_t size);
|
|
||||||
|
|
||||||
UInt32 CrcCalculateDigest(const void *data, size_t size);
|
EXTERN_C_END
|
||||||
int CrcVerifyDigest(UInt32 digest, const void *data, size_t size);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,70 +1,375 @@
|
|||||||
/* 7zTypes.h */
|
/* 7zTypes.h -- Basic types
|
||||||
|
2018-08-04 : Igor Pavlov : Public domain */
|
||||||
|
|
||||||
#ifndef __COMMON_TYPES_H
|
#ifndef __7Z_TYPES_H
|
||||||
#define __COMMON_TYPES_H
|
#define __7Z_TYPES_H
|
||||||
|
|
||||||
#ifndef _7ZIP_BYTE_DEFINED
|
#ifdef _WIN32
|
||||||
#define _7ZIP_BYTE_DEFINED
|
/* #include <windows.h> */
|
||||||
typedef unsigned char Byte;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef _7ZIP_UINT16_DEFINED
|
#include <stddef.h>
|
||||||
#define _7ZIP_UINT16_DEFINED
|
|
||||||
typedef unsigned short UInt16;
|
#ifndef EXTERN_C_BEGIN
|
||||||
|
#ifdef __cplusplus
|
||||||
|
#define EXTERN_C_BEGIN extern "C" {
|
||||||
|
#define EXTERN_C_END }
|
||||||
|
#else
|
||||||
|
#define EXTERN_C_BEGIN
|
||||||
|
#define EXTERN_C_END
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
EXTERN_C_BEGIN
|
||||||
|
|
||||||
|
#define SZ_OK 0
|
||||||
|
|
||||||
|
#define SZ_ERROR_DATA 1
|
||||||
|
#define SZ_ERROR_MEM 2
|
||||||
|
#define SZ_ERROR_CRC 3
|
||||||
|
#define SZ_ERROR_UNSUPPORTED 4
|
||||||
|
#define SZ_ERROR_PARAM 5
|
||||||
|
#define SZ_ERROR_INPUT_EOF 6
|
||||||
|
#define SZ_ERROR_OUTPUT_EOF 7
|
||||||
|
#define SZ_ERROR_READ 8
|
||||||
|
#define SZ_ERROR_WRITE 9
|
||||||
|
#define SZ_ERROR_PROGRESS 10
|
||||||
|
#define SZ_ERROR_FAIL 11
|
||||||
|
#define SZ_ERROR_THREAD 12
|
||||||
|
|
||||||
|
#define SZ_ERROR_ARCHIVE 16
|
||||||
|
#define SZ_ERROR_NO_ARCHIVE 17
|
||||||
|
|
||||||
|
typedef int SRes;
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
|
||||||
|
/* typedef DWORD WRes; */
|
||||||
|
typedef unsigned WRes;
|
||||||
|
#define MY_SRes_HRESULT_FROM_WRes(x) HRESULT_FROM_WIN32(x)
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
typedef int WRes;
|
||||||
|
#define MY__FACILITY_WIN32 7
|
||||||
|
#define MY__FACILITY__WRes MY__FACILITY_WIN32
|
||||||
|
#define MY_SRes_HRESULT_FROM_WRes(x) ((HRESULT)(x) <= 0 ? ((HRESULT)(x)) : ((HRESULT) (((x) & 0x0000FFFF) | (MY__FACILITY__WRes << 16) | 0x80000000)))
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef RINOK
|
||||||
|
#define RINOK(x) { int __result__ = (x); if (__result__ != 0) return __result__; }
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef unsigned char Byte;
|
||||||
|
typedef short Int16;
|
||||||
|
typedef unsigned short UInt16;
|
||||||
|
|
||||||
#ifndef _7ZIP_UINT32_DEFINED
|
|
||||||
#define _7ZIP_UINT32_DEFINED
|
|
||||||
#ifdef _LZMA_UINT32_IS_ULONG
|
#ifdef _LZMA_UINT32_IS_ULONG
|
||||||
|
typedef long Int32;
|
||||||
typedef unsigned long UInt32;
|
typedef unsigned long UInt32;
|
||||||
#else
|
#else
|
||||||
|
typedef int Int32;
|
||||||
typedef unsigned int UInt32;
|
typedef unsigned int UInt32;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
/* #define _SZ_NO_INT_64 */
|
|
||||||
/* define it your compiler doesn't support long long int */
|
|
||||||
|
|
||||||
#ifndef _7ZIP_UINT64_DEFINED
|
|
||||||
#define _7ZIP_UINT64_DEFINED
|
|
||||||
#ifdef _SZ_NO_INT_64
|
#ifdef _SZ_NO_INT_64
|
||||||
|
|
||||||
|
/* define _SZ_NO_INT_64, if your compiler doesn't support 64-bit integers.
|
||||||
|
NOTES: Some code will work incorrectly in that case! */
|
||||||
|
|
||||||
|
typedef long Int64;
|
||||||
typedef unsigned long UInt64;
|
typedef unsigned long UInt64;
|
||||||
|
|
||||||
#else
|
#else
|
||||||
#ifdef _MSC_VER
|
|
||||||
|
#if defined(_MSC_VER) || defined(__BORLANDC__)
|
||||||
|
typedef __int64 Int64;
|
||||||
typedef unsigned __int64 UInt64;
|
typedef unsigned __int64 UInt64;
|
||||||
|
#define UINT64_CONST(n) n
|
||||||
#else
|
#else
|
||||||
|
typedef long long int Int64;
|
||||||
typedef unsigned long long int UInt64;
|
typedef unsigned long long int UInt64;
|
||||||
|
#define UINT64_CONST(n) n ## ULL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef _LZMA_NO_SYSTEM_SIZE_T
|
||||||
|
typedef UInt32 SizeT;
|
||||||
|
#else
|
||||||
|
typedef size_t SizeT;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
typedef int BoolInt;
|
||||||
|
/* typedef BoolInt Bool; */
|
||||||
|
#define True 1
|
||||||
|
#define False 0
|
||||||
|
|
||||||
/* #define _SZ_FILE_SIZE_64 */
|
|
||||||
/* Use _SZ_FILE_SIZE_64 if you need support for files larger than 4 GB*/
|
|
||||||
|
|
||||||
#ifndef CFileSize
|
#ifdef _WIN32
|
||||||
#ifdef _SZ_FILE_SIZE_64
|
#define MY_STD_CALL __stdcall
|
||||||
typedef UInt64 CFileSize;
|
|
||||||
#else
|
#else
|
||||||
typedef UInt32 CFileSize;
|
#define MY_STD_CALL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
|
||||||
|
#if _MSC_VER >= 1300
|
||||||
|
#define MY_NO_INLINE __declspec(noinline)
|
||||||
|
#else
|
||||||
|
#define MY_NO_INLINE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define SZ_RESULT int
|
#define MY_FORCE_INLINE __forceinline
|
||||||
|
|
||||||
|
#define MY_CDECL __cdecl
|
||||||
|
#define MY_FAST_CALL __fastcall
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
#define MY_NO_INLINE
|
||||||
|
#define MY_FORCE_INLINE
|
||||||
|
#define MY_CDECL
|
||||||
|
#define MY_FAST_CALL
|
||||||
|
|
||||||
|
/* inline keyword : for C++ / C99 */
|
||||||
|
|
||||||
|
/* GCC, clang: */
|
||||||
|
/*
|
||||||
|
#if defined (__GNUC__) && (__GNUC__ >= 4)
|
||||||
|
#define MY_FORCE_INLINE __attribute__((always_inline))
|
||||||
|
#define MY_NO_INLINE __attribute__((noinline))
|
||||||
|
#endif
|
||||||
|
*/
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/* The following interfaces use first parameter as pointer to structure */
|
||||||
|
|
||||||
|
typedef struct IByteIn IByteIn;
|
||||||
|
struct IByteIn
|
||||||
|
{
|
||||||
|
Byte (*Read)(const IByteIn *p); /* reads one byte, returns 0 in case of EOF or error */
|
||||||
|
};
|
||||||
|
#define IByteIn_Read(p) (p)->Read(p)
|
||||||
|
|
||||||
|
|
||||||
|
typedef struct IByteOut IByteOut;
|
||||||
|
struct IByteOut
|
||||||
|
{
|
||||||
|
void (*Write)(const IByteOut *p, Byte b);
|
||||||
|
};
|
||||||
|
#define IByteOut_Write(p, b) (p)->Write(p, b)
|
||||||
|
|
||||||
|
|
||||||
|
typedef struct ISeqInStream ISeqInStream;
|
||||||
|
struct ISeqInStream
|
||||||
|
{
|
||||||
|
SRes (*Read)(const ISeqInStream *p, void *buf, size_t *size);
|
||||||
|
/* if (input(*size) != 0 && output(*size) == 0) means end_of_stream.
|
||||||
|
(output(*size) < input(*size)) is allowed */
|
||||||
|
};
|
||||||
|
#define ISeqInStream_Read(p, buf, size) (p)->Read(p, buf, size)
|
||||||
|
|
||||||
|
/* it can return SZ_ERROR_INPUT_EOF */
|
||||||
|
SRes SeqInStream_Read(const ISeqInStream *stream, void *buf, size_t size);
|
||||||
|
SRes SeqInStream_Read2(const ISeqInStream *stream, void *buf, size_t size, SRes errorType);
|
||||||
|
SRes SeqInStream_ReadByte(const ISeqInStream *stream, Byte *buf);
|
||||||
|
|
||||||
|
|
||||||
|
typedef struct ISeqOutStream ISeqOutStream;
|
||||||
|
struct ISeqOutStream
|
||||||
|
{
|
||||||
|
size_t (*Write)(const ISeqOutStream *p, const void *buf, size_t size);
|
||||||
|
/* Returns: result - the number of actually written bytes.
|
||||||
|
(result < size) means error */
|
||||||
|
};
|
||||||
|
#define ISeqOutStream_Write(p, buf, size) (p)->Write(p, buf, size)
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
SZ_SEEK_SET = 0,
|
||||||
|
SZ_SEEK_CUR = 1,
|
||||||
|
SZ_SEEK_END = 2
|
||||||
|
} ESzSeek;
|
||||||
|
|
||||||
#define SZ_OK (0)
|
|
||||||
#define SZE_DATA_ERROR (1)
|
|
||||||
#define SZE_OUTOFMEMORY (2)
|
|
||||||
#define SZE_CRC_ERROR (3)
|
|
||||||
|
|
||||||
#define SZE_NOTIMPL (4)
|
typedef struct ISeekInStream ISeekInStream;
|
||||||
#define SZE_FAIL (5)
|
struct ISeekInStream
|
||||||
|
{
|
||||||
|
SRes (*Read)(const ISeekInStream *p, void *buf, size_t *size); /* same as ISeqInStream::Read */
|
||||||
|
SRes (*Seek)(const ISeekInStream *p, Int64 *pos, ESzSeek origin);
|
||||||
|
};
|
||||||
|
#define ISeekInStream_Read(p, buf, size) (p)->Read(p, buf, size)
|
||||||
|
#define ISeekInStream_Seek(p, pos, origin) (p)->Seek(p, pos, origin)
|
||||||
|
|
||||||
#define SZE_ARCHIVE_ERROR (6)
|
|
||||||
|
|
||||||
#define RINOK(x) { int __result_ = (x); if(__result_ != 0) return __result_; }
|
typedef struct ILookInStream ILookInStream;
|
||||||
|
struct ILookInStream
|
||||||
|
{
|
||||||
|
SRes (*Look)(const ILookInStream *p, const void **buf, size_t *size);
|
||||||
|
/* if (input(*size) != 0 && output(*size) == 0) means end_of_stream.
|
||||||
|
(output(*size) > input(*size)) is not allowed
|
||||||
|
(output(*size) < input(*size)) is allowed */
|
||||||
|
SRes (*Skip)(const ILookInStream *p, size_t offset);
|
||||||
|
/* offset must be <= output(*size) of Look */
|
||||||
|
|
||||||
|
SRes (*Read)(const ILookInStream *p, void *buf, size_t *size);
|
||||||
|
/* reads directly (without buffer). It's same as ISeqInStream::Read */
|
||||||
|
SRes (*Seek)(const ILookInStream *p, Int64 *pos, ESzSeek origin);
|
||||||
|
};
|
||||||
|
|
||||||
|
#define ILookInStream_Look(p, buf, size) (p)->Look(p, buf, size)
|
||||||
|
#define ILookInStream_Skip(p, offset) (p)->Skip(p, offset)
|
||||||
|
#define ILookInStream_Read(p, buf, size) (p)->Read(p, buf, size)
|
||||||
|
#define ILookInStream_Seek(p, pos, origin) (p)->Seek(p, pos, origin)
|
||||||
|
|
||||||
|
|
||||||
|
SRes LookInStream_LookRead(const ILookInStream *stream, void *buf, size_t *size);
|
||||||
|
SRes LookInStream_SeekTo(const ILookInStream *stream, UInt64 offset);
|
||||||
|
|
||||||
|
/* reads via ILookInStream::Read */
|
||||||
|
SRes LookInStream_Read2(const ILookInStream *stream, void *buf, size_t size, SRes errorType);
|
||||||
|
SRes LookInStream_Read(const ILookInStream *stream, void *buf, size_t size);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
ILookInStream vt;
|
||||||
|
const ISeekInStream *realStream;
|
||||||
|
|
||||||
|
size_t pos;
|
||||||
|
size_t size; /* it's data size */
|
||||||
|
|
||||||
|
/* the following variables must be set outside */
|
||||||
|
Byte *buf;
|
||||||
|
size_t bufSize;
|
||||||
|
} CLookToRead2;
|
||||||
|
|
||||||
|
void LookToRead2_CreateVTable(CLookToRead2 *p, int lookahead);
|
||||||
|
|
||||||
|
#define LookToRead2_Init(p) { (p)->pos = (p)->size = 0; }
|
||||||
|
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
ISeqInStream vt;
|
||||||
|
const ILookInStream *realStream;
|
||||||
|
} CSecToLook;
|
||||||
|
|
||||||
|
void SecToLook_CreateVTable(CSecToLook *p);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
ISeqInStream vt;
|
||||||
|
const ILookInStream *realStream;
|
||||||
|
} CSecToRead;
|
||||||
|
|
||||||
|
void SecToRead_CreateVTable(CSecToRead *p);
|
||||||
|
|
||||||
|
|
||||||
|
typedef struct ICompressProgress ICompressProgress;
|
||||||
|
|
||||||
|
struct ICompressProgress
|
||||||
|
{
|
||||||
|
SRes (*Progress)(const ICompressProgress *p, UInt64 inSize, UInt64 outSize);
|
||||||
|
/* Returns: result. (result != SZ_OK) means break.
|
||||||
|
Value (UInt64)(Int64)-1 for size means unknown value. */
|
||||||
|
};
|
||||||
|
#define ICompressProgress_Progress(p, inSize, outSize) (p)->Progress(p, inSize, outSize)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
typedef struct ISzAlloc ISzAlloc;
|
||||||
|
typedef const ISzAlloc * ISzAllocPtr;
|
||||||
|
|
||||||
|
struct ISzAlloc
|
||||||
|
{
|
||||||
|
void *(*Alloc)(ISzAllocPtr p, size_t size);
|
||||||
|
void (*Free)(ISzAllocPtr p, void *address); /* address can be 0 */
|
||||||
|
};
|
||||||
|
|
||||||
|
#define ISzAlloc_Alloc(p, size) (p)->Alloc(p, size)
|
||||||
|
#define ISzAlloc_Free(p, a) (p)->Free(p, a)
|
||||||
|
|
||||||
|
/* deprecated */
|
||||||
|
#define IAlloc_Alloc(p, size) ISzAlloc_Alloc(p, size)
|
||||||
|
#define IAlloc_Free(p, a) ISzAlloc_Free(p, a)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef MY_offsetof
|
||||||
|
#ifdef offsetof
|
||||||
|
#define MY_offsetof(type, m) offsetof(type, m)
|
||||||
|
/*
|
||||||
|
#define MY_offsetof(type, m) FIELD_OFFSET(type, m)
|
||||||
|
*/
|
||||||
|
#else
|
||||||
|
#define MY_offsetof(type, m) ((size_t)&(((type *)0)->m))
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef MY_container_of
|
||||||
|
|
||||||
|
/*
|
||||||
|
#define MY_container_of(ptr, type, m) container_of(ptr, type, m)
|
||||||
|
#define MY_container_of(ptr, type, m) CONTAINING_RECORD(ptr, type, m)
|
||||||
|
#define MY_container_of(ptr, type, m) ((type *)((char *)(ptr) - offsetof(type, m)))
|
||||||
|
#define MY_container_of(ptr, type, m) (&((type *)0)->m == (ptr), ((type *)(((char *)(ptr)) - MY_offsetof(type, m))))
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
GCC shows warning: "perhaps the 'offsetof' macro was used incorrectly"
|
||||||
|
GCC 3.4.4 : classes with constructor
|
||||||
|
GCC 4.8.1 : classes with non-public variable members"
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define MY_container_of(ptr, type, m) ((type *)((char *)(1 ? (ptr) : &((type *)0)->m) - MY_offsetof(type, m)))
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define CONTAINER_FROM_VTBL_SIMPLE(ptr, type, m) ((type *)(ptr))
|
||||||
|
|
||||||
|
/*
|
||||||
|
#define CONTAINER_FROM_VTBL(ptr, type, m) CONTAINER_FROM_VTBL_SIMPLE(ptr, type, m)
|
||||||
|
*/
|
||||||
|
#define CONTAINER_FROM_VTBL(ptr, type, m) MY_container_of(ptr, type, m)
|
||||||
|
|
||||||
|
#define CONTAINER_FROM_VTBL_CLS(ptr, type, m) CONTAINER_FROM_VTBL_SIMPLE(ptr, type, m)
|
||||||
|
/*
|
||||||
|
#define CONTAINER_FROM_VTBL_CLS(ptr, type, m) CONTAINER_FROM_VTBL(ptr, type, m)
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
|
||||||
|
#define CHAR_PATH_SEPARATOR '\\'
|
||||||
|
#define WCHAR_PATH_SEPARATOR L'\\'
|
||||||
|
#define STRING_PATH_SEPARATOR "\\"
|
||||||
|
#define WSTRING_PATH_SEPARATOR L"\\"
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
#define CHAR_PATH_SEPARATOR '/'
|
||||||
|
#define WCHAR_PATH_SEPARATOR L'/'
|
||||||
|
#define STRING_PATH_SEPARATOR "/"
|
||||||
|
#define WSTRING_PATH_SEPARATOR L"/"
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
// activate callback support
|
EXTERN_C_END
|
||||||
//#define _LZMA_IN_CB
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue