Merge branch 'develop' into feature/opengl3
commit
a537e8c8a8
@ -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
|
@ -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
|
||||
# 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
|
||||
)
|
||||
INCLUDE(FindHelpers)
|
||||
|
||||
IF(TARGET_X64)
|
||||
SET(FMOD_LIBRARY_NAMES fmod64 fmod)
|
||||
ELSE(TARGET_X64)
|
||||
SET(FMOD_LIBRARY_NAMES fmodvc fmod)
|
||||
ENDIF(TARGET_X64)
|
||||
|
||||
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
|
||||
)
|
||||
SET(FMOD_BASE fmod64)
|
||||
ELSE()
|
||||
SET(FMOD_BASE fmodvc)
|
||||
ENDIF()
|
||||
|
||||
IF(FMOD_LIBRARY AND FMOD_INCLUDE_DIR)
|
||||
SET(FMOD_FOUND "YES")
|
||||
IF(NOT FMOD_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Found FMOD: ${FMOD_LIBRARY}")
|
||||
ENDIF(NOT FMOD_FIND_QUIETLY)
|
||||
ELSE(FMOD_LIBRARY AND FMOD_INCLUDE_DIR)
|
||||
IF(NOT FMOD_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Warning: Unable to find FMOD!")
|
||||
ENDIF(NOT FMOD_FIND_QUIETLY)
|
||||
ENDIF(FMOD_LIBRARY AND FMOD_INCLUDE_DIR)
|
||||
FIND_PACKAGE_HELPER(FMOD fmod.h RELEASE ${FMOD_BASE} DEBUG ${FMOD_BASE}d SUFFIXES fmod3)
|
||||
|
@ -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,106 +1,119 @@
|
||||
# - Find MS Visual C++
|
||||
#
|
||||
# VC_DIR - where to find Visual C++
|
||||
# VC_INCLUDE_DIR - where to find headers
|
||||
# VC_INCLUDE_DIRS - where to find headers
|
||||
# VC_LIBRARY_DIR - where to find libraries
|
||||
# VC_FOUND - True if MSVC found.
|
||||
|
||||
MACRO(DETECT_VC_VERSION_HELPER _ROOT _VERSION)
|
||||
# Software/Wow6432Node/...
|
||||
GET_FILENAME_COMPONENT(VC${_VERSION}_DIR "[${_ROOT}\\SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VC7;${_VERSION}]" ABSOLUTE)
|
||||
|
||||
IF(VC${_VERSION}_DIR AND VC${_VERSION}_DIR STREQUAL "/registry")
|
||||
SET(VC${_VERSION}_DIR)
|
||||
GET_FILENAME_COMPONENT(VC${_VERSION}_DIR "[${_ROOT}\\SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VS7;${_VERSION}]" ABSOLUTE)
|
||||
IF(VC${_VERSION}_DIR AND NOT VC${_VERSION}_DIR STREQUAL "/registry")
|
||||
SET(VC${_VERSION}_DIR "${VC${_VERSION}_DIR}VC/")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
# VC_FOUND - True if MSVC found
|
||||
|
||||
IF(CMAKE_CXX_COMPILER)
|
||||
SET(_COMPILER ${CMAKE_CXX_COMPILER})
|
||||
SET(_VERSION ${CMAKE_CXX_COMPILER_VERSION})
|
||||
ELSEIF(CMAKE_C_COMPILER)
|
||||
SET(_COMPILER ${CMAKE_C_COMPILER})
|
||||
SET(_VERSION ${CMAKE_C_COMPILER_VERSION})
|
||||
ELSE()
|
||||
MESSAGE(FATAL_ERROR "No way to determine Visual C++ location")
|
||||
ENDIF()
|
||||
|
||||
IF(VC${_VERSION}_DIR AND NOT VC${_VERSION}_DIR STREQUAL "/registry")
|
||||
SET(VC${_VERSION}_FOUND ON)
|
||||
DETECT_EXPRESS_VERSION(${_VERSION})
|
||||
IF(NOT MSVC_FIND_QUIETLY)
|
||||
SET(_VERSION_STR ${_VERSION})
|
||||
IF(MSVC_EXPRESS)
|
||||
SET(_VERSION_STR "${_VERSION_STR} Express")
|
||||
ENDIF()
|
||||
MESSAGE(STATUS "Found Visual C++ ${_VERSION_STR} in ${VC${_VERSION}_DIR}")
|
||||
ENDIF()
|
||||
ELSEIF(VC${_VERSION}_DIR AND NOT VC${_VERSION}_DIR STREQUAL "/registry")
|
||||
SET(VC${_VERSION}_FOUND OFF)
|
||||
SET(VC${_VERSION}_DIR "")
|
||||
IF(MSVC_VERSION LESS 1910)
|
||||
IF(MSVC_VERSION LESS 1500)
|
||||
MESSAGE(FATAL_ERROR "Unsupported version of Visual C++ (minimum version is 2008)")
|
||||
ELSEIF(MSVC_VERSION LESS 1600)
|
||||
SET(MSVC_TOOLSET "90")
|
||||
SET(_NAME "2008")
|
||||
ELSEIF(MSVC_VERSION LESS 1700)
|
||||
SET(MSVC_TOOLSET "100")
|
||||
SET(_NAME "2010")
|
||||
ELSEIF(MSVC_VERSION LESS 1800)
|
||||
SET(MSVC_TOOLSET "110")
|
||||
SET(_NAME "2012")
|
||||
ELSEIF(MSVC_VERSION LESS 1900)
|
||||
SET(MSVC_TOOLSET "120")
|
||||
SET(_NAME "2013")
|
||||
ELSE()
|
||||
SET(MSVC_TOOLSET "140")
|
||||
SET(_NAME "2015")
|
||||
ENDIF()
|
||||
ENDMACRO()
|
||||
|
||||
MACRO(DETECT_VC_VERSION _VERSION)
|
||||
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)
|
||||
DETECT_VC_VERSION_HELPER("HKEY_LOCAL_MACHINE" ${_VERSION})
|
||||
ENDIF()
|
||||
MESSAGE(STATUS "Found Visual C++ ${_NAME} (${_VERSION}) in ${VC_DIR}")
|
||||
ELSE()
|
||||
# Toolset = version of runtime DLLs
|
||||
SET(MSVC_TOOLSET "140")
|
||||
|
||||
IF(VC${_VERSION}_FOUND)
|
||||
SET(VC_FOUND ON)
|
||||
SET(VC_DIR "${VC${_VERSION}_DIR}")
|
||||
IF(MSVC_VERSION LESS 1920)
|
||||
SET(_NAME "2017")
|
||||
ELSE()
|
||||
SET(_NAME "2019")
|
||||
ENDIF()
|
||||
ENDMACRO()
|
||||
|
||||
MACRO(DETECT_EXPRESS_VERSION _VERSION)
|
||||
GET_FILENAME_COMPONENT(MSVC_EXPRESS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\${_VERSION}\\Setup\\VC;ProductDir]" ABSOLUTE)
|
||||
STRING(REGEX REPLACE "/MSVC/.+" "/MSVC" VC_DIR ${_COMPILER})
|
||||
|
||||
FILE(GLOB MSVC_TOOLCHAIN_VERSIONS RELATIVE ${VC_DIR} "${VC_DIR}/*")
|
||||
|
||||
IF(MSVC_EXPRESS AND NOT MSVC_EXPRESS STREQUAL "/registry")
|
||||
SET(MSVC_EXPRESS ON)
|
||||
IF(MSVC_TOOLCHAIN_VERSIONS)
|
||||
LIST(SORT MSVC_TOOLCHAIN_VERSIONS)
|
||||
LIST(REVERSE MSVC_TOOLCHAIN_VERSIONS)
|
||||
ENDIF()
|
||||
ENDMACRO()
|
||||
|
||||
IF(MSVC12)
|
||||
DETECT_VC_VERSION("12.0")
|
||||
SET(MSVC_TOOLSET "120")
|
||||
IF(MSVC_TOOLCHAIN_VERSIONS)
|
||||
LIST(GET MSVC_TOOLCHAIN_VERSIONS 0 MSVC_TOOLCHAIN_VERSION)
|
||||
|
||||
IF(NOT MSVC12_REDIST_DIR)
|
||||
# If you have VC++ 2013 Express, put x64/Microsoft.VC120.CRT/*.dll in ${EXTERNAL_PATH}/redist
|
||||
SET(MSVC12_REDIST_DIR "${EXTERNAL_PATH}/redist")
|
||||
ENDIF()
|
||||
ELSEIF(MSVC11)
|
||||
DETECT_VC_VERSION("11.0")
|
||||
SET(MSVC_TOOLSET "110")
|
||||
SET(VC_DIR "${VC_DIR}/${MSVC_TOOLCHAIN_VERSION}")
|
||||
|
||||
IF(NOT MSVC11_REDIST_DIR)
|
||||
# If you have VC++ 2012 Express, put x64/Microsoft.VC110.CRT/*.dll in ${EXTERNAL_PATH}/redist
|
||||
SET(MSVC11_REDIST_DIR "${EXTERNAL_PATH}/redist")
|
||||
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()
|
||||
ELSEIF(MSVC10)
|
||||
DETECT_VC_VERSION("10.0")
|
||||
SET(MSVC_TOOLSET "100")
|
||||
ENDIF()
|
||||
|
||||
IF(NOT MSVC10_REDIST_DIR)
|
||||
# If you have VC++ 2010 Express, put x64/Microsoft.VC100.CRT/*.dll in ${EXTERNAL_PATH}/redist
|
||||
SET(MSVC10_REDIST_DIR "${EXTERNAL_PATH}/redist")
|
||||
IF(NOT VC_INCLUDE_DIR AND VC_DIR AND EXISTS "${VC_DIR}")
|
||||
SET(VC_INCLUDE_DIR "${VC_DIR}/include")
|
||||
IF(EXISTS "${VC_INCLUDE_DIR}")
|
||||
SET(VC_FOUND ON)
|
||||
ENDIF()
|
||||
ELSEIF(MSVC90)
|
||||
DETECT_VC_VERSION("9.0")
|
||||
SET(MSVC_TOOLSET "90")
|
||||
ELSEIF(MSVC80)
|
||||
DETECT_VC_VERSION("8.0")
|
||||
SET(MSVC_TOOLSET "80")
|
||||
ENDIF()
|
||||
|
||||
# If you plan to use VC++ compilers with WINE, set VC_DIR environment variable
|
||||
IF(NOT VC_DIR)
|
||||
SET(VC_DIR $ENV{VC_DIR})
|
||||
SET(MSVC_REDIST_DIR "${EXTERNAL_PATH}/redist")
|
||||
|
||||
IF(NOT EXISTS "${MSVC_REDIST_DIR}")
|
||||
SET(MSVC_REDIST_DIR "${VC_DIR}/redist")
|
||||
|
||||
IF(NOT EXISTS "${MSVC_REDIST_DIR}")
|
||||
SET(MSVC_REDIST_DIR)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
IF(NOT VC_DIR)
|
||||
IF(CMAKE_CXX_COMPILER)
|
||||
SET(_COMPILER ${CMAKE_CXX_COMPILER})
|
||||
ELSE()
|
||||
SET(_COMPILER ${CMAKE_C_COMPILER})
|
||||
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
|
||||
SET(MSVC12_REDIST_DIR "${MSVC_REDIST_DIR}")
|
||||
ELSEIF(MSVC11)
|
||||
# If you have VC++ 2012 Express, put x64/Microsoft.VC110.CRT/*.dll in ${EXTERNAL_PATH}/redist
|
||||
SET(MSVC11_REDIST_DIR "${MSVC_REDIST_DIR}")
|
||||
ELSEIF(MSVC10)
|
||||
# If you have VC++ 2010 Express, put x64/Microsoft.VC100.CRT/*.dll in ${EXTERNAL_PATH}/redist
|
||||
SET(MSVC10_REDIST_DIR "${MSVC_REDIST_DIR}")
|
||||
ELSEIF(MSVC90)
|
||||
SET(MSVC90_REDIST_DIR "${MSVC_REDIST_DIR}")
|
||||
ELSEIF(MSVC80)
|
||||
SET(MSVC80_REDIST_DIR "${MSVC_REDIST_DIR}")
|
||||
ENDIF()
|
||||
STRING(REGEX REPLACE "/bin/.+" "" VC_DIR ${_COMPILER})
|
||||
ENDIF()
|
||||
|
||||
SET(VC_INCLUDE_DIR "${VC_DIR}/include")
|
||||
IF(VC_INCLUDE_DIR)
|
||||
MESSAGE(STATUS "Using VC++ headers from ${VC_INCLUDE_DIR}")
|
||||
ELSE()
|
||||
MESSAGE(FATAL_ERROR "Unable to find VC++ headers")
|
||||
ENDIF()
|
||||
|
||||
SET(VC_INCLUDE_DIRS ${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
|
||||
# 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.
|
||||
INCLUDE(FindHelpers)
|
||||
|
||||
IF(OGG_LIBRARY AND OGG_INCLUDE_DIR)
|
||||
# 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)
|
||||
FIND_PACKAGE_HELPER(Ogg ogg/ogg.h)
|
||||
|
@ -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.
|
||||
#
|
||||
# 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.
|
||||
INCLUDE(FindHelpers)
|
||||
|
||||
# also defined, but not for general use are
|
||||
IF(STLPORT_LIBRARIES AND STLPORT_INCLUDE_DIR)
|
||||
# in cache already
|
||||
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)
|
||||
FIND_PACKAGE_HELPER(STLport iostream
|
||||
RELEASE stlport_cygwin stlport_gcc stlport_x stlport_x.5.2 stlport_statix stlport_static
|
||||
DEBUG stlport_cygwin_debug stlport_cygwin_stldebug stlport_gcc_debug stlport_gcc_stldebug stlportstld_x stlportstld_x.5.2 stlportd_statix stlportd_static)
|
||||
|
@ -1,83 +1,14 @@
|
||||
#
|
||||
# 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.
|
||||
INCLUDE(FindHelpers)
|
||||
|
||||
# also defined, but not for general use are
|
||||
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)
|
||||
FIND_PACKAGE_HELPER(Squish squish.h)
|
||||
|
||||
IF(SQUISH_FOUND)
|
||||
IF(NOT SQUISH_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Found Squish: ${SQUISH_LIBRARIES}")
|
||||
ENDIF(NOT SQUISH_FIND_QUIETLY)
|
||||
ENDIF()
|
||||
FILE(STRINGS ${SQUISH_INCLUDE_DIR}/squish.h METRIC REGEX "metric = 0")
|
||||
IF(METRIC)
|
||||
SET(SQUISH_COMPRESS_HAS_METRIC ON)
|
||||
SET(SQUISH_DEFINITIONS -DSQUISH_COMPRESS_HAS_METRIC)
|
||||
ENDIF(METRIC)
|
||||
ELSE(SQUISH_FOUND)
|
||||
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)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
@ -0,0 +1,74 @@
|
||||
# - Locate Steam API
|
||||
# This module defines
|
||||
# STEAM_LIBRARY, the library to link against
|
||||
# STEAM_FOUND, if false, do not try to link to STEAM
|
||||
# STEAM_INCLUDE_DIR, where to find headers.
|
||||
|
||||
IF(STEAM_LIBRARY AND STEAM_INCLUDE_DIR)
|
||||
# in cache already
|
||||
SET(Steam_FIND_QUIETLY TRUE)
|
||||
ENDIF()
|
||||
|
||||
|
||||
FIND_PATH(STEAM_INCLUDE_DIR
|
||||
steam_api.h
|
||||
PATH_SUFFIXES steam
|
||||
PATHS
|
||||
$ENV{STEAM_DIR}/public
|
||||
)
|
||||
|
||||
IF(WIN32)
|
||||
IF(TARGET_X64)
|
||||
SET(STEAM_LIBNAME steam_api64)
|
||||
SET(STEAM_RUNTIMENAME steam_api64.dll)
|
||||
SET(STEAM_PATHNAME redistributable_bin/win64)
|
||||
ELSE()
|
||||
SET(STEAM_LIBNAME steam_api)
|
||||
SET(STEAM_RUNTIMENAME steam_api.dll)
|
||||
SET(STEAM_PATHNAME redistributable_bin)
|
||||
ENDIF()
|
||||
ELSEIF(APPLE)
|
||||
# universal binary
|
||||
SET(STEAM_LIBNAME steam_api)
|
||||
SET(STEAM_RUNTIMENAME libsteam_api.dylib)
|
||||
SET(STEAM_PATHNAME redistributable_bin/osx32)
|
||||
ELSE()
|
||||
SET(STEAM_LIBNAME steam_api)
|
||||
SET(STEAM_RUNTIMENAME libsteam_api.so)
|
||||
IF(TARGET_X64)
|
||||
SET(STEAM_PATHNAME redistributable_bin/linux64)
|
||||
ELSE()
|
||||
SET(STEAM_PATHNAME redistributable_bin/linux32)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
FIND_LIBRARY(STEAM_LIBRARY
|
||||
NAMES ${STEAM_LIBNAME}
|
||||
HINTS
|
||||
$ENV{STEAM_DIR}/${STEAM_PATHNAME}
|
||||
)
|
||||
|
||||
FIND_FILE(STEAM_RUNTIME
|
||||
NAMES ${STEAM_RUNTIMENAME}
|
||||
HINTS
|
||||
$ENV{STEAM_DIR}/${STEAM_PATHNAME}
|
||||
PATHS
|
||||
${EXTERNAL_BINARY_PATH}
|
||||
${CMAKE_LIBRARY_PATH}
|
||||
/usr/local/lib
|
||||
/usr/lib
|
||||
)
|
||||
|
||||
# Don't need to check STEAM_LIBRARY because we're dynamically loading Steam DLL
|
||||
IF(STEAM_INCLUDE_DIR)
|
||||
SET(STEAM_FOUND ON)
|
||||
SET(STEAM_LIBRARIES ${STEAM_LIBRARY})
|
||||
SET(STEAM_INCLUDE_DIRS ${STEAM_INCLUDE_DIR})
|
||||
IF(NOT Steam_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Found Steam: ${STEAM_INCLUDE_DIR} and ${STEAM_RUNTIME}")
|
||||
ENDIF()
|
||||
ELSE()
|
||||
IF(NOT Steam_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Warning: Unable to find Steam!")
|
||||
ENDIF()
|
||||
ENDIF()
|
@ -1,65 +1,8 @@
|
||||
# - Locate Vorbis library
|
||||
# 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.
|
||||
INCLUDE(FindHelpers)
|
||||
|
||||
IF(VORBIS_LIBRARY AND VORBIS_INCLUDE_DIR)
|
||||
# in cache already
|
||||
SET(VORBIS_FIND_QUIETLY TRUE)
|
||||
ENDIF(VORBIS_LIBRARY AND VORBIS_INCLUDE_DIR)
|
||||
FIND_PACKAGE_HELPER(Vorbis vorbisenc.h)
|
||||
FIND_PACKAGE_HELPER(VorbisFile vorbisfile.h SUFFIXES vorbis)
|
||||
|
||||
|
||||
FIND_PATH(VORBIS_INCLUDE_DIR
|
||||
vorbis/vorbisfile.h
|
||||
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)
|
||||
IF(VORBISFILE_FOUND)
|
||||
SET(VORBIS_LIBRARIES ${VORBIS_LIBRARIES} ${VORBISFILE_LIBRARIES})
|
||||
ENDIF()
|
||||
|
@ -1,29 +1,63 @@
|
||||
IF(assimp_FIND_REQUIRED)
|
||||
SET(ASSIMP_FIND_REQUIRED ON)
|
||||
ENDIF()
|
||||
|
||||
FIND_PATH(
|
||||
assimp_INCLUDE_DIRS
|
||||
ASSIMP_INCLUDE_DIRS
|
||||
NAMES assimp/postprocess.h assimp/scene.h assimp/version.h assimp/config.h assimp/cimport.h
|
||||
PATHS /usr/local/include/
|
||||
)
|
||||
|
||||
FIND_LIBRARY(
|
||||
assimp_LIBRARIES
|
||||
ASSIMP_LIBRARY_RELEASE
|
||||
NAMES assimp
|
||||
PATHS /usr/local/lib/
|
||||
)
|
||||
|
||||
IF (assimp_INCLUDE_DIRS AND assimp_LIBRARIES)
|
||||
SET(assimp_FOUND TRUE)
|
||||
FIND_LIBRARY(
|
||||
IRRXML_LIBRARY_RELEASE
|
||||
NAMES IrrXML
|
||||
PATHS /usr/local/lib/
|
||||
)
|
||||
|
||||
FIND_LIBRARY(
|
||||
ASSIMP_LIBRARY_DEBUG
|
||||
NAMES assimpd
|
||||
PATHS /usr/local/lib/
|
||||
)
|
||||
|
||||
FIND_LIBRARY(
|
||||
IRRXML_LIBRARY_DEBUG
|
||||
NAMES IrrXMLd
|
||||
PATHS /usr/local/lib/
|
||||
)
|
||||
|
||||
IF (ASSIMP_INCLUDE_DIRS)
|
||||
SET(ASSIMP_FOUND TRUE)
|
||||
IF(ASSIMP_LIBRARY_RELEASE)
|
||||
SET(ASSIMP_LIBRARIES ${ASSIMP_LIBRARIES} optimized ${ASSIMP_LIBRARY_RELEASE})
|
||||
ENDIF()
|
||||
IF(ASSIMP_LIBRARY_DEBUG)
|
||||
SET(ASSIMP_LIBRARIES ${ASSIMP_LIBRARIES} debug ${ASSIMP_LIBRARY_DEBUG})
|
||||
ENDIF()
|
||||
FIND_PACKAGE(ZLIB)
|
||||
IF(ZLIB_FOUND)
|
||||
SET(assimp_LIBRARIES ${assimp_LIBRARIES} ${ZLIB_LIBRARIES})
|
||||
SET(ASSIMP_LIBRARIES ${ASSIMP_LIBRARIES} ${ZLIB_LIBRARIES})
|
||||
ENDIF()
|
||||
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 (assimp_INCLUDE_DIRS AND assimp_LIBRARIES)
|
||||
ENDIF()
|
||||
|
||||
IF (assimp_FOUND)
|
||||
IF (NOT assimp_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Found asset importer library: ${assimp_LIBRARIES}")
|
||||
ENDIF (NOT assimp_FIND_QUIETLY)
|
||||
ELSE (assimp_FOUND)
|
||||
IF (assimp_FIND_REQUIRED)
|
||||
IF (ASSIMP_FOUND)
|
||||
IF (NOT ASSIMP_FIND_QUIETLY)
|
||||
MESSAGE(STATUS "Found asset importer library: ${ASSIMP_LIBRARIES}")
|
||||
ENDIF ()
|
||||
ELSE (ASSIMP_FOUND)
|
||||
IF (ASSIMP_FIND_REQUIRED)
|
||||
MESSAGE(FATAL_ERROR "Could not find asset importer library")
|
||||
ENDIF (assimp_FIND_REQUIRED)
|
||||
ENDIF (assimp_FOUND)
|
||||
ENDIF ()
|
||||
ENDIF ()
|
||||
|
@ -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
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue