2013-12-04 10:05:00 +00:00
|
|
|
include(ExternalProject)
|
|
|
|
include(CheckIncludeFile)
|
|
|
|
|
2014-10-07 15:40:35 +00:00
|
|
|
set(LIBS_BINARYDIR_DIR ${PROJECT_BINARY_DIR}/libs)
|
2017-11-20 17:24:16 +00:00
|
|
|
set(LIBS_DOWNLOAD_DIR ${PROJECT_BINARY_DIR}/downloads)
|
|
|
|
|
2019-11-02 21:23:33 +00:00
|
|
|
# note/FIXME/clarify:
|
2019-03-03 13:33:03 +00:00
|
|
|
# when features are disabled this script is still
|
|
|
|
# adding the related targets? F.e. LUA_FEATURE is Off and BUNDLED_LUA On
|
|
|
|
# see usage of BUNDLED_LUA below (BUNDLED_OPENSSL, BUNDLED OPENAL ...)
|
2017-11-20 17:24:16 +00:00
|
|
|
|
2019-03-03 13:33:03 +00:00
|
|
|
#CMAKE_DEBUG_POSTFIX
|
2017-11-20 17:24:16 +00:00
|
|
|
|
2019-10-20 19:38:58 +00:00
|
|
|
# Force the BUNDLED_<name> to OFF if the FEATURE_<name> is OFF. No more unwanted stuff being built.
|
|
|
|
get_cmake_property(_variableNames VARIABLES)
|
|
|
|
list (SORT _variableNames)
|
|
|
|
foreach (_variableName ${_variableNames})
|
|
|
|
string(REGEX MATCH "^FEATURE_.*" _featureName "${_variableName}")
|
|
|
|
string(LENGTH "${_featureName}" _variableLen)
|
|
|
|
# message(STATUS "${_variableName}=${${_variableName}}")
|
|
|
|
if(${_variableLen})
|
|
|
|
if(NOT (${_variableName}))
|
|
|
|
string(FIND ${_variableName} "_" wsloc)
|
|
|
|
string(SUBSTRING ${_variableName} ${wsloc} -1 _featureName)
|
|
|
|
string(PREPEND _featureName "BUNDLED")
|
|
|
|
if((${_featureName}))
|
|
|
|
set(${_featureName} OFF)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
endforeach()
|
|
|
|
|
2019-03-03 13:33:03 +00:00
|
|
|
if(WIN32)
|
|
|
|
|
|
|
|
# moved for now until linux BUNDLED_OPENSSL is done
|
|
|
|
if(BUNDLED_OPENSSL)
|
|
|
|
find_program(NASM_EXECUTABLE nasm)
|
|
|
|
if(NOT NASM_EXECUTABLE)
|
|
|
|
message(FATAL_ERROR "NASM not found")
|
|
|
|
endif()
|
2019-11-02 21:23:33 +00:00
|
|
|
|
2019-03-03 13:33:03 +00:00
|
|
|
# FIXME: there is no findPerl cmake script in project?! (at least for *NIX)
|
|
|
|
FIND_PACKAGE(perl REQUIRED)
|
|
|
|
if(NOT PERL_FOUND)
|
|
|
|
message(FATAL_ERROR "Perl not found")
|
|
|
|
endif()
|
2019-11-02 21:23:33 +00:00
|
|
|
|
2019-03-03 13:33:03 +00:00
|
|
|
if(WIN32)
|
|
|
|
if(64BITS)
|
|
|
|
set(openssl_plat VC-WIN64)
|
|
|
|
# set(curl_plat x64)
|
|
|
|
else()
|
|
|
|
set(openssl_plat VC-WIN32)
|
|
|
|
# set(curl_plat x86)
|
|
|
|
endif()
|
2017-11-20 17:24:16 +00:00
|
|
|
endif()
|
|
|
|
endif()
|
2014-10-07 15:40:35 +00:00
|
|
|
|
2012-11-03 18:04:41 +00:00
|
|
|
#-----------------------------------------------------------------
|
|
|
|
# Build bundled JPEG library
|
|
|
|
#-----------------------------------------------------------------
|
2016-09-13 12:01:38 +00:00
|
|
|
if(BUNDLED_JPEG AND BUILD_CLIENT) # static
|
2016-01-04 19:37:10 +00:00
|
|
|
check_include_file(stddef.h HAVE_STDDEF_H)
|
|
|
|
check_include_file(stdlib.h HAVE_STDLIB_H)
|
2014-11-21 20:54:30 +00:00
|
|
|
|
2014-11-24 11:42:22 +00:00
|
|
|
set(JPEG_LIB "${CMAKE_CURRENT_LIST_DIR}/jpegturbo")
|
2013-12-03 22:24:15 +00:00
|
|
|
|
2019-12-22 21:45:00 +00:00
|
|
|
set(binary_dir "${LIBS_BINARYDIR_DIR}/jpegturbo")
|
|
|
|
if(VSTUDIO)
|
|
|
|
set(JPEG_BUNDLED_LIBRARIES optimized "${binary_dir}/Release/libturbojpeg${CMAKE_STATIC_LIBRARY_SUFFIX}" debug "${binary_dir}/Debug/libturbojpeg${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
|
|
|
elseif(VS_BUILD_BUILD)
|
|
|
|
set(JPEG_BUNDLED_LIBRARIES "${binary_dir}/libturbojpeg${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
|
|
|
else()
|
|
|
|
set(JPEG_BUNDLED_LIBRARIES "${binary_dir}/libturbojpeg${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
2013-12-03 22:24:15 +00:00
|
|
|
endif()
|
2014-11-21 20:54:30 +00:00
|
|
|
|
2015-01-24 20:54:15 +00:00
|
|
|
configure_file (${JPEG_LIB}/jconfig.h.cmake ${JPEG_LIB}/jconfig.h)
|
|
|
|
configure_file (${JPEG_LIB}/jconfigint.h.cmake ${JPEG_LIB}/jconfigint.h)
|
2013-12-03 22:24:15 +00:00
|
|
|
|
2019-12-22 21:45:00 +00:00
|
|
|
ExternalProject_Add(bundled_jpeg
|
|
|
|
SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/jpegturbo
|
|
|
|
BINARY_DIR ${LIBS_BINARYDIR_DIR}/jpegturbo
|
|
|
|
CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
|
|
|
|
-DCMAKE_CXX_FLAGS_DEBUG=${CMAKE_CXX_FLAGS_DEBUG} -DCMAKE_CXX_FLAGS_RELEASE=${CMAKE_CXX_FLAGS_RELEASE}
|
|
|
|
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} -DENABLE_SHARED=OFF -DENABLE_STATIC=ON -DREQUIRE_SIMD=OFF -DWITH_12BIT=OFF
|
|
|
|
-DWITH_ARITH_DEC=ON -DWITH_ARITH_ENC=ON -DWITH_JAVA=OFF -DWITH_JPEG7=OFF -DWITH_JPEG8=ON
|
|
|
|
-DWITH_MEM_SRCDST=ON -DWITH_SIMD=OFF -DWITH_TURBOJPEG=ON
|
|
|
|
INSTALL_COMMAND ""
|
2013-08-19 22:29:33 +00:00
|
|
|
)
|
2013-12-03 22:24:15 +00:00
|
|
|
|
2019-12-22 21:45:00 +00:00
|
|
|
#ExternalProject_Get_Property(bundled_jpeg binary_dir)
|
2013-08-11 00:10:17 +00:00
|
|
|
|
2014-11-24 11:42:22 +00:00
|
|
|
set(JPEG_BUNDLED_INCLUDE_DIR "${CMAKE_CURRENT_LIST_DIR}/jpegturbo")
|
2016-09-29 13:28:25 +00:00
|
|
|
set_target_properties(bundled_jpeg PROPERTIES FOLDER ${BUNDLED_TARGETS_FOLDER})
|
2016-09-13 12:01:38 +00:00
|
|
|
endif()
|
2012-06-19 11:08:53 +00:00
|
|
|
|
2019-03-03 11:53:49 +00:00
|
|
|
if(BUNDLED_OPENSSL AND (BUILD_CLIENT OR BUILD_SERVER))
|
|
|
|
set(OPENSSL_PREFIX "${CMAKE_BINARY_DIR}/openssl/build")
|
|
|
|
set(OPENSSL_CONFIGURE "${PERL_EXECUTABLE}" Configure "${openssl_plat}" "--prefix=${OPENSSL_PREFIX}" "--openssldir=${OPENSSL_PREFIX}" no-shared no-unit-test -static)
|
|
|
|
set(OPENSSL_BUILD nmake)
|
|
|
|
set(OPENSSL_INSTALL nmake install)
|
2019-10-20 18:31:38 +00:00
|
|
|
set(OPENSSL_BUNDLED_LIBRARY "${OPENSSL_PREFIX}/lib/libcrypto.lib" "${OPENSSL_PREFIX}/lib/libssl.lib")
|
2019-03-03 11:53:49 +00:00
|
|
|
ExternalProject_Add(bundled_openssl
|
|
|
|
# Use github archive instead of the one hosted on openssl.org because of CMake bug #13251
|
|
|
|
#URL_MD5 "9e380f6f9cc497bd2f47c944019239ac"
|
|
|
|
#GIT_REPOSITORY "https://github.com/openssl/openssl.git"
|
|
|
|
DOWNLOAD_DIR ${LIBS_DOWNLOAD_DIR}/openssl
|
2019-12-19 16:23:54 +00:00
|
|
|
URL https://github.com/openssl/openssl/archive/OpenSSL_1_1_1d.tar.gz
|
2019-03-03 11:53:49 +00:00
|
|
|
SOURCE_DIR "${CMAKE_BINARY_DIR}/openssl"
|
|
|
|
BUILD_IN_SOURCE 1
|
|
|
|
CONFIGURE_COMMAND ${OPENSSL_CONFIGURE}
|
|
|
|
BUILD_COMMAND ${OPENSSL_BUILD}
|
|
|
|
INSTALL_COMMAND ${OPENSSL_INSTALL}
|
2019-10-20 18:31:38 +00:00
|
|
|
BUILD_BYPRODUCTS ${OPENSSL_BUNDLED_LIBRARY}
|
2019-03-03 11:53:49 +00:00
|
|
|
)
|
|
|
|
set(OPENSSL_BUNDLED_INCLUDE_DIR "${OPENSSL_PREFIX}/include")
|
|
|
|
set_target_properties(bundled_openssl PROPERTIES FOLDER ${BUNDLED_TARGETS_FOLDER})
|
|
|
|
else()
|
|
|
|
add_custom_target(bundled_openssl)
|
|
|
|
set_target_properties(bundled_openssl PROPERTIES FOLDER ${BUNDLED_TARGETS_FOLDER})
|
2017-11-20 17:24:16 +00:00
|
|
|
endif()
|
|
|
|
|
2012-11-03 18:04:41 +00:00
|
|
|
#-----------------------------------------------------------------
|
|
|
|
# Build bundled cURL library
|
|
|
|
#-----------------------------------------------------------------
|
2016-09-13 12:01:38 +00:00
|
|
|
if(BUNDLED_CURL AND (BUILD_CLIENT OR BUILD_SERVER)) # DLL
|
2019-10-20 18:31:38 +00:00
|
|
|
set(binary_dir "${LIBS_BINARYDIR_DIR}/curl")
|
|
|
|
if(VSTUDIO)
|
|
|
|
set(CURL_BUNDLED_LIBRARY optimized "${binary_dir}/lib/Release/libcurl${CMAKE_STATIC_LIBRARY_SUFFIX}" debug "${binary_dir}/lib/Debug/libcurl-d${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
|
|
|
elseif(MINGW OR VS_BUILD)
|
|
|
|
set(CURL_BUNDLED_LIBRARY optimized "${binary_dir}/lib/libcurl${CMAKE_STATIC_LIBRARY_SUFFIX}" debug "${binary_dir}/lib/libcurl-d${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
|
|
|
else(VSTUDIO)
|
|
|
|
set(CURL_BUNDLED_LIBRARY "${binary_dir}/libcurl${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
|
|
|
endif(VSTUDIO)
|
2019-11-02 21:23:33 +00:00
|
|
|
|
2017-11-20 17:24:16 +00:00
|
|
|
# -DHTTP_ONLY=1
|
2013-12-03 22:24:15 +00:00
|
|
|
ExternalProject_Add(bundled_curl
|
2017-11-20 17:24:16 +00:00
|
|
|
DEPENDS bundled_openssl
|
2014-10-07 15:40:35 +00:00
|
|
|
SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/curl
|
2019-10-20 18:31:38 +00:00
|
|
|
BINARY_DIR ${binary_dir}
|
|
|
|
BUILD_BYPRODUCTS ${CURL_BUNDLED_LIBRARY}
|
2017-11-20 17:24:16 +00:00
|
|
|
CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
|
|
|
|
-DCMAKE_CXX_FLAGS_DEBUG=${CMAKE_CXX_FLAGS_DEBUG} -DCMAKE_CXX_FLAGS_RELEASE=${CMAKE_CXX_FLAGS_RELEASE}
|
2019-01-03 17:47:51 +00:00
|
|
|
-DBUILD_CURL_EXE=0 -DBUILD_SHARED_LIBS=0 -DENABLE_ARES=0 -DENABLE_THREADED_RESOLVER=1 -DENABLE_DEBUG=0
|
2017-11-20 17:24:16 +00:00
|
|
|
-DENABLE_CURLDEBUG=0 -DBUILD_TESTING=0 -DENABLE_IPV6=1 -DENABLE_MANUAL=0 -DCMAKE_USE_LIBSSH2=0
|
|
|
|
-DUSE_NGHTTP2=0 -DCURL_WINDOWS_SSPI=0 -DCURL_ZLIB=1 -DCMAKE_USE_GSSAPI=0
|
|
|
|
-DCURL_DISABLE_LDAP=1 -DCURL_DISABLE_LDAPS=1 -DCURL_DISABLE_TELNET=1 -DCURL_DISABLE_DICT=1
|
|
|
|
-DCURL_DISABLE_FILE=1 -DCURL_DISABLE_TFTP=1 -DCURL_DISABLE_RTSP=1 -DCURL_DISABLE_POP3=1 -DCURL_DISABLE_IMAP=1
|
|
|
|
-DCURL_DISABLE_SMTP=1 -DCURL_DISABLE_GOPHER=1
|
|
|
|
-DOPENSSL_ROOT_DIR=${OPENSSL_PREFIX} -DCMAKE_USE_OPENSSL=${FEATURE_OPENSSL}
|
|
|
|
-DENABLE_UNIX_SOCKETS=1 -DCMAKE_INSTALL_PREFIX=${PROJECT_BINARY_DIR}/curl
|
2013-12-31 10:29:38 +00:00
|
|
|
INSTALL_COMMAND ""
|
2013-08-19 22:29:33 +00:00
|
|
|
)
|
2013-12-03 22:24:15 +00:00
|
|
|
|
2014-10-07 15:40:35 +00:00
|
|
|
set(CURL_BUNDLED_INCLUDE_DIR "${CMAKE_CURRENT_LIST_DIR}/curl/include")
|
2016-09-29 13:28:25 +00:00
|
|
|
|
|
|
|
set_target_properties(bundled_curl PROPERTIES FOLDER ${BUNDLED_TARGETS_FOLDER})
|
2016-09-13 12:01:38 +00:00
|
|
|
endif()
|
2012-06-19 11:08:53 +00:00
|
|
|
|
2012-11-17 21:59:27 +00:00
|
|
|
#-----------------------------------------------------------------
|
2014-11-21 20:54:30 +00:00
|
|
|
# Build bundled Lua library
|
2012-11-17 21:59:27 +00:00
|
|
|
#-----------------------------------------------------------------
|
2017-02-03 21:05:55 +00:00
|
|
|
if(BUNDLED_LUA AND BUILD_MOD)
|
2014-10-07 15:40:35 +00:00
|
|
|
set(LUA_LIB "${CMAKE_CURRENT_LIST_DIR}/lua/src")
|
2013-12-03 22:24:15 +00:00
|
|
|
FILE(GLOB LUA_LIB_SRC
|
2018-02-28 08:18:05 +00:00
|
|
|
${LUA_LIB}/*.c
|
2013-12-03 22:24:15 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
FILE(GLOB LUA_LIB_HEADERS
|
|
|
|
${LUA_LIB}/*.h
|
|
|
|
)
|
|
|
|
|
2014-10-07 15:40:35 +00:00
|
|
|
add_library(bundled_lua STATIC ${LUA_LIB_SRC} ${LUA_LIB_HEADERS})
|
2014-10-20 08:50:09 +00:00
|
|
|
|
2016-09-29 13:28:25 +00:00
|
|
|
set_target_properties(bundled_lua PROPERTIES FOLDER ${BUNDLED_TARGETS_FOLDER})
|
2014-10-07 15:40:35 +00:00
|
|
|
set(LUA_BUNDLED_LIBRARIES bundled_lua)
|
|
|
|
set(LUA_BUNDLED_INCLUDE_DIR "${CMAKE_CURRENT_LIST_DIR}/lua/src")
|
2016-09-13 12:01:38 +00:00
|
|
|
endif()
|
2012-11-17 21:59:27 +00:00
|
|
|
|
2013-01-24 15:44:19 +00:00
|
|
|
#-----------------------------------------------------------------
|
|
|
|
# Build bundled OGG and Vorbis file library
|
|
|
|
#-----------------------------------------------------------------
|
2016-09-13 12:01:38 +00:00
|
|
|
if(BUNDLED_OGG_VORBIS AND BUILD_CLIENT)
|
2013-01-24 16:29:42 +00:00
|
|
|
# OGG
|
2014-10-07 15:40:35 +00:00
|
|
|
SET(OPATH "${CMAKE_CURRENT_LIST_DIR}/ogg")
|
2013-12-03 22:24:15 +00:00
|
|
|
|
|
|
|
SET(OGG_SRC ${OPATH}/src/bitwise.c ${OPATH}/src/framing.c)
|
|
|
|
SET(OGG_HEADERS ${OPATH}/include/ogg/ogg.h ${OPATH}/include/ogg/os_types.h)
|
|
|
|
|
|
|
|
INCLUDE_DIRECTORIES("${OPATH}/include")
|
|
|
|
|
|
|
|
IF(MSVC)
|
2014-10-07 15:40:35 +00:00
|
|
|
#ADD_DEFINITIONS(/D_UNICODE /DUNICODE)
|
|
|
|
LIST(APPEND OGG_SRC ${OPATH}/win32/ogg.def)
|
2013-12-03 22:24:15 +00:00
|
|
|
ENDIF(MSVC)
|
|
|
|
|
|
|
|
IF("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
|
2017-11-20 17:24:16 +00:00
|
|
|
# libogg expects configure to be called on linux to
|
|
|
|
# generate config_types.h
|
|
|
|
LIST(APPEND OGG_HEADERS ${OPATH}/include/ogg/config_types.h)
|
|
|
|
add_custom_command(OUTPUT ${OPATH}/include/ogg/config_types.h
|
|
|
|
COMMAND ${OPATH}/configure
|
|
|
|
DEPENDS ${OPATH}/include/ogg/ogg.h # Hopefully if the libogg version changes, so does this file
|
2013-12-03 22:24:15 +00:00
|
|
|
# so configure_types.h will be regenerated.
|
2017-11-20 17:24:16 +00:00
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
)
|
2013-12-03 22:24:15 +00:00
|
|
|
ENDIF()
|
|
|
|
|
|
|
|
add_library(bundled_ogg STATIC ${OGG_SRC} ${OGG_HEADERS})
|
|
|
|
|
2014-10-07 15:40:35 +00:00
|
|
|
SET(VPATH "${CMAKE_CURRENT_LIST_DIR}/vorbis")
|
2013-12-03 22:24:15 +00:00
|
|
|
|
|
|
|
SET(VORBIS_SRC
|
2017-11-20 17:24:16 +00:00
|
|
|
${VPATH}/lib/analysis.c
|
|
|
|
${VPATH}/lib/bitrate.c
|
|
|
|
${VPATH}/lib/block.c
|
|
|
|
${VPATH}/lib/codebook.c
|
|
|
|
${VPATH}/lib/envelope.c
|
|
|
|
${VPATH}/lib/floor0.c
|
|
|
|
${VPATH}/lib/floor1.c
|
|
|
|
${VPATH}/lib/info.c
|
|
|
|
${VPATH}/lib/lookup.c
|
|
|
|
${VPATH}/lib/lpc.c
|
|
|
|
${VPATH}/lib/lsp.c
|
|
|
|
${VPATH}/lib/mapping0.c
|
|
|
|
${VPATH}/lib/mdct.c
|
|
|
|
${VPATH}/lib/psy.c
|
|
|
|
${VPATH}/lib/registry.c
|
|
|
|
${VPATH}/lib/res0.c
|
|
|
|
${VPATH}/lib/sharedbook.c
|
|
|
|
${VPATH}/lib/smallft.c
|
|
|
|
${VPATH}/lib/synthesis.c
|
|
|
|
${VPATH}/lib/vorbisenc.c
|
|
|
|
${VPATH}/lib/window.c
|
2013-01-24 16:29:42 +00:00
|
|
|
)
|
2013-12-03 22:24:15 +00:00
|
|
|
|
2014-11-21 20:54:30 +00:00
|
|
|
SET(VORBIS_HEADERS
|
2017-11-20 17:24:16 +00:00
|
|
|
${VPATH}/lib/backends.h
|
|
|
|
${VPATH}/lib/bitrate.h
|
|
|
|
${VPATH}/lib/codebook.h
|
|
|
|
${VPATH}/lib/codec_internal.h
|
|
|
|
${VPATH}/lib/envelope.h
|
|
|
|
${VPATH}/lib/modes/floor_all.h
|
|
|
|
${VPATH}/lib/books/floor/floor_books.h
|
|
|
|
${VPATH}/lib/highlevel.h
|
|
|
|
${VPATH}/lib/lookup.h
|
|
|
|
${VPATH}/lib/lookup_data.h
|
|
|
|
${VPATH}/lib/lpc.h
|
|
|
|
${VPATH}/lib/lsp.h
|
|
|
|
${VPATH}/lib/masking.h
|
|
|
|
${VPATH}/lib/mdct.h
|
|
|
|
${VPATH}/lib/misc.h
|
|
|
|
${VPATH}/lib/os.h
|
|
|
|
${VPATH}/lib/psy.h
|
|
|
|
${VPATH}/lib/modes/psych_11.h
|
|
|
|
${VPATH}/lib/modes/psych_16.h
|
|
|
|
${VPATH}/lib/modes/psych_44.h
|
|
|
|
${VPATH}/lib/modes/psych_8.h
|
|
|
|
${VPATH}/lib/registry.h
|
|
|
|
${VPATH}/lib/books/coupled/res_books_stereo.h
|
|
|
|
${VPATH}/lib/books/uncoupled/res_books_uncoupled.h
|
|
|
|
${VPATH}/lib/modes/residue_16.h
|
|
|
|
${VPATH}/lib/modes/residue_44.h
|
|
|
|
${VPATH}/lib/modes/residue_44u.h
|
|
|
|
${VPATH}/lib/modes/residue_8.h
|
|
|
|
${VPATH}/lib/scales.h
|
|
|
|
${VPATH}/lib/modes/setup_11.h
|
|
|
|
${VPATH}/lib/modes/setup_16.h
|
|
|
|
${VPATH}/lib/modes/setup_22.h
|
|
|
|
${VPATH}/lib/modes/setup_32.h
|
|
|
|
${VPATH}/lib/modes/setup_44.h
|
|
|
|
${VPATH}/lib/modes/setup_44u.h
|
|
|
|
${VPATH}/lib/modes/setup_8.h
|
|
|
|
${VPATH}/lib/modes/setup_X.h
|
|
|
|
${VPATH}/lib/smallft.h
|
|
|
|
${VPATH}/lib/window.h
|
2013-12-03 22:24:15 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
SET(VORBIS_PUB_HEADERS
|
2017-11-20 17:24:16 +00:00
|
|
|
${VPATH}/include/vorbis/codec.h
|
|
|
|
${VPATH}/include/vorbis/vorbisenc.h
|
|
|
|
${VPATH}/include/vorbis/vorbisfile.h
|
2013-01-24 16:29:42 +00:00
|
|
|
)
|
2013-12-03 22:24:15 +00:00
|
|
|
|
|
|
|
INCLUDE_DIRECTORIES("${VPATH}/include" "${VPATH}/lib")
|
|
|
|
|
|
|
|
IF(MSVC)
|
2014-10-07 15:40:35 +00:00
|
|
|
#ADD_DEFINITIONS(/D_UNICODE /DUNICODE)
|
2017-11-20 17:24:16 +00:00
|
|
|
LIST(APPEND VORBIS_SRC ${VPATH}/win32/vorbis.def)
|
2013-12-03 22:24:15 +00:00
|
|
|
ENDIF(MSVC)
|
|
|
|
|
|
|
|
add_library(bundled_ogg_vorbis STATIC ${VORBIS_SRC} ${VORBIS_HEADERS} ${VORBIS_PUB_HEADERS})
|
|
|
|
target_link_libraries(bundled_ogg_vorbis bundled_ogg)
|
|
|
|
add_library(bundled_ogg_vorbis_file STATIC ${VPATH}/lib/vorbisfile.c ${VPATH}/include/vorbis/vorbisfile.h)
|
|
|
|
target_link_libraries(bundled_ogg_vorbis_file bundled_ogg bundled_ogg_vorbis)
|
|
|
|
|
2014-10-07 15:40:35 +00:00
|
|
|
if(MSVC)
|
|
|
|
set(VORB_UNI "_UNICODE;UNICODE")
|
|
|
|
set_target_properties(bundled_ogg PROPERTIES
|
|
|
|
COMPILE_DEFINITIONS "${VORB_UNI}"
|
|
|
|
)
|
|
|
|
set_target_properties(bundled_ogg_vorbis PROPERTIES
|
|
|
|
COMPILE_DEFINITIONS "${VORB_UNI}"
|
|
|
|
)
|
|
|
|
set_target_properties(bundled_ogg_vorbis_file PROPERTIES
|
|
|
|
COMPILE_DEFINITIONS "${VORB_UNI}"
|
|
|
|
)
|
|
|
|
endif(MSVC)
|
|
|
|
|
2016-09-29 13:28:25 +00:00
|
|
|
set_target_properties(bundled_ogg PROPERTIES FOLDER ${BUNDLED_TARGETS_FOLDER})
|
|
|
|
set_target_properties(bundled_ogg_vorbis PROPERTIES FOLDER ${BUNDLED_TARGETS_FOLDER})
|
|
|
|
set_target_properties(bundled_ogg_vorbis_file PROPERTIES FOLDER ${BUNDLED_TARGETS_FOLDER})
|
|
|
|
|
2014-10-07 15:40:35 +00:00
|
|
|
set(OGG_BUNDLED_LIBRARIES bundled_ogg)
|
|
|
|
set(OGG_BUNDLED_INCLUDE_DIR "${CMAKE_CURRENT_LIST_DIR}/ogg/include")
|
|
|
|
set(OGG_VORBIS_BUNDLED_LIBRARIES bundled_ogg_vorbis bundled_ogg_vorbis_file)
|
|
|
|
set(OGG_VORBIS_BUNDLED_INCLUDE_DIR "${CMAKE_CURRENT_LIST_DIR}/vorbis/include")
|
2016-09-13 12:01:38 +00:00
|
|
|
endif()
|
2014-11-21 20:54:30 +00:00
|
|
|
|
2016-01-04 19:37:10 +00:00
|
|
|
#-----------------------------------------------------------------
|
|
|
|
# Build bundled OpenAL library
|
|
|
|
#-----------------------------------------------------------------
|
2016-09-13 12:01:38 +00:00
|
|
|
if(BUNDLED_OPENAL AND BUILD_CLIENT)
|
2019-10-20 18:31:38 +00:00
|
|
|
set(binary_dir "${LIBS_BINARYDIR_DIR}/openal")
|
|
|
|
if(VSTUDIO)
|
|
|
|
set(OPENAL_BUNDLED_LIBRARIES optimized "${binary_dir}/Release/OpenAL32${CMAKE_STATIC_LIBRARY_SUFFIX}" debug "${binary_dir}/Debug/OpenAL32${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
|
|
|
elseif(VS_BUILD)
|
|
|
|
set(OPENAL_BUNDLED_LIBRARIES "${binary_dir}/OpenAL32${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
|
|
|
else()
|
|
|
|
set(OPENAL_BUNDLED_LIBRARIES "${binary_dir}/libOpenAL32${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
|
|
|
endif()
|
|
|
|
|
2016-01-04 19:37:10 +00:00
|
|
|
ExternalProject_Add(bundled_openal
|
2017-11-20 17:24:16 +00:00
|
|
|
SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/openal
|
2019-10-20 18:31:38 +00:00
|
|
|
BINARY_DIR ${binary_dir}
|
|
|
|
BUILD_BYPRODUCTS ${OPENAL_BUNDLED_LIBRARIES}
|
2017-11-20 17:24:16 +00:00
|
|
|
CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
|
|
|
|
-DCMAKE_CXX_FLAGS_DEBUG=${CMAKE_CXX_FLAGS_DEBUG} -DCMAKE_CXX_FLAGS_RELEASE=${CMAKE_CXX_FLAGS_RELEASE}
|
2019-12-25 14:56:58 +00:00
|
|
|
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} -DCMAKE_INSTALL_PREFIX=${PROJECT_BINARY_DIR}/openal
|
|
|
|
-DLIBTYPE=STATIC -DFORCE_STATIC_VCRT=1
|
2019-12-20 09:34:12 +00:00
|
|
|
-DALSOFT_UTILS=0 -DALSOFT_NO_CONFIG_UTIL=1 -DALSOFT_EXAMPLES=0 -DALSOFT_TESTS=0
|
|
|
|
-DALSOFT_CONFIG=0 -DALSOFT_HRTF_DEFS=0 -DALSOFT_AMBDEC_PRESETS=0
|
2017-11-20 17:24:16 +00:00
|
|
|
INSTALL_COMMAND ""
|
|
|
|
)
|
2016-01-04 19:37:10 +00:00
|
|
|
|
|
|
|
set(OPENAL_BUNDLED_INCLUDE_DIR "${CMAKE_CURRENT_LIST_DIR}/openal/include")
|
2016-09-29 13:28:25 +00:00
|
|
|
set_target_properties(bundled_openal PROPERTIES FOLDER ${BUNDLED_TARGETS_FOLDER})
|
2016-09-13 12:01:38 +00:00
|
|
|
endif()
|
2016-01-04 19:37:10 +00:00
|
|
|
|
2012-06-09 19:00:11 +00:00
|
|
|
elseif(UNIX)
|
2012-11-20 17:12:26 +00:00
|
|
|
|
2012-11-03 18:04:41 +00:00
|
|
|
if(CROSS_COMPILE32)
|
2017-11-14 18:27:22 +00:00
|
|
|
if(APPLE)
|
2019-11-02 21:23:33 +00:00
|
|
|
set(CROSS_COMPILE32_FLAGS CFLAGS=-mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}\ -O3\ -m32 LDFLAGS=-mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}\ -m32)
|
2017-11-14 18:27:22 +00:00
|
|
|
else()
|
|
|
|
set(CROSS_COMPILE32_FLAGS CFLAGS=-m32 LDFLAGS=-m32)
|
|
|
|
endif()
|
2012-11-03 18:04:41 +00:00
|
|
|
else(CROSS_COMPILE32)
|
2014-06-22 08:09:06 +00:00
|
|
|
# when we don't cross compile we have to enable position independant code '-fPIC' for all bundled libs
|
|
|
|
# see http://stackoverflow.com/questions/7216244/why-is-fpic-absolutely-necessary-on-64-and-not-on-32bit-platforms
|
|
|
|
# let's misuse CROSS_COMPILE32_FLAGS var (for 64bit) to set our flag. FIXME: rename to CROSS_COMPILE_OPTIONAL_FLAGS?
|
|
|
|
# notes: - cflag -mcmodel=large might be an option too
|
|
|
|
# - this has to be done in all dependant CMakeLists-txt files see glew/CMakeLists.txt
|
2017-11-14 18:27:22 +00:00
|
|
|
if(APPLE)
|
2019-11-02 21:23:33 +00:00
|
|
|
set(CROSS_COMPILE32_FLAGS CFLAGS=-mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}\ -O3\ -fPIC LDFLAGS=-mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET})
|
2017-11-14 18:27:22 +00:00
|
|
|
else()
|
|
|
|
set(CROSS_COMPILE32_FLAGS "CFLAGS=-fPIC")
|
|
|
|
endif()
|
2012-11-03 18:04:41 +00:00
|
|
|
endif(CROSS_COMPILE32)
|
2012-06-13 14:27:47 +00:00
|
|
|
|
2019-03-03 13:33:03 +00:00
|
|
|
if (BUNDLED_OPENSSL AND (BUILD_CLIENT OR BUILD_SERVER))
|
2019-03-11 19:07:51 +00:00
|
|
|
# FIXME: check flags
|
|
|
|
if(CROSS_COMPILE32)
|
|
|
|
if(APPLE)
|
|
|
|
SET(OPENSSL_BUILD ./Configure darwin-i386-cc ${CROSS_COMPILE32_FLAGS})
|
|
|
|
else()
|
|
|
|
SET(OPENSSL_BUILD ./Configure linux-x86 ${CROSS_COMPILE32_FLAGS})
|
|
|
|
endif()
|
|
|
|
else(CROSS_COMPILE32)
|
|
|
|
if(APPLE)
|
|
|
|
SET(OPENSSL_BUILD ./Configure darwin64-x86_64-cc ${CROSS_COMPILE32_FLAGS})
|
|
|
|
else()
|
|
|
|
#SET(OPENSSL_BUILD ./Configure linux-x86_64 ${CROSS_COMPILE32_FLAGS})
|
|
|
|
# better use ./config here?! (..and not the CROSS_COMPILE32_FLAGS?!)
|
|
|
|
SET(OPENSSL_BUILD ./Configure ${CROSS_COMPILE32_FLAGS})
|
|
|
|
endif()
|
|
|
|
endif()
|
2019-03-03 13:33:03 +00:00
|
|
|
|
|
|
|
# FIXME:
|
2019-03-11 19:07:51 +00:00
|
|
|
# check all the locations of the files (runtime files?!)
|
2019-03-03 13:33:03 +00:00
|
|
|
# and enable ssl in CURL
|
2019-03-11 19:07:51 +00:00
|
|
|
ExternalProject_Add(
|
|
|
|
bundled_openssl
|
|
|
|
SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/openssl
|
|
|
|
CONFIGURE_COMMAND ${OPENSSL_BUILD} --prefix=${CMAKE_CURRENT_BINARY_DIR}/libs/openssl
|
|
|
|
--openssldir=${CMAKE_CURRENT_BINARY_DIR}/libs/openssl
|
|
|
|
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/libs/openssl
|
|
|
|
BUILD_COMMAND make
|
|
|
|
INSTALL_COMMAND make install
|
|
|
|
BUILD_IN_SOURCE 1
|
|
|
|
)
|
|
|
|
|
|
|
|
# also generates libcrypto.a
|
|
|
|
set(OPENSSL_BUNDLED_LIBRARIES "${CMAKE_CURRENT_BINARY_DIR}/libs/openssl/lib/libssl.a")
|
|
|
|
set(OPENSSL_BUNDLED_INCLUDE_DIR "${CMAKE_CURRENT_BINARY_DIR}/libs/openssl/include")
|
2019-11-02 21:23:33 +00:00
|
|
|
|
2019-03-03 13:33:03 +00:00
|
|
|
endif()
|
2019-11-02 21:23:33 +00:00
|
|
|
|
2012-11-03 18:04:41 +00:00
|
|
|
#-----------------------------------------------------------------
|
|
|
|
# Build bundled cURL library
|
|
|
|
#-----------------------------------------------------------------
|
2016-09-13 12:01:38 +00:00
|
|
|
if(BUNDLED_CURL AND (BUILD_CLIENT OR BUILD_SERVER))
|
2017-11-14 18:27:22 +00:00
|
|
|
|
2019-03-03 13:33:03 +00:00
|
|
|
# FIXME: add openssl lib to project
|
|
|
|
# set --with-ssl / remove --without-ssl
|
|
|
|
|
2017-11-14 18:27:22 +00:00
|
|
|
ExternalProject_Add(
|
|
|
|
bundled_curl
|
|
|
|
SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/curl
|
|
|
|
CONFIGURE_COMMAND ./configure --prefix=${CMAKE_CURRENT_BINARY_DIR}/libs/curl
|
2012-11-20 17:12:26 +00:00
|
|
|
--enable-shared=no --enable-static=yes
|
2016-09-16 04:47:20 +00:00
|
|
|
--enable-http --enable-ftp --disable-file
|
|
|
|
--disable-ldap --disable-ldaps --disable-rtsp
|
|
|
|
--enable-proxy --disable-dict --disable-telnet
|
|
|
|
--disable-tftp --disable-pop3 --disable-imap
|
|
|
|
--disable-smb --disable-smtp --disable-gopher
|
2019-03-03 13:33:03 +00:00
|
|
|
--without-libssh2 --without-nghttp2
|
2018-12-06 10:35:46 +00:00
|
|
|
--without-gssapi --with-zlib --without-brotli
|
2016-09-16 04:47:20 +00:00
|
|
|
--disable-ares --enable-threaded-resolver
|
|
|
|
--enable-ipv6 --enable-unix-sockets
|
2018-02-04 17:29:04 +00:00
|
|
|
--without-libidn2 --disable-manual
|
2016-09-16 04:47:20 +00:00
|
|
|
--disable-sspi --enable-libgcc
|
|
|
|
--without-libmetalink --without-libpsl
|
2017-11-14 18:27:22 +00:00
|
|
|
--without-librtmp ${CROSS_COMPILE32_FLAGS}
|
2019-03-03 13:33:03 +00:00
|
|
|
--without-ssl
|
2017-11-14 18:27:22 +00:00
|
|
|
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/libs/curl
|
|
|
|
BUILD_COMMAND make
|
|
|
|
INSTALL_COMMAND make install
|
|
|
|
BUILD_IN_SOURCE 1
|
2012-11-20 17:12:26 +00:00
|
|
|
)
|
2017-11-14 18:27:22 +00:00
|
|
|
|
|
|
|
set(CURL_BUNDLED_LIBRARY "${CMAKE_CURRENT_BINARY_DIR}/libs/curl/lib/libcurl.a")
|
|
|
|
set(CURL_BUNDLED_INCLUDE_DIR "${CMAKE_CURRENT_BINARY_DIR}/libs/curl/include")
|
2016-09-13 12:01:38 +00:00
|
|
|
endif()
|
2014-11-21 20:54:30 +00:00
|
|
|
|
2012-11-03 18:04:41 +00:00
|
|
|
#-----------------------------------------------------------------
|
|
|
|
# Build bundled JPEG library
|
|
|
|
#-----------------------------------------------------------------
|
2016-09-13 12:01:38 +00:00
|
|
|
if(BUNDLED_JPEG AND BUILD_CLIENT)
|
2014-11-22 01:02:05 +00:00
|
|
|
if(CROSS_COMPILE32)
|
2014-12-20 22:54:05 +00:00
|
|
|
if(APPLE)
|
2017-11-14 18:27:22 +00:00
|
|
|
SET(JPEG_TURBO_BUILD ./configure --with-jpeg8 --build i686-apple-darwin ${CROSS_COMPILE32_FLAGS})
|
2014-12-20 22:54:05 +00:00
|
|
|
else()
|
2017-11-14 18:27:22 +00:00
|
|
|
SET(JPEG_TURBO_BUILD ./configure --with-jpeg8 --build i686-pc-linux-gnu ${CROSS_COMPILE32_FLAGS})
|
2014-12-20 22:54:05 +00:00
|
|
|
endif()
|
2014-11-22 01:02:05 +00:00
|
|
|
else(CROSS_COMPILE32)
|
2014-12-21 14:24:25 +00:00
|
|
|
if(APPLE)
|
2017-11-14 18:27:22 +00:00
|
|
|
SET(JPEG_TURBO_BUILD ./configure --with-jpeg8 --build x86_64-apple-darwin ${CROSS_COMPILE32_FLAGS})
|
2014-12-21 14:24:25 +00:00
|
|
|
else()
|
2017-11-14 18:27:22 +00:00
|
|
|
SET(JPEG_TURBO_BUILD ./configure --with-jpeg8 ${CROSS_COMPILE32_FLAGS})
|
2014-12-21 14:24:25 +00:00
|
|
|
endif()
|
2014-11-22 01:02:05 +00:00
|
|
|
endif()
|
2014-12-21 14:24:25 +00:00
|
|
|
|
2017-11-14 18:27:22 +00:00
|
|
|
ExternalProject_Add(
|
|
|
|
bundled_jpeg
|
|
|
|
SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/jpegturbo
|
2018-02-05 12:24:32 +00:00
|
|
|
PATCH_COMMAND autoreconf -fiv
|
2017-11-14 18:27:22 +00:00
|
|
|
CONFIGURE_COMMAND ${JPEG_TURBO_BUILD} --prefix=${CMAKE_CURRENT_BINARY_DIR}/libs/jpegturbo
|
|
|
|
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/libs/jpegturbo
|
|
|
|
BUILD_COMMAND make
|
|
|
|
INSTALL_COMMAND make install
|
|
|
|
BUILD_IN_SOURCE 1
|
2014-12-21 14:24:25 +00:00
|
|
|
)
|
2017-11-14 18:27:22 +00:00
|
|
|
set(JPEG_BUNDLED_LIBRARIES "${CMAKE_CURRENT_BINARY_DIR}/libs/jpegturbo/lib/libturbojpeg.a")
|
|
|
|
set(JPEG_BUNDLED_INCLUDE_DIR "${CMAKE_CURRENT_BINARY_DIR}/libs/jpegturbo/include")
|
2016-09-13 12:01:38 +00:00
|
|
|
endif()
|
2012-06-09 19:00:11 +00:00
|
|
|
|
2012-11-17 21:59:27 +00:00
|
|
|
#-----------------------------------------------------------------
|
2014-11-21 20:54:30 +00:00
|
|
|
# Build bundled Lua library
|
2012-11-17 21:59:27 +00:00
|
|
|
#-----------------------------------------------------------------
|
2013-01-24 22:45:32 +00:00
|
|
|
# NOTE: the posix32bit target was added into the Lua Makefiles
|
2017-02-03 21:05:55 +00:00
|
|
|
if(BUNDLED_LUA AND BUILD_MOD)
|
2012-11-20 17:12:26 +00:00
|
|
|
if(CMAKE_SYSTEM MATCHES "OpenBSD*")
|
|
|
|
set(LUA_MAKE_TARGET "bsd")
|
2017-11-14 18:27:22 +00:00
|
|
|
elseif(CMAKE_SYSTEM MATCHES "Darwin")
|
2018-02-04 19:44:20 +00:00
|
|
|
set(LUA_MAKE_TARGET "macosx")
|
2012-11-17 21:59:27 +00:00
|
|
|
else()
|
2019-01-05 15:16:41 +00:00
|
|
|
if(NOT CROSS_COMPILE32)
|
|
|
|
set(LUA_MAKE_TARGET "posix")
|
|
|
|
else()
|
|
|
|
set(LUA_MAKE_TARGET "posix32bit")
|
|
|
|
endif()
|
2012-11-17 21:59:27 +00:00
|
|
|
endif()
|
2012-11-20 17:12:26 +00:00
|
|
|
|
2019-06-16 09:56:52 +00:00
|
|
|
# MacOS X requires a different flag order to succeed,
|
|
|
|
# but io.popen support requires the initial order
|
|
|
|
if(NOT CMAKE_SYSTEM MATCHES "Darwin")
|
|
|
|
add_custom_command(OUTPUT ${CMAKE_CURRENT_LIST_DIR}/lua/src/liblua.a
|
|
|
|
COMMAND make clean || true
|
|
|
|
COMMAND ${CROSS_COMPILE32_FLAGS} make ${LUA_MAKE_TARGET}
|
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/lua/src
|
|
|
|
)
|
|
|
|
else()
|
2019-11-02 21:23:33 +00:00
|
|
|
if(CROSS_COMPILE32)
|
|
|
|
set(LUA_BUILD CFLAGS=-mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}\ -O3\ -m32\ -DLUA_USE_MACOSX LDFLAGS=-mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}\ -m32)
|
|
|
|
else()
|
|
|
|
set(LUA_BUILD CFLAGS=-mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET}\ -O3\ -DLUA_USE_MACOSX LDFLAGS=-mmacosx-version-min=${CMAKE_OSX_DEPLOYMENT_TARGET})
|
|
|
|
endif()
|
2019-06-16 09:56:52 +00:00
|
|
|
add_custom_command(OUTPUT ${CMAKE_CURRENT_LIST_DIR}/lua/src/liblua.a
|
|
|
|
COMMAND make clean || true
|
2019-11-02 21:23:33 +00:00
|
|
|
COMMAND make ${LUA_MAKE_TARGET} ${LUA_BUILD}
|
2019-06-16 09:56:52 +00:00
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/lua/src
|
|
|
|
)
|
|
|
|
endif()
|
2017-11-14 18:27:22 +00:00
|
|
|
|
2019-01-05 15:16:41 +00:00
|
|
|
set(LUA_BUNDLED_LIBRARIES "${CMAKE_CURRENT_LIST_DIR}/lua/src/liblua.a")
|
|
|
|
set(LUA_BUNDLED_INCLUDE_DIR "${CMAKE_CURRENT_LIST_DIR}/lua/src")
|
|
|
|
|
|
|
|
add_custom_target(bundled_lua
|
|
|
|
DEPENDS ${CMAKE_CURRENT_LIST_DIR}/lua/src/liblua.a
|
|
|
|
)
|
2017-02-03 21:05:55 +00:00
|
|
|
endif()
|
2013-01-24 15:44:19 +00:00
|
|
|
|
|
|
|
#-----------------------------------------------------------------
|
|
|
|
# Build bundled OGG and Vorbis file library
|
|
|
|
#-----------------------------------------------------------------
|
2016-09-13 12:01:38 +00:00
|
|
|
if(BUNDLED_OGG_VORBIS AND BUILD_CLIENT)
|
2017-11-14 18:27:22 +00:00
|
|
|
|
|
|
|
ExternalProject_Add(
|
|
|
|
bundled_ogg
|
|
|
|
SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/ogg
|
2018-02-07 08:09:15 +00:00
|
|
|
PATCH_COMMAND autoreconf -fiv
|
2017-11-14 18:27:22 +00:00
|
|
|
CONFIGURE_COMMAND ./configure --prefix=${CMAKE_CURRENT_BINARY_DIR}/libs/ogg ${CROSS_COMPILE32_FLAGS}
|
|
|
|
--enable-silent-rules --disable-dependency-tracking --enable-shared=no
|
|
|
|
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/libs/ogg
|
|
|
|
BUILD_COMMAND make
|
|
|
|
INSTALL_COMMAND make install
|
|
|
|
BUILD_IN_SOURCE 1
|
2013-01-24 15:44:19 +00:00
|
|
|
)
|
2017-11-14 18:27:22 +00:00
|
|
|
|
|
|
|
set(OGG_BUNDLED_LIBRARIES "${CMAKE_CURRENT_BINARY_DIR}/libs/ogg/lib/libogg.a")
|
|
|
|
set(OGG_BUNDLED_INCLUDE_DIR "${CMAKE_CURRENT_BINARY_DIR}/libs/ogg/include")
|
2013-01-24 15:44:19 +00:00
|
|
|
|
|
|
|
# OGG Vorbis File
|
2017-11-14 18:27:22 +00:00
|
|
|
set(CFLAGS "${CFLAGS} -I${CMAKE_CURRENT_BINARY_DIR}/libs/ogg/include")
|
|
|
|
set(LDFLAGS "${LDFLAGS} -L${CMAKE_CURRENT_BINARY_DIR}/libs/ogg/lib")
|
2015-09-30 08:21:16 +00:00
|
|
|
|
2015-07-16 12:06:03 +00:00
|
|
|
# the above set of CFLAGS and LDFLAGS don't trigger on some systems
|
|
|
|
# ensure vorbis configure uses our bundled ogg see --with-ogg-includes & --with-ogg-libraries
|
2017-11-14 18:27:22 +00:00
|
|
|
|
|
|
|
ExternalProject_Add(
|
|
|
|
bundled_ogg_vorbis
|
|
|
|
DEPENDS bundled_ogg
|
|
|
|
SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/vorbis
|
2018-02-07 09:51:36 +00:00
|
|
|
#PATCH_COMMAND ./autogen.sh
|
2017-11-14 18:27:22 +00:00
|
|
|
CONFIGURE_COMMAND ./configure --prefix=${CMAKE_CURRENT_BINARY_DIR}/libs/vorbis
|
|
|
|
--disable-oggtest --with-ogg-includes=${CMAKE_CURRENT_BINARY_DIR}/libs/ogg/include
|
|
|
|
--with-ogg-libraries=${CMAKE_CURRENT_BINARY_DIR}/libs/ogg/lib ${CROSS_COMPILE32_FLAGS}
|
|
|
|
--disable-dependency-tracking --enable-silent-rules --enable-shared=no
|
|
|
|
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/libs/vorbis
|
|
|
|
BUILD_COMMAND make
|
|
|
|
INSTALL_COMMAND make install
|
|
|
|
BUILD_IN_SOURCE 1
|
2015-01-24 21:47:22 +00:00
|
|
|
)
|
2017-11-14 18:27:22 +00:00
|
|
|
add_custom_target(bundled_ogg_vorbis_file)
|
|
|
|
set(OGG_VORBIS_BUNDLED_LIBRARIES "${CMAKE_CURRENT_BINARY_DIR}/libs/vorbis/lib/libvorbisfile.a" "${CMAKE_CURRENT_BINARY_DIR}/libs/vorbis/lib/libvorbis.a")
|
|
|
|
set(OGG_VORBIS_BUNDLED_INCLUDE_DIR "${CMAKE_CURRENT_BINARY_DIR}/libs/vorbis/include")
|
2016-09-13 12:01:38 +00:00
|
|
|
endif()
|
2016-01-04 19:37:10 +00:00
|
|
|
|
|
|
|
#-----------------------------------------------------------------
|
|
|
|
# Build bundled OpenAL library
|
|
|
|
#-----------------------------------------------------------------
|
2016-09-13 12:01:38 +00:00
|
|
|
if(BUNDLED_OPENAL AND BUILD_CLIENT)
|
2016-01-04 19:37:10 +00:00
|
|
|
ExternalProject_Add(bundled_openal
|
2017-11-14 18:27:22 +00:00
|
|
|
SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/openal
|
|
|
|
BINARY_DIR ${LIBS_BINARYDIR_DIR}/openal
|
|
|
|
CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
|
|
|
|
-DCMAKE_CXX_FLAGS_DEBUG=${CMAKE_CXX_FLAGS_DEBUG} -DCMAKE_CXX_FLAGS_RELEASE=${CMAKE_CXX_FLAGS_RELEASE}
|
|
|
|
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} -DCMAKE_INSTALL_PREFIX=${PROJECT_BINARY_DIR}/openal
|
2019-11-02 21:23:33 +00:00
|
|
|
-DCMAKE_OSX_DEPLOYMENT_TARGET="${CMAKE_OSX_DEPLOYMENT_TARGET}" -DLIBTYPE=STATIC
|
2017-11-14 18:27:22 +00:00
|
|
|
-DALSOFT_UTILS=0 -DALSOFT_NO_CONFIG_UTIL=1 -DALSOFT_EXAMPLES=0 -DALSOFT_TESTS=0
|
2019-12-20 09:34:12 +00:00
|
|
|
-DALSOFT_CONFIG=0 -DALSOFT_HRTF_DEFS=0 -DALSOFT_AMBDEC_PRESETS=0
|
2017-11-14 18:27:22 +00:00
|
|
|
INSTALL_COMMAND ""
|
|
|
|
)
|
2016-01-04 19:37:10 +00:00
|
|
|
|
|
|
|
ExternalProject_Get_Property(bundled_openal binary_dir)
|
|
|
|
|
|
|
|
set(OPENAL_BUNDLED_LIBRARIES "${binary_dir}/libopenal${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
|
|
|
set(OPENAL_BUNDLED_INCLUDE_DIR "${CMAKE_CURRENT_LIST_DIR}/openal/include")
|
2016-09-13 12:01:38 +00:00
|
|
|
elseif(BUNDLED_OPENAL_INCLUDE AND BUILD_CLIENT)
|
2016-01-15 20:53:22 +00:00
|
|
|
include_directories(SYSTEM "${CMAKE_CURRENT_LIST_DIR}/openal/include")
|
2016-09-13 12:01:38 +00:00
|
|
|
endif()
|
2012-06-09 19:00:11 +00:00
|
|
|
endif()
|
2013-05-14 20:56:06 +00:00
|
|
|
|
2017-11-20 17:24:16 +00:00
|
|
|
#-----------------------------------------------------------------
|
|
|
|
# Copy bundled SDL library to the etl.exe location
|
|
|
|
#-----------------------------------------------------------------
|
|
|
|
if(BUNDLED_SDL AND BUILD_CLIENT)
|
2018-10-31 13:40:13 +00:00
|
|
|
# GL render builds (not GLES) for RPI require VIDEO_OPENGLES=1
|
|
|
|
if(ARM AND NOT FEATURE_RENDERER_GLES)
|
2018-12-18 16:32:38 +00:00
|
|
|
set(SDL_WITH_GLES "ON")
|
2018-10-31 13:40:13 +00:00
|
|
|
else()
|
2018-12-18 16:32:38 +00:00
|
|
|
set(SDL_WITH_GLES "${FEATURE_RENDERER_GLES}")
|
2018-10-31 13:40:13 +00:00
|
|
|
endif()
|
|
|
|
|
2019-10-20 18:31:38 +00:00
|
|
|
if(CMAKE_SYSTEM MATCHES "Darwin" OR WIN32)
|
|
|
|
set(SDL32_BUNDLED_LIBRARIES optimized "${LIBS_BINARYDIR_DIR}/sdl2/lib/${CMAKE_STATIC_LIBRARY_PREFIX}SDL2main${CMAKE_STATIC_LIBRARY_SUFFIX}" debug "${LIBS_BINARYDIR_DIR}/sdl2/lib/${CMAKE_STATIC_LIBRARY_PREFIX}SDL2maind${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
|
|
|
endif()
|
|
|
|
set(SDL32_BUNDLED_LIBRARIES ${SDL32_BUNDLED_LIBRARIES} optimized "${LIBS_BINARYDIR_DIR}/sdl2/lib/${CMAKE_STATIC_LIBRARY_PREFIX}SDL2${CMAKE_STATIC_LIBRARY_SUFFIX}" debug "${LIBS_BINARYDIR_DIR}/sdl2/lib/${CMAKE_STATIC_LIBRARY_PREFIX}SDL2d${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
|
|
|
|
2019-01-25 14:12:54 +00:00
|
|
|
if(ARM)
|
|
|
|
#check if we're running on Raspberry Pi
|
|
|
|
if(EXISTS "/opt/vc/include/bcm_host.h")
|
|
|
|
set(BCMHOST found)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(DEFINED BCMHOST)
|
|
|
|
if (FEATURE_RENDERER_GLES)
|
|
|
|
ExternalProject_Add(bundled_sdl
|
|
|
|
SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/sdl2
|
|
|
|
# DOWNLOAD_DIR ${LIBS_DOWNLOAD_DIR}/sdl2
|
|
|
|
# URL https://www.libsdl.org/release/SDL2-2.0.9.tar.gz
|
|
|
|
BINARY_DIR ${LIBS_BINARYDIR_DIR}/sdl2
|
|
|
|
CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} -DCMAKE_CXX_FLAGS_DEBUG=${CMAKE_CXX_FLAGS_DEBUG}
|
2019-11-02 21:23:33 +00:00
|
|
|
-DCMAKE_CXX_FLAGS_RELEASE=${CMAKE_CXX_FLAGS_RELEASE} -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} -DCMAKE_OSX_DEPLOYMENT_TARGET="${CMAKE_OSX_DEPLOYMENT_TARGET}"
|
2019-01-25 14:12:54 +00:00
|
|
|
-DVIDEO_OPENGLES=${SDL_WITH_GLES} -DSDL_SHARED=OFF -DSDL_RENDER=OFF -DRENDER_D3D=OFF -DFORCE_STATIC_VCRT=ON
|
|
|
|
-DCMAKE_INSTALL_PREFIX=${LIBS_BINARYDIR_DIR}/sdl2
|
|
|
|
PREFIX ${LIBS_BINARYDIR_DIR}/sdl2
|
|
|
|
CONFIGURE_COMMAND ${CMAKE_CURRENT_LIST_DIR}/sdl2/./configure --host=armv7l-raspberry-linux-gnueabihf --disable-pulseaudio --disable-esd --disable-video-mir --disable-video-wayland --disable-video-x11 --disable-video-opengl --prefix=${LIBS_BINARYDIR_DIR}/sdl2
|
|
|
|
)
|
|
|
|
else()
|
|
|
|
ExternalProject_Add(bundled_sdl
|
|
|
|
SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/sdl2
|
|
|
|
# DOWNLOAD_DIR ${LIBS_DOWNLOAD_DIR}/sdl2
|
|
|
|
# URL https://www.libsdl.org/release/SDL2-2.0.9.tar.gz
|
|
|
|
BINARY_DIR ${LIBS_BINARYDIR_DIR}/sdl2
|
|
|
|
CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} -DCMAKE_CXX_FLAGS_DEBUG=${CMAKE_CXX_FLAGS_DEBUG}
|
2019-11-02 21:23:33 +00:00
|
|
|
-DCMAKE_CXX_FLAGS_RELEASE=${CMAKE_CXX_FLAGS_RELEASE} -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} -DCMAKE_OSX_DEPLOYMENT_TARGET="${CMAKE_OSX_DEPLOYMENT_TARGET}"
|
2019-01-25 14:12:54 +00:00
|
|
|
-DVIDEO_OPENGLES=${SDL_WITH_GLES} -DSDL_SHARED=OFF -DSDL_RENDER=OFF -DRENDER_D3D=OFF -DFORCE_STATIC_VCRT=ON
|
|
|
|
-DCMAKE_INSTALL_PREFIX=${LIBS_BINARYDIR_DIR}/sdl2
|
|
|
|
PREFIX ${LIBS_BINARYDIR_DIR}/sdl2
|
|
|
|
CONFIGURE_COMMAND ${CMAKE_CURRENT_LIST_DIR}/sdl2/./configure --host=armv7l-raspberry-linux-gnueabihf --prefix=${LIBS_BINARYDIR_DIR}/sdl2
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
else()
|
|
|
|
ExternalProject_Add(bundled_sdl
|
|
|
|
SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/sdl2
|
|
|
|
# DOWNLOAD_DIR ${LIBS_DOWNLOAD_DIR}/sdl2
|
|
|
|
# URL https://www.libsdl.org/release/SDL2-2.0.9.tar.gz
|
|
|
|
BINARY_DIR ${LIBS_BINARYDIR_DIR}/sdl2
|
2019-10-20 18:31:38 +00:00
|
|
|
BUILD_BYPRODUCTS ${SDL32_BUNDLED_LIBRARIES}
|
2019-01-25 14:12:54 +00:00
|
|
|
CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS} -DCMAKE_CXX_FLAGS_DEBUG=${CMAKE_CXX_FLAGS_DEBUG}
|
2019-11-02 21:23:33 +00:00
|
|
|
-DCMAKE_CXX_FLAGS_RELEASE=${CMAKE_CXX_FLAGS_RELEASE} -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} -DCMAKE_OSX_DEPLOYMENT_TARGET="${CMAKE_OSX_DEPLOYMENT_TARGET}"
|
2019-01-25 14:12:54 +00:00
|
|
|
-DVIDEO_OPENGLES=${SDL_WITH_GLES} -DSDL_SHARED=OFF -DSDL_RENDER=OFF -DRENDER_D3D=OFF -DFORCE_STATIC_VCRT=ON
|
|
|
|
-DCMAKE_INSTALL_PREFIX=${LIBS_BINARYDIR_DIR}/sdl2
|
|
|
|
PREFIX ${LIBS_BINARYDIR_DIR}/sdl2
|
|
|
|
)
|
|
|
|
endif()
|
2017-11-20 17:24:16 +00:00
|
|
|
|
|
|
|
set(SDL32_BUNDLED_INCLUDE_DIR "${LIBS_BINARYDIR_DIR}/sdl2/include")
|
|
|
|
set_target_properties(bundled_sdl PROPERTIES FOLDER ${BUNDLED_TARGETS_FOLDER})
|
|
|
|
endif()
|
|
|
|
|
2015-12-10 10:11:06 +00:00
|
|
|
#-----------------------------------------------------------------
|
|
|
|
# Build bundled ZLib library
|
|
|
|
#-----------------------------------------------------------------
|
2016-09-13 12:01:38 +00:00
|
|
|
if(BUNDLED_ZLIB AND (BUILD_CLIENT OR BUILD_SERVER))
|
2015-12-10 10:11:06 +00:00
|
|
|
set(ZLIB_LIB "${CMAKE_CURRENT_LIST_DIR}/zlib")
|
|
|
|
|
|
|
|
FILE(GLOB ZLIB_LIB_HEADERS
|
|
|
|
${ZLIB_LIB}/crc32.h
|
2019-12-21 14:40:49 +00:00
|
|
|
${ZLIB_LIB}/deflate.h
|
2015-12-10 10:11:06 +00:00
|
|
|
${ZLIB_LIB}/gzguts.h
|
|
|
|
${ZLIB_LIB}/inffast.h
|
|
|
|
${ZLIB_LIB}/inffixed.h
|
|
|
|
${ZLIB_LIB}/inflate.h
|
|
|
|
${ZLIB_LIB}/inftrees.h
|
2019-12-21 14:40:49 +00:00
|
|
|
${ZLIB_LIB}/trees.h
|
2015-12-10 10:11:06 +00:00
|
|
|
${ZLIB_LIB}/zconf.h
|
|
|
|
${ZLIB_LIB}/zlib.h
|
|
|
|
${ZLIB_LIB}/zutil.h
|
|
|
|
)
|
|
|
|
|
|
|
|
FILE(GLOB ZLIB_LIB_SRC
|
|
|
|
${ZLIB_LIB}/adler32.c
|
2019-12-21 14:40:49 +00:00
|
|
|
${ZLIB_LIB}/compress.c
|
2015-12-10 10:11:06 +00:00
|
|
|
${ZLIB_LIB}/crc32.c
|
2019-12-21 14:40:49 +00:00
|
|
|
${ZLIB_LIB}/deflate.c
|
2015-12-10 10:11:06 +00:00
|
|
|
${ZLIB_LIB}/inffast.c
|
|
|
|
${ZLIB_LIB}/inflate.c
|
|
|
|
${ZLIB_LIB}/inftrees.c
|
2019-12-21 14:40:49 +00:00
|
|
|
${ZLIB_LIB}/trees.c
|
2015-12-10 10:11:06 +00:00
|
|
|
${ZLIB_LIB}/zutil.c
|
|
|
|
)
|
|
|
|
|
2016-01-04 19:37:10 +00:00
|
|
|
add_library(bundled_zlib STATIC ${ZLIB_LIB_SRC} ${ZLIB_LIB_HEADERS})
|
2015-12-10 10:11:06 +00:00
|
|
|
set(ZLIB_BUNDLED_LIBRARIES bundled_zlib)
|
|
|
|
set(ZLIB_BUNDLED_INCLUDE_DIR "${CMAKE_CURRENT_LIST_DIR}/zlib")
|
2016-09-29 13:28:25 +00:00
|
|
|
set_target_properties(bundled_zlib PROPERTIES FOLDER ${BUNDLED_TARGETS_FOLDER})
|
2016-09-13 12:01:38 +00:00
|
|
|
endif()
|
2015-12-10 10:11:06 +00:00
|
|
|
|
|
|
|
#-----------------------------------------------------------------
|
|
|
|
# Build bundled MiniZip library
|
|
|
|
#-----------------------------------------------------------------
|
2016-10-26 20:01:11 +00:00
|
|
|
if(BUNDLED_MINIZIP AND (BUILD_CLIENT OR BUILD_SERVER))
|
2015-12-10 10:11:06 +00:00
|
|
|
set(MINIZIP_LIB "${CMAKE_CURRENT_LIST_DIR}/minizip")
|
|
|
|
|
|
|
|
FILE(GLOB MINIZIP_LIB_HEADERS
|
|
|
|
${MINIZIP_LIB}/crypt.h
|
|
|
|
${MINIZIP_LIB}/ioapi.h
|
|
|
|
${MINIZIP_LIB}/unzip.h
|
|
|
|
)
|
|
|
|
|
|
|
|
FILE(GLOB MINIZIP_LIB_SRC
|
|
|
|
${MINIZIP_LIB}/ioapi.c
|
|
|
|
${MINIZIP_LIB}/unzip.c
|
|
|
|
)
|
|
|
|
|
2016-01-04 19:37:10 +00:00
|
|
|
add_library(bundled_minizip STATIC ${MINIZIP_LIB_SRC} ${MINIZIP_LIB_HEADERS})
|
2015-12-10 11:31:23 +00:00
|
|
|
if(BUNDLED_ZLIB)
|
|
|
|
target_link_libraries(bundled_minizip bundled_zlib)
|
|
|
|
endif(BUNDLED_ZLIB)
|
2015-12-10 10:11:06 +00:00
|
|
|
set(MINIZIP_BUNDLED_LIBRARIES bundled_minizip)
|
|
|
|
set(MINIZIP_BUNDLED_INCLUDE_DIR "${CMAKE_CURRENT_LIST_DIR}/minizip")
|
2016-09-29 13:28:25 +00:00
|
|
|
set_target_properties(bundled_minizip PROPERTIES FOLDER ${BUNDLED_TARGETS_FOLDER})
|
2016-09-13 12:01:38 +00:00
|
|
|
endif()
|
2015-12-10 10:11:06 +00:00
|
|
|
|
2013-05-14 20:56:06 +00:00
|
|
|
#-----------------------------------------------------------------
|
|
|
|
# Build bundled GLEW library
|
|
|
|
#-----------------------------------------------------------------
|
2016-09-13 12:01:38 +00:00
|
|
|
if(BUNDLED_GLEW AND BUILD_CLIENT)
|
2014-10-07 15:40:35 +00:00
|
|
|
include(${CMAKE_CURRENT_LIST_DIR}/glew/CMakeLists.txt)
|
|
|
|
set(BUNDLED_GLEW_LIBRARIES bundled_glew)
|
|
|
|
set(BUNDLED_GLEW_INCLUDE_DIR "${CMAKE_CURRENT_LIST_DIR}/glew/include")
|
2016-09-29 13:28:25 +00:00
|
|
|
set_target_properties(bundled_glew PROPERTIES FOLDER ${BUNDLED_TARGETS_FOLDER})
|
2016-09-13 12:01:38 +00:00
|
|
|
endif()
|
2013-12-04 10:05:00 +00:00
|
|
|
|
2015-12-12 21:34:24 +00:00
|
|
|
#-----------------------------------------------------------------
|
|
|
|
# Build bundled SQLITE3 library
|
|
|
|
#-----------------------------------------------------------------
|
2019-04-13 08:35:48 +00:00
|
|
|
if(BUNDLED_SQLITE3 AND (BUILD_CLIENT OR BUILD_SERVER OR BUILD_MOD))
|
2015-12-12 21:34:24 +00:00
|
|
|
include(${CMAKE_CURRENT_LIST_DIR}/sqlite3/CMakeLists.txt)
|
|
|
|
set(SQLITE3_BUNDLED_LIBRARIES bundled_sqlite3)
|
|
|
|
set(SQLITE3_BUNDLED_INCLUDE_DIR "${CMAKE_CURRENT_LIST_DIR}/sqlite3/src")
|
2016-09-29 13:28:25 +00:00
|
|
|
set_target_properties(bundled_sqlite3 PROPERTIES FOLDER ${BUNDLED_TARGETS_FOLDER})
|
2019-12-21 14:40:49 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
#-----------------------------------------------------------------
|
|
|
|
# Build bundled PNG library
|
|
|
|
#-----------------------------------------------------------------
|
|
|
|
if(BUNDLED_PNG AND BUILD_CLIENT)
|
|
|
|
set(binary_dir "${LIBS_BINARYDIR_DIR}/libpng")
|
|
|
|
if(VSTUDIO)
|
|
|
|
set(PNG_BUNDLED_LIBRARIES optimized "${binary_dir}/Release/libpng${CMAKE_STATIC_LIBRARY_SUFFIX}" debug "${binary_dir}/Debug/libpng${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
|
|
|
elseif(VS_BUILD_BUILD)
|
|
|
|
set(PNG_BUNDLED_LIBRARIES "${binary_dir}/libpng${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
|
|
|
else()
|
|
|
|
set(PNG_BUNDLED_LIBRARIES "${binary_dir}/libpng${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(BUNDLED_ZLIB)
|
|
|
|
set(ZLIB_INCLUDE_DIR "${CMAKE_CURRENT_LIST_DIR}/zlib")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
ExternalProject_Add(bundled_png
|
|
|
|
SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/libpng
|
|
|
|
BINARY_DIR ${LIBS_BINARYDIR_DIR}/libpng
|
|
|
|
CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
|
|
|
|
-DCMAKE_CXX_FLAGS_DEBUG=${CMAKE_CXX_FLAGS_DEBUG} -DCMAKE_CXX_FLAGS_RELEASE=${CMAKE_CXX_FLAGS_RELEASE}
|
|
|
|
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} -DPNG_SHARED=OFF -DPNG_STATIC=ON -DPNG_BUILD_ZLIB=ON -DZLIB_INCLUDE_DIR=${ZLIB_INCLUDE_DIR}
|
|
|
|
-DPNG_TESTS=OFF -DPNG_FRAMEWORK=OFF -DPNG_DEBUG=OFF -DPNG_HARDWARE_OPTIMIZATIONS=ON
|
|
|
|
INSTALL_COMMAND ""
|
|
|
|
)
|
|
|
|
|
|
|
|
#ExternalProject_Get_Property(bundled_png binary_dir)
|
|
|
|
|
|
|
|
set(PNG_BUNDLED_INCLUDE_DIR "${CMAKE_CURRENT_LIST_DIR}/libpng/include")
|
|
|
|
set_target_properties(bundled_png PROPERTIES FOLDER ${BUNDLED_TARGETS_FOLDER})
|
2017-02-03 21:05:55 +00:00
|
|
|
endif()
|
2015-11-06 14:19:38 +00:00
|
|
|
|
2014-10-07 15:40:35 +00:00
|
|
|
#-----------------------------------------------------------------
|
|
|
|
# Build bundled Freetype library
|
|
|
|
#-----------------------------------------------------------------
|
2016-09-13 12:01:38 +00:00
|
|
|
if(BUNDLED_FREETYPE AND BUILD_CLIENT)
|
2019-10-20 18:31:38 +00:00
|
|
|
set(binary_dir "${LIBS_BINARYDIR_DIR}/freetype")
|
|
|
|
if(VSTUDIO)
|
|
|
|
set(BUNDLED_FREETYPE_LIBRARIES optimized "${binary_dir}/Release/freetype${CMAKE_STATIC_LIBRARY_SUFFIX}" debug "${binary_dir}/Debug/freetype${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
|
|
|
elseif(VS_BUILD)
|
|
|
|
set(BUNDLED_FREETYPE_LIBRARIES "${binary_dir}/freetype${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
|
|
|
else()
|
|
|
|
set(BUNDLED_FREETYPE_LIBRARIES "${binary_dir}/libfreetype${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
|
|
|
endif()
|
2018-12-18 18:42:00 +00:00
|
|
|
|
2013-12-04 10:05:00 +00:00
|
|
|
ExternalProject_Add(bundled_freetype
|
2014-10-07 15:40:35 +00:00
|
|
|
SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/freetype
|
2019-10-20 18:31:38 +00:00
|
|
|
BINARY_DIR ${binary_dir}
|
|
|
|
BUILD_BYPRODUCTS ${BUNDLED_FREETYPE_LIBRARIES}
|
2017-11-14 18:27:22 +00:00
|
|
|
CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
|
|
|
|
-DCMAKE_CXX_FLAGS_DEBUG=${CMAKE_CXX_FLAGS_DEBUG} -DCMAKE_CXX_FLAGS_RELEASE=${CMAKE_CXX_FLAGS_RELEASE}
|
2019-11-02 21:23:33 +00:00
|
|
|
-DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} -DCMAKE_OSX_DEPLOYMENT_TARGET="${CMAKE_OSX_DEPLOYMENT_TARGET}"
|
2018-12-18 18:42:00 +00:00
|
|
|
-DCMAKE_DISABLE_FIND_PACKAGE_ZLIB=ON -DCMAKE_DISABLE_FIND_PACKAGE_BZip2=ON -DCMAKE_DISABLE_FIND_PACKAGE_PNG=ON -DCMAKE_DISABLE_FIND_PACKAGE_HarfBuzz=ON
|
|
|
|
-DFT_WITH_ZLIB=OFF -DFT_WITH_BZIP2=OFF -DFT_WITH_PNG=OFF -DFT_WITH_HARFBUZZ=OFF -DDISABLE_FORCE_DEBUG_POSTFIX=ON
|
2013-12-04 10:05:00 +00:00
|
|
|
INSTALL_COMMAND ""
|
|
|
|
)
|
2013-12-31 10:29:38 +00:00
|
|
|
|
2019-10-20 18:31:38 +00:00
|
|
|
# ExternalProject_Get_Property(bundled_freetype binary_dir)
|
2013-12-31 10:29:38 +00:00
|
|
|
|
2014-10-07 15:40:35 +00:00
|
|
|
set(BUNDLED_FREETYPE_INCLUDE_DIR "${CMAKE_CURRENT_LIST_DIR}/freetype/include")
|
2016-09-29 13:28:25 +00:00
|
|
|
set_target_properties(bundled_freetype PROPERTIES FOLDER ${BUNDLED_TARGETS_FOLDER})
|
2016-09-13 12:01:38 +00:00
|
|
|
endif()
|
2014-05-06 13:13:10 +00:00
|
|
|
|
2015-12-12 21:34:24 +00:00
|
|
|
#-----------------------------------------------------------------
|
|
|
|
# Build bundled Theora library
|
|
|
|
#-----------------------------------------------------------------
|
2016-09-13 12:01:38 +00:00
|
|
|
if(BUNDLED_THEORA AND BUILD_CLIENT)
|
2015-09-30 08:21:16 +00:00
|
|
|
FILE(GLOB THEORA_SRC
|
|
|
|
"${CMAKE_CURRENT_LIST_DIR}/theora/lib/*.c"
|
|
|
|
"${CMAKE_CURRENT_LIST_DIR}/theora/lib/*.h"
|
|
|
|
)
|
|
|
|
|
2016-01-15 15:37:28 +00:00
|
|
|
# This makes the MSVC build a happier camper
|
2015-09-30 08:59:34 +00:00
|
|
|
LIST(REMOVE_ITEM THEORA_SRC ${CMAKE_CURRENT_LIST_DIR}/theora/lib/encoder_disabled.c)
|
|
|
|
|
2015-09-30 08:21:16 +00:00
|
|
|
if(32BITS)
|
|
|
|
add_definitions("-DOC_X86_ASM")
|
|
|
|
if(MSVC)
|
|
|
|
FILE(GLOB THEORA_ASM_SRC
|
|
|
|
"${CMAKE_CURRENT_LIST_DIR}/theora/lib/x86_vc/*.c"
|
|
|
|
"${CMAKE_CURRENT_LIST_DIR}/theora/lib/x86_vc/*.h"
|
|
|
|
)
|
|
|
|
else()
|
|
|
|
FILE(GLOB THEORA_ASM_SRC
|
|
|
|
"${CMAKE_CURRENT_LIST_DIR}/theora/lib/x86/*.c"
|
|
|
|
"${CMAKE_CURRENT_LIST_DIR}/theora/lib/x86/*.h"
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
LIST(APPEND THEORA_SRC ${THEORA_ASM_SRC})
|
|
|
|
endif()
|
|
|
|
|
2015-09-30 09:33:07 +00:00
|
|
|
include_directories("${CMAKE_CURRENT_LIST_DIR}/theora/include")
|
2015-09-30 08:21:16 +00:00
|
|
|
add_library(bundled_theora STATIC ${THEORA_SRC})
|
2015-09-30 09:33:07 +00:00
|
|
|
#target_include_directories(bundled_theora PUBLIC "${CMAKE_CURRENT_LIST_DIR}/theora/include")
|
2015-09-30 09:29:34 +00:00
|
|
|
#if(UNIX AND NOT APPLE)
|
|
|
|
# target_include_directories(bundled_theora PUBLIC "${CMAKE_CURRENT_LIST_DIR}/ogg/include")
|
|
|
|
#endif()
|
2015-09-30 08:21:16 +00:00
|
|
|
|
|
|
|
set(THEORA_BUNDLED_LIBRARIES bundled_theora)
|
|
|
|
set(THEORA_BUNDLED_INCLUDE_DIR "${CMAKE_CURRENT_LIST_DIR}/theora/include")
|
2016-09-29 13:28:25 +00:00
|
|
|
set_target_properties(bundled_theora PROPERTIES FOLDER ${BUNDLED_TARGETS_FOLDER})
|
2015-09-30 08:21:16 +00:00
|
|
|
endif()
|