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)
|
|
|
|
|
2012-06-09 19:00:11 +00:00
|
|
|
if(WIN32)
|
2012-11-03 18:04:41 +00:00
|
|
|
#-----------------------------------------------------------------
|
|
|
|
# Build bundled JPEG library
|
|
|
|
#-----------------------------------------------------------------
|
2012-11-20 17:12:26 +00:00
|
|
|
if(BUNDLED_JPEG) # static
|
2013-12-03 22:24:15 +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
|
|
|
if(MSVC)
|
2015-01-24 20:54:15 +00:00
|
|
|
add_definitions ( -D_CRT_SECURE_NO_WARNINGS )
|
|
|
|
endif()
|
2013-12-03 22:24:15 +00:00
|
|
|
|
|
|
|
if(WIN32 AND NOT CYGWIN)
|
2015-01-25 00:05:54 +00:00
|
|
|
set(TWO_FILE_COMMANDLINE true)
|
2013-12-03 22:24:15 +00:00
|
|
|
endif()
|
2014-11-24 11:42:22 +00:00
|
|
|
set(WITH_JPEG8 true)
|
2014-11-21 20:54:30 +00:00
|
|
|
|
2014-11-24 11:42:22 +00:00
|
|
|
configure_file (${JPEG_LIB}/config.h.cmake ${JPEG_LIB}/config.h)
|
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
|
|
|
|
2013-12-11 10:00:26 +00:00
|
|
|
#include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
2014-11-21 20:54:30 +00:00
|
|
|
FILE(GLOB JPEG_LIB_HEADERS
|
2015-01-25 00:05:54 +00:00
|
|
|
${JPEG_LIB}/config.h
|
|
|
|
${JPEG_LIB}/jerror.h
|
|
|
|
${JPEG_LIB}/jmorecfg.h
|
|
|
|
${JPEG_LIB}/jpeglib.h
|
|
|
|
${JPEG_LIB}/jconfig.h
|
2015-01-25 09:23:48 +00:00
|
|
|
${JPEG_LIB}/jconfigint.h
|
2015-01-25 00:05:54 +00:00
|
|
|
${JPEG_LIB}/turbojpeg.h
|
2013-08-19 22:29:33 +00:00
|
|
|
)
|
2013-12-03 22:24:15 +00:00
|
|
|
|
|
|
|
FILE(GLOB JPEG_LIB_SRC
|
2015-01-25 00:05:54 +00:00
|
|
|
${JPEG_LIB}/jmemnobs.c
|
|
|
|
${JPEG_LIB}/jaricom.c
|
|
|
|
${JPEG_LIB}/jcapimin.c
|
|
|
|
${JPEG_LIB}/jcapistd.c
|
|
|
|
${JPEG_LIB}/jcarith.c
|
|
|
|
${JPEG_LIB}/jccoefct.c
|
|
|
|
${JPEG_LIB}/jccolor.c
|
|
|
|
${JPEG_LIB}/jcdctmgr.c
|
|
|
|
${JPEG_LIB}/jchuff.c
|
|
|
|
${JPEG_LIB}/jcinit.c
|
|
|
|
${JPEG_LIB}/jcmainct.c
|
|
|
|
${JPEG_LIB}/jcmarker.c
|
|
|
|
${JPEG_LIB}/jcmaster.c
|
|
|
|
${JPEG_LIB}/jcomapi.c
|
|
|
|
${JPEG_LIB}/jcparam.c
|
|
|
|
${JPEG_LIB}/jcphuff.c
|
|
|
|
${JPEG_LIB}/jcprepct.c
|
|
|
|
${JPEG_LIB}/jcsample.c
|
|
|
|
${JPEG_LIB}/jctest.c
|
|
|
|
${JPEG_LIB}/jctrans.c
|
|
|
|
${JPEG_LIB}/jdapimin.c
|
|
|
|
${JPEG_LIB}/jdapistd.c
|
|
|
|
${JPEG_LIB}/jdarith.c
|
|
|
|
${JPEG_LIB}/jdatadst.c
|
|
|
|
${JPEG_LIB}/jdatasrc.c
|
|
|
|
${JPEG_LIB}/jdcoefct.c
|
|
|
|
${JPEG_LIB}/jdcolor.c
|
|
|
|
${JPEG_LIB}/jddctmgr.c
|
|
|
|
${JPEG_LIB}/jdhuff.c
|
|
|
|
${JPEG_LIB}/jdinput.c
|
|
|
|
${JPEG_LIB}/jdmainct.c
|
|
|
|
${JPEG_LIB}/jdmarker.c
|
|
|
|
${JPEG_LIB}/jdmaster.c
|
|
|
|
${JPEG_LIB}/jdmerge.c
|
|
|
|
${JPEG_LIB}/jdphuff.c
|
|
|
|
${JPEG_LIB}/jdpostct.c
|
|
|
|
${JPEG_LIB}/jdsample.c
|
|
|
|
${JPEG_LIB}/jdtrans.c
|
|
|
|
${JPEG_LIB}/jerror.c
|
|
|
|
${JPEG_LIB}/jfdctflt.c
|
|
|
|
${JPEG_LIB}/jfdctfst.c
|
|
|
|
${JPEG_LIB}/jfdctint.c
|
|
|
|
${JPEG_LIB}/jidctflt.c
|
|
|
|
${JPEG_LIB}/jidctfst.c
|
|
|
|
${JPEG_LIB}/jidctint.c
|
|
|
|
${JPEG_LIB}/jidctred.c
|
|
|
|
${JPEG_LIB}/jmemmgr.c
|
|
|
|
${JPEG_LIB}/jmemnobs.c
|
|
|
|
${JPEG_LIB}/jquant1.c
|
|
|
|
${JPEG_LIB}/jquant2.c
|
|
|
|
${JPEG_LIB}/jsimd_none.c
|
|
|
|
${JPEG_LIB}/jutils.c
|
|
|
|
${JPEG_LIB}/turbojpeg.c
|
|
|
|
${JPEG_LIB}/cderror.h
|
|
|
|
${JPEG_LIB}/cdjpeg.h
|
|
|
|
${JPEG_LIB}/jdct.h
|
|
|
|
${JPEG_LIB}/jinclude.h
|
|
|
|
${JPEG_LIB}/jmemsys.h
|
|
|
|
${JPEG_LIB}/jpegint.h
|
|
|
|
${JPEG_LIB}/jpeg_nbits_table.h
|
|
|
|
${JPEG_LIB}/jversion.h
|
|
|
|
${JPEG_LIB}/transupp.h
|
2013-08-19 22:29:33 +00:00
|
|
|
)
|
2013-08-11 00:10:17 +00:00
|
|
|
|
2014-10-07 15:40:35 +00:00
|
|
|
add_library (bundled_jpeg STATIC ${JPEG_LIB_SRC} ${JPEG_LIB_HEADERS})
|
|
|
|
set(JPEG_BUNDLED_LIBRARIES bundled_jpeg)
|
2014-11-24 11:42:22 +00:00
|
|
|
set(JPEG_BUNDLED_INCLUDE_DIR "${CMAKE_CURRENT_LIST_DIR}/jpegturbo")
|
2012-11-20 17:12:26 +00:00
|
|
|
endif(BUNDLED_JPEG)
|
2012-06-19 11:08:53 +00:00
|
|
|
|
2015-01-24 20:54:15 +00:00
|
|
|
|
2012-11-03 18:04:41 +00:00
|
|
|
#-----------------------------------------------------------------
|
|
|
|
# Build bundled cURL library
|
|
|
|
#-----------------------------------------------------------------
|
2012-11-20 17:12:26 +00:00
|
|
|
if(BUNDLED_CURL) # DLL
|
2013-12-03 22:24:15 +00:00
|
|
|
ExternalProject_Add(bundled_curl
|
2014-10-07 15:40:35 +00:00
|
|
|
SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/curl
|
|
|
|
BINARY_DIR ${LIBS_BINARYDIR_DIR}/curl
|
2015-03-05 11:01:11 +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} -DBUILD_CURL_EXE=0 -DBUILD_CURL_TESTS=0 -DCURL_STATICLIB=1 -DCURL_USE_ARES=0 -DCURL_ZLIB=0 -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
|
|
|
|
2013-12-31 10:29:38 +00:00
|
|
|
ExternalProject_Get_Property(bundled_curl binary_dir)
|
|
|
|
|
2014-09-15 20:43:28 +00:00
|
|
|
if(VSTUDIO)
|
2014-10-07 15:40:35 +00:00
|
|
|
set(CURL_BUNDLED_LIBRARY optimized "${binary_dir}/lib/Release/libcurl${CMAKE_STATIC_LIBRARY_SUFFIX}" debug "${binary_dir}/lib/Debug/libcurl${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
2015-07-22 09:23:15 +00:00
|
|
|
elseif(MINGW)
|
|
|
|
set(CURL_BUNDLED_LIBRARY "${binary_dir}/lib/libcurl${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
2014-09-15 20:43:28 +00:00
|
|
|
else(VSTUDIO)
|
2014-10-07 15:40:35 +00:00
|
|
|
set(CURL_BUNDLED_LIBRARY "${binary_dir}/libcurl${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
2014-09-15 20:43:28 +00:00
|
|
|
endif(VSTUDIO)
|
2015-07-22 09:23:15 +00:00
|
|
|
|
2014-10-07 15:40:35 +00:00
|
|
|
set(CURL_BUNDLED_INCLUDE_DIR "${CMAKE_CURRENT_LIST_DIR}/curl/include")
|
2012-11-20 17:12:26 +00:00
|
|
|
endif(BUNDLED_CURL)
|
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
|
|
|
#-----------------------------------------------------------------
|
2013-01-31 17:11:45 +00:00
|
|
|
if(BUNDLED_LUA)
|
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
|
2014-11-05 10:39:38 +00:00
|
|
|
#core
|
2013-12-03 22:24:15 +00:00
|
|
|
${LUA_LIB}/lapi.c
|
|
|
|
${LUA_LIB}/lcode.c
|
2014-11-05 10:39:38 +00:00
|
|
|
${LUA_LIB}/lctype.c
|
2013-12-03 22:24:15 +00:00
|
|
|
${LUA_LIB}/ldebug.c
|
|
|
|
${LUA_LIB}/ldo.c
|
|
|
|
${LUA_LIB}/ldump.c
|
|
|
|
${LUA_LIB}/lfunc.c
|
|
|
|
${LUA_LIB}/lgc.c
|
|
|
|
${LUA_LIB}/llex.c
|
|
|
|
${LUA_LIB}/lmem.c
|
|
|
|
${LUA_LIB}/lobject.c
|
|
|
|
${LUA_LIB}/lopcodes.c
|
|
|
|
${LUA_LIB}/lparser.c
|
|
|
|
${LUA_LIB}/lstate.c
|
|
|
|
${LUA_LIB}/lstring.c
|
|
|
|
${LUA_LIB}/ltable.c
|
|
|
|
${LUA_LIB}/ltm.c
|
|
|
|
${LUA_LIB}/lundump.c
|
|
|
|
${LUA_LIB}/lvm.c
|
|
|
|
${LUA_LIB}/lzio.c
|
2014-11-05 10:39:38 +00:00
|
|
|
#lib
|
2013-12-03 22:24:15 +00:00
|
|
|
${LUA_LIB}/lauxlib.c
|
|
|
|
${LUA_LIB}/lbaselib.c
|
2014-11-05 10:39:38 +00:00
|
|
|
${LUA_LIB}/lbitlib.c
|
|
|
|
${LUA_LIB}/lcorolib.c
|
2013-12-03 22:24:15 +00:00
|
|
|
${LUA_LIB}/ldblib.c
|
2015-07-04 19:37:44 +00:00
|
|
|
${LUA_LIB}/linit.c
|
2013-12-03 22:24:15 +00:00
|
|
|
${LUA_LIB}/liolib.c
|
|
|
|
${LUA_LIB}/lmathlib.c
|
2015-07-04 19:37:44 +00:00
|
|
|
${LUA_LIB}/loadlib.c
|
2013-12-03 22:24:15 +00:00
|
|
|
${LUA_LIB}/loslib.c
|
|
|
|
${LUA_LIB}/lstrlib.c
|
2014-11-05 10:39:38 +00:00
|
|
|
${LUA_LIB}/ltablib.c
|
2015-07-04 19:37:44 +00:00
|
|
|
${LUA_LIB}/lutf8lib.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
|
|
|
|
|
|
|
# If LUA_ANSI is enabled on windows the library loading functionality is disabled
|
|
|
|
if(NOT WIN32)
|
|
|
|
set_target_properties(bundled_lua
|
|
|
|
PROPERTIES COMPILE_DEFINITIONS "LUA_ANSI"
|
|
|
|
)
|
|
|
|
endif()
|
2013-12-03 22:24:15 +00:00
|
|
|
|
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")
|
2012-11-20 17:12:26 +00:00
|
|
|
endif(BUNDLED_LUA)
|
2012-11-17 21:59:27 +00:00
|
|
|
|
2012-11-03 18:04:41 +00:00
|
|
|
#-----------------------------------------------------------------
|
|
|
|
# Copy bundled SDL library to the etl.exe location
|
|
|
|
#-----------------------------------------------------------------
|
2012-11-20 17:12:26 +00:00
|
|
|
if(BUNDLED_SDL) # DLL
|
2014-10-07 15:40:35 +00:00
|
|
|
add_custom_target(bundled_sdl) # Dummy target just so cmake does not print warnings
|
2015-07-22 09:23:15 +00:00
|
|
|
# Enable the SDL2main when the windows main function has been removed....
|
2014-10-08 14:46:16 +00:00
|
|
|
if(WIN64)
|
|
|
|
file(COPY ${CMAKE_CURRENT_LIST_DIR}/sdl2-windows/lib/x64/SDL2.dll DESTINATION ${CMAKE_BINARY_DIR})
|
2015-08-10 08:39:48 +00:00
|
|
|
install(FILES "${CMAKE_CURRENT_LIST_DIR}/sdl2-windows/lib/x64/SDL2.dll" DESTINATION "${INSTALL_DEFAULT_BINDIR}")
|
2014-10-08 14:46:16 +00:00
|
|
|
set(SDL32_BUNDLED_LIBRARIES
|
|
|
|
"${CMAKE_CURRENT_LIST_DIR}/sdl2-windows/lib/x64/SDL2.lib"
|
2015-07-22 09:23:15 +00:00
|
|
|
#"${CMAKE_CURRENT_LIST_DIR}/sdl2-windows/lib/x64/SDL2main.lib"
|
|
|
|
)
|
2014-10-08 14:46:16 +00:00
|
|
|
set(SDL32_BUNDLED_INCLUDE_DIR "${CMAKE_CURRENT_LIST_DIR}/sdl2/include")
|
|
|
|
else(WIN64)
|
|
|
|
file(COPY ${CMAKE_CURRENT_LIST_DIR}/sdl2-windows/lib/x86/SDL2.dll DESTINATION ${CMAKE_BINARY_DIR})
|
2015-08-10 08:39:48 +00:00
|
|
|
install(FILES "${CMAKE_CURRENT_LIST_DIR}/sdl2-windows/lib/x86/SDL2.dll" DESTINATION "${INSTALL_DEFAULT_BINDIR}")
|
2014-10-08 14:46:16 +00:00
|
|
|
set(SDL32_BUNDLED_LIBRARIES
|
|
|
|
"${CMAKE_CURRENT_LIST_DIR}/sdl2-windows/lib/x86/SDL2.lib"
|
2015-07-22 09:23:15 +00:00
|
|
|
#"${CMAKE_CURRENT_LIST_DIR}/sdl2-windows/lib/x86/SDL2main.lib"
|
|
|
|
)
|
2014-10-08 14:46:16 +00:00
|
|
|
set(SDL32_BUNDLED_INCLUDE_DIR "${CMAKE_CURRENT_LIST_DIR}/sdl2/include")
|
|
|
|
endif(WIN64)
|
2012-11-20 17:12:26 +00:00
|
|
|
endif(BUNDLED_SDL)
|
2012-11-17 21:59:27 +00:00
|
|
|
|
2013-01-24 15:44:19 +00:00
|
|
|
#-----------------------------------------------------------------
|
|
|
|
# Build bundled OGG and Vorbis file library
|
|
|
|
#-----------------------------------------------------------------
|
|
|
|
if(BUNDLED_OGG_VORBIS)
|
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")
|
|
|
|
# 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
|
|
|
|
# so configure_types.h will be regenerated.
|
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
)
|
|
|
|
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
|
|
|
|
${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
|
2013-12-03 22:24:15 +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
|
|
|
|
)
|
|
|
|
|
|
|
|
SET(VORBIS_PUB_HEADERS
|
|
|
|
${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)
|
2013-12-03 22:24:15 +00:00
|
|
|
LIST(APPEND VORBIS_SRC ${VPATH}/win32/vorbis.def)
|
|
|
|
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)
|
|
|
|
|
|
|
|
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")
|
2013-01-24 15:44:19 +00:00
|
|
|
endif(BUNDLED_OGG_VORBIS)
|
2014-11-21 20:54:30 +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)
|
2012-11-17 21:59:27 +00:00
|
|
|
set(CROSS_COMPILE32_FLAGS CFLAGS=-m32 LDFLAGS=-m32)
|
2012-11-03 18:04:41 +00:00
|
|
|
else(CROSS_COMPILE32)
|
2014-11-21 20:54:30 +00:00
|
|
|
|
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
|
|
|
|
set(CROSS_COMPILE32_FLAGS "CFLAGS=-fPIC")
|
|
|
|
|
2012-11-03 18:04:41 +00:00
|
|
|
endif(CROSS_COMPILE32)
|
2012-06-13 14:27:47 +00:00
|
|
|
|
2012-11-03 18:04:41 +00:00
|
|
|
#-----------------------------------------------------------------
|
|
|
|
# Build bundled cURL library
|
|
|
|
#-----------------------------------------------------------------
|
2012-11-20 17:12:26 +00:00
|
|
|
if(BUNDLED_CURL)
|
2014-10-07 15:40:35 +00:00
|
|
|
add_custom_command(OUTPUT ${CMAKE_CURRENT_LIST_DIR}/curl/lib/.libs/libcurl.a
|
2012-12-14 00:44:00 +00:00
|
|
|
COMMAND make clean || true
|
2012-11-20 17:12:26 +00:00
|
|
|
COMMAND ${CROSS_COMPILE32_FLAGS} ./configure
|
|
|
|
--enable-shared=no --enable-static=yes
|
|
|
|
--without-libssh2 --enable-http --enable-ftp
|
|
|
|
--disable-gopher --enable-file --disable-ldap
|
|
|
|
--disable-dict --disable-telnet --disable-manual
|
|
|
|
--enable-libgcc --disable-ipv6 --disable-ares
|
|
|
|
--without-ssl --without-zlib --without-libidn
|
|
|
|
--without-librtmp && make
|
2014-10-07 15:40:35 +00:00
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/curl
|
2012-11-20 17:12:26 +00:00
|
|
|
)
|
|
|
|
add_custom_target(bundled_curl
|
2014-10-07 15:40:35 +00:00
|
|
|
DEPENDS ${CMAKE_CURRENT_LIST_DIR}/curl/lib/.libs/libcurl.a
|
2012-11-20 17:12:26 +00:00
|
|
|
)
|
2014-10-07 15:40:35 +00:00
|
|
|
set(CURL_BUNDLED_LIBRARY "${CMAKE_CURRENT_LIST_DIR}/curl/lib/.libs/libcurl.a")
|
|
|
|
set(CURL_BUNDLED_INCLUDE_DIR "${CMAKE_CURRENT_LIST_DIR}/curl/include")
|
2012-11-20 17:12:26 +00:00
|
|
|
endif(BUNDLED_CURL)
|
2014-11-21 20:54:30 +00:00
|
|
|
|
2012-11-03 18:04:41 +00:00
|
|
|
#-----------------------------------------------------------------
|
|
|
|
# Build bundled JPEG library
|
|
|
|
#-----------------------------------------------------------------
|
2012-11-20 17:12:26 +00:00
|
|
|
if(BUNDLED_JPEG)
|
2014-11-22 01:02:05 +00:00
|
|
|
if(CROSS_COMPILE32)
|
2014-12-20 22:54:05 +00:00
|
|
|
if(APPLE)
|
2014-12-21 14:24:25 +00:00
|
|
|
SET(JPEG_TURBO_BUILD ${CROSS_COMPILE32_FLAGS} ./configure --with-jpeg8 --build i686-apple-darwin && make)
|
2014-12-20 22:54:05 +00:00
|
|
|
else()
|
2014-12-21 14:24:25 +00:00
|
|
|
SET(JPEG_TURBO_BUILD ${CROSS_COMPILE32_FLAGS} ./configure --with-jpeg8 --build i686-pc-linux-gnu && make)
|
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)
|
|
|
|
SET(JPEG_TURBO_BUILD ${CROSS_COMPILE32_FLAGS} ./configure --with-jpeg8 --build x86_64-apple-darwin && make)
|
|
|
|
else()
|
|
|
|
SET(JPEG_TURBO_BUILD ${CROSS_COMPILE32_FLAGS} ./configure --with-jpeg8 && make)
|
|
|
|
endif()
|
2014-11-22 01:02:05 +00:00
|
|
|
endif()
|
2014-12-21 14:24:25 +00:00
|
|
|
|
|
|
|
add_custom_command(OUTPUT ${CMAKE_CURRENT_LIST_DIR}/jpegturbo/.libs/libturbojpeg.a
|
|
|
|
COMMAND make clean || true
|
|
|
|
COMMAND ${JPEG_TURBO_BUILD}
|
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/jpegturbo
|
|
|
|
)
|
|
|
|
|
2012-11-20 17:12:26 +00:00
|
|
|
add_custom_target(bundled_jpeg
|
2014-11-22 01:02:05 +00:00
|
|
|
DEPENDS ${CMAKE_CURRENT_LIST_DIR}/jpegturbo/.libs/libturbojpeg.a
|
2012-11-20 17:12:26 +00:00
|
|
|
)
|
2014-11-22 01:02:05 +00:00
|
|
|
set(JPEG_BUNDLED_LIBRARIES "${CMAKE_CURRENT_LIST_DIR}/jpegturbo/.libs/libturbojpeg.a")
|
|
|
|
set(JPEG_BUNDLED_INCLUDE_DIR "${CMAKE_CURRENT_LIST_DIR}/jpegturbo")
|
2012-11-20 17:12:26 +00:00
|
|
|
endif(BUNDLED_JPEG)
|
2012-06-09 19:00:11 +00:00
|
|
|
|
2012-11-03 18:04:41 +00:00
|
|
|
#-----------------------------------------------------------------
|
|
|
|
# Build bundled SDL library
|
|
|
|
#-----------------------------------------------------------------
|
2012-11-20 17:12:26 +00:00
|
|
|
if(BUNDLED_SDL)
|
2014-10-07 15:40:35 +00:00
|
|
|
add_custom_command(OUTPUT ${CMAKE_CURRENT_LIST_DIR}/sdl2/build/.libs/libSDL2.a
|
2014-09-02 22:56:33 +00:00
|
|
|
COMMAND make clean || true
|
|
|
|
COMMAND ${CROSS_COMPILE32_FLAGS} ./configure && make
|
2014-10-07 15:40:35 +00:00
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/sdl2
|
2014-09-02 22:56:33 +00:00
|
|
|
)
|
|
|
|
add_custom_target(bundled_sdl
|
2014-10-07 15:40:35 +00:00
|
|
|
DEPENDS ${CMAKE_CURRENT_LIST_DIR}/sdl2/build/.libs/libSDL2.a
|
2014-09-02 22:56:33 +00:00
|
|
|
)
|
|
|
|
if(CMAKE_SYSTEM MATCHES "Darwin")
|
2014-10-07 15:40:35 +00:00
|
|
|
set(SDL32_BUNDLED_LIBRARIES ${SDL32_BUNDLED_LIBRARIES} "${CMAKE_CURRENT_LIST_DIR}/sdl2/build/libSDL2main.a")
|
2014-09-02 22:56:33 +00:00
|
|
|
endif(CMAKE_SYSTEM MATCHES "Darwin")
|
2014-10-07 15:40:35 +00:00
|
|
|
set(SDL32_BUNDLED_LIBRARIES ${SDL32_BUNDLED_LIBRARIES} "${CMAKE_CURRENT_LIST_DIR}/sdl2/build/.libs/libSDL2.a")
|
|
|
|
set(SDL32_BUNDLED_INCLUDE_DIR "${CMAKE_CURRENT_LIST_DIR}/sdl2/include")
|
2012-11-20 17:12:26 +00:00
|
|
|
endif(BUNDLED_SDL)
|
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
|
2012-11-20 17:12:26 +00:00
|
|
|
if(BUNDLED_LUA)
|
|
|
|
if(CMAKE_SYSTEM MATCHES "OpenBSD*")
|
|
|
|
set(LUA_MAKE_TARGET "bsd")
|
2012-11-17 21:59:27 +00:00
|
|
|
else()
|
2012-11-20 17:12:26 +00:00
|
|
|
if(NOT CROSS_COMPILE32)
|
2013-01-24 22:45:32 +00:00
|
|
|
set(LUA_MAKE_TARGET "posix")
|
2012-11-20 17:12:26 +00:00
|
|
|
else()
|
2013-01-24 22:45:32 +00:00
|
|
|
set(LUA_MAKE_TARGET "posix32bit")
|
2012-11-20 17:12:26 +00:00
|
|
|
endif()
|
2012-11-17 21:59:27 +00:00
|
|
|
endif()
|
2014-10-07 15:40:35 +00:00
|
|
|
add_custom_command(OUTPUT ${CMAKE_CURRENT_LIST_DIR}/lua/src/liblua.a
|
2012-12-14 00:44:00 +00:00
|
|
|
COMMAND make clean || true
|
2012-11-20 17:12:26 +00:00
|
|
|
COMMAND ${CROSS_COMPILE32_FLAGS} make ${LUA_MAKE_TARGET}
|
2014-10-22 14:26:47 +00:00
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/lua/src
|
2012-11-20 17:12:26 +00:00
|
|
|
)
|
2014-10-07 15:40:35 +00:00
|
|
|
set(LUA_BUNDLED_LIBRARIES "${CMAKE_CURRENT_LIST_DIR}/lua/src/liblua.a")
|
2014-10-23 13:07:04 +00:00
|
|
|
set(LUA_BUNDLED_INCLUDE_DIR "${CMAKE_CURRENT_LIST_DIR}/lua/src")
|
2012-11-20 17:12:26 +00:00
|
|
|
|
|
|
|
add_custom_target(bundled_lua
|
2014-10-07 15:40:35 +00:00
|
|
|
DEPENDS ${CMAKE_CURRENT_LIST_DIR}/lua/src/liblua.a
|
2012-11-20 17:12:26 +00:00
|
|
|
)
|
|
|
|
endif(BUNDLED_LUA)
|
2013-01-24 15:44:19 +00:00
|
|
|
|
|
|
|
#-----------------------------------------------------------------
|
|
|
|
# Build bundled OGG and Vorbis file library
|
|
|
|
#-----------------------------------------------------------------
|
|
|
|
if(BUNDLED_OGG_VORBIS)
|
|
|
|
# OGG
|
2014-10-07 15:40:35 +00:00
|
|
|
add_custom_command(OUTPUT ${CMAKE_CURRENT_LIST_DIR}/ogg/src/.libs/libogg.a
|
2013-01-24 15:44:19 +00:00
|
|
|
COMMAND make clean || true
|
2015-07-12 17:27:13 +00:00
|
|
|
COMMAND ./autogen.sh
|
2013-01-24 15:44:19 +00:00
|
|
|
COMMAND ${CROSS_COMPILE32_FLAGS} ./configure && make
|
2014-10-07 15:40:35 +00:00
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/ogg
|
2013-01-24 15:44:19 +00:00
|
|
|
)
|
|
|
|
add_custom_target(bundled_ogg
|
2014-10-07 15:40:35 +00:00
|
|
|
DEPENDS ${CMAKE_CURRENT_LIST_DIR}/ogg/src/.libs/libogg.a
|
2013-01-24 15:44:19 +00:00
|
|
|
)
|
2014-10-07 15:40:35 +00:00
|
|
|
set(OGG_BUNDLED_LIBRARIES "${CMAKE_CURRENT_LIST_DIR}/ogg/src/.libs/libogg.a")
|
|
|
|
set(OGG_BUNDLED_INCLUDE_DIR "${CMAKE_CURRENT_LIST_DIR}/ogg/include")
|
2013-01-24 15:44:19 +00:00
|
|
|
|
|
|
|
# OGG Vorbis File
|
2015-07-12 17:27:13 +00:00
|
|
|
set(CFLAGS "${CFLAGS} -I${CMAKE_CURRENT_LIST_DIR}/ogg/include")
|
|
|
|
set(LDFLAGS "${LDFLAGS} -L${CMAKE_CURRENT_LIST_DIR}/ogg/src/.libs")
|
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
|
2013-01-24 15:44:19 +00:00
|
|
|
add_custom_command(
|
2014-10-07 15:40:35 +00:00
|
|
|
OUTPUT ${CMAKE_CURRENT_LIST_DIR}/vorbis/lib/.libs/libvorbisfile.a
|
2013-01-24 15:44:19 +00:00
|
|
|
COMMAND make clean || true
|
2015-07-16 12:06:03 +00:00
|
|
|
COMMAND ${CROSS_COMPILE32_FLAGS} ./configure --disable-oggtest --with-ogg-includes=${CMAKE_CURRENT_LIST_DIR}/ogg/include --with-ogg-libraries=${CMAKE_CURRENT_LIST_DIR}/ogg/src/.libs && make
|
2014-10-07 15:40:35 +00:00
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/vorbis
|
2013-01-24 15:44:19 +00:00
|
|
|
)
|
2015-01-24 21:47:22 +00:00
|
|
|
add_custom_target(bundled_ogg_vorbis_file
|
2014-10-07 15:40:35 +00:00
|
|
|
DEPENDS ${CMAKE_CURRENT_LIST_DIR}/vorbis/lib/.libs/libvorbisfile.a
|
2015-01-24 21:47:22 +00:00
|
|
|
)
|
|
|
|
add_custom_target(bundled_ogg_vorbis
|
2014-10-07 15:40:35 +00:00
|
|
|
DEPENDS ${CMAKE_CURRENT_LIST_DIR}/vorbis/lib/.libs/libvorbis.a
|
2013-01-24 15:44:19 +00:00
|
|
|
)
|
2015-01-24 21:47:22 +00:00
|
|
|
add_dependencies(bundled_ogg_vorbis_file bundled_ogg)
|
|
|
|
add_dependencies(bundled_ogg_vorbis bundled_ogg_vorbis_file)
|
2014-10-07 15:40:35 +00:00
|
|
|
set(OGG_VORBIS_BUNDLED_LIBRARIES "${CMAKE_CURRENT_LIST_DIR}/vorbis/lib/.libs/libvorbisfile.a" "${CMAKE_CURRENT_LIST_DIR}/vorbis/lib/.libs/libvorbis.a")
|
|
|
|
set(OGG_VORBIS_BUNDLED_INCLUDE_DIR "${CMAKE_CURRENT_LIST_DIR}/vorbis/include")
|
2013-01-24 15:44:19 +00:00
|
|
|
endif(BUNDLED_OGG_VORBIS)
|
2012-06-09 19:00:11 +00:00
|
|
|
endif()
|
2013-05-14 20:56:06 +00:00
|
|
|
|
|
|
|
#-----------------------------------------------------------------
|
|
|
|
# Build bundled GLEW library
|
|
|
|
#-----------------------------------------------------------------
|
|
|
|
if(BUNDLED_GLEW)
|
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")
|
2013-05-14 20:56:06 +00:00
|
|
|
endif(BUNDLED_GLEW)
|
2013-12-04 10:05:00 +00:00
|
|
|
|
2014-10-07 15:40:35 +00:00
|
|
|
#-----------------------------------------------------------------
|
|
|
|
# Build bundled Freetype library
|
|
|
|
#-----------------------------------------------------------------
|
2013-12-04 10:05:00 +00:00
|
|
|
if(BUNDLED_FREETYPE)
|
|
|
|
ExternalProject_Add(bundled_freetype
|
2014-10-07 15:40:35 +00:00
|
|
|
SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/freetype
|
|
|
|
BINARY_DIR ${LIBS_BINARYDIR_DIR}/freetype
|
2014-06-03 14:06:44 +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} -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS}
|
2013-12-04 10:05:00 +00:00
|
|
|
INSTALL_COMMAND ""
|
|
|
|
)
|
2013-12-31 10:29:38 +00:00
|
|
|
|
|
|
|
ExternalProject_Get_Property(bundled_freetype binary_dir)
|
|
|
|
|
2014-09-15 20:43:28 +00:00
|
|
|
if(VSTUDIO)
|
2014-10-07 15:40:35 +00:00
|
|
|
set(BUNDLED_FREETYPE_LIBRARIES optimized "${binary_dir}/Release/freetype${CMAKE_STATIC_LIBRARY_SUFFIX}" debug "${binary_dir}/Debug/freetype${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
2014-09-15 20:43:28 +00:00
|
|
|
elseif(NMAKE_BUILD)
|
2014-10-07 15:40:35 +00:00
|
|
|
set(BUNDLED_FREETYPE_LIBRARIES "${binary_dir}/freetype${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
2014-09-15 20:43:28 +00:00
|
|
|
else(VSTUDIO)
|
2014-10-07 15:40:35 +00:00
|
|
|
set(BUNDLED_FREETYPE_LIBRARIES "${binary_dir}/libfreetype${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
2014-09-15 20:43:28 +00:00
|
|
|
endif(VSTUDIO)
|
2014-10-07 15:40:35 +00:00
|
|
|
set(BUNDLED_FREETYPE_INCLUDE_DIR "${CMAKE_CURRENT_LIST_DIR}/freetype/include")
|
2013-12-04 10:05:00 +00:00
|
|
|
endif(BUNDLED_FREETYPE)
|
2014-05-06 13:13:10 +00:00
|
|
|
|
2015-09-30 08:21:16 +00:00
|
|
|
if(BUNDLED_THEORA)
|
|
|
|
FILE(GLOB THEORA_SRC
|
|
|
|
"${CMAKE_CURRENT_LIST_DIR}/theora/lib/*.c"
|
|
|
|
"${CMAKE_CURRENT_LIST_DIR}/theora/lib/*.h"
|
|
|
|
)
|
|
|
|
|
2015-09-30 08:59:34 +00:00
|
|
|
# This makes the MSVC build a happier
|
|
|
|
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")
|
|
|
|
endif()
|
|
|
|
|
2014-10-07 15:40:35 +00:00
|
|
|
#-----------------------------------------------------------------
|
|
|
|
# Build bundled JANSSON library
|
|
|
|
#-----------------------------------------------------------------
|
2014-05-06 13:13:10 +00:00
|
|
|
if(BUNDLED_JANSSON)
|
|
|
|
ExternalProject_Add(bundled_jansson
|
2014-10-07 15:40:35 +00:00
|
|
|
SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/jansson
|
|
|
|
BINARY_DIR ${LIBS_BINARYDIR_DIR}/jansson
|
2014-06-03 14:06:44 +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} -DCMAKE_C_FLAGS=${CMAKE_C_FLAGS} -DJANSSON_WITHOUT_TESTS=1 -DBUILD_DOCS=0 -DJANSSON_STATIC_CRT=1 -DJANSSON_BUILD_DOCS=0
|
2014-05-06 13:13:10 +00:00
|
|
|
INSTALL_COMMAND ""
|
|
|
|
)
|
2014-11-21 20:54:30 +00:00
|
|
|
|
2014-05-06 13:13:10 +00:00
|
|
|
ExternalProject_Get_Property(bundled_jansson binary_dir)
|
|
|
|
|
2014-09-15 20:43:28 +00:00
|
|
|
if(WIN32 AND DEBUG_BUILD)
|
2014-05-06 13:13:10 +00:00
|
|
|
set(jansson_name "jansson_d${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
2014-09-15 20:43:28 +00:00
|
|
|
else(WIN32 AND DEBUG_BUILD)
|
2014-05-06 13:13:10 +00:00
|
|
|
set(jansson_name "jansson${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
2014-09-15 20:43:28 +00:00
|
|
|
endif(WIN32 AND DEBUG_BUILD)
|
2014-11-21 20:54:30 +00:00
|
|
|
|
2014-09-15 20:43:28 +00:00
|
|
|
if(VSTUDIO)
|
2015-03-17 14:35:31 +00:00
|
|
|
set(BUNDLED_JANSSON_LIBRARY optimized "${binary_dir}/lib/Release/jansson${CMAKE_STATIC_LIBRARY_SUFFIX}" debug "${binary_dir}/lib/Debug/jansson_d${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
2014-09-15 21:04:12 +00:00
|
|
|
elseif(NMAKE_BUILD)
|
2015-03-17 14:35:31 +00:00
|
|
|
set(BUNDLED_JANSSON_LIBRARY "${binary_dir}/lib/${jansson_name}")
|
2014-09-15 20:43:28 +00:00
|
|
|
else(VSTUDIO)
|
2015-03-17 14:35:31 +00:00
|
|
|
set(BUNDLED_JANSSON_LIBRARY "${binary_dir}/lib/lib${jansson_name}")
|
2014-09-15 20:43:28 +00:00
|
|
|
endif(VSTUDIO)
|
2015-03-17 14:35:31 +00:00
|
|
|
set(BUNDLED_JANSSON_INCLUDE_DIR "${binary_dir}/include")
|
2014-05-06 13:13:10 +00:00
|
|
|
endif(BUNDLED_JANSSON)
|