aseprite/third_party/CMakeLists.txt

171 lines
5.0 KiB
CMake
Raw Normal View History

# ASEPRITE
# Copyright (C) 2001-2018 David Capello
2010-08-11 00:49:32 +00:00
include_directories(.)
2010-08-11 00:49:32 +00:00
if(MSVC)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
endif(MSVC)
if(NOT USE_SHARED_JPEGLIB)
add_subdirectory(jpeg)
endif()
if(NOT USE_SHARED_ZLIB)
set(SKIP_INSTALL_ALL on)
2016-04-01 12:50:09 +00:00
# Don't build zlib tests
set(ZLIB_TESTS OFF CACHE BOOL "Build zlib tests")
add_subdirectory(zlib)
endif()
if(NOT USE_SHARED_LIBPNG)
set(SKIP_INSTALL_ALL ON)
# We only need the static version of libpng
set(PNG_SHARED OFF CACHE BOOL "Build shared lib")
set(PNG_STATIC ON CACHE BOOL "Build static lib")
set(PNG_TESTS OFF CACHE BOOL "Build libpng tests")
add_subdirectory(libpng)
endif()
if(NOT USE_SHARED_GIFLIB)
2017-10-02 15:24:56 +00:00
set(GIFLIB_UTILS OFF CACHE BOOL "Build giflib utils")
add_subdirectory(giflib)
endif()
if(WITH_WEBP_SUPPORT)
# Enable img2webp so "webpmux" library is built
set(WEBP_BUILD_IMG2WEBP ON CACHE BOOL "Build the img2webp animation tool.")
add_subdirectory(libwebp)
endif()
if(NOT USE_SHARED_TINYXML)
add_subdirectory(tinyxml)
endif()
if(NOT USE_SHARED_CURL)
set(BUILD_RELEASE_DEBUG_DIRS ON BOOL)
2016-04-19 17:09:38 +00:00
set(CMAKE_USE_OPENSSL OFF CACHE BOOL "Use OpenSSL code. Experimental")
add_subdirectory(curl)
endif()
2015-03-16 18:05:13 +00:00
if(USE_ALLEG4_BACKEND AND NOT USE_SHARED_LIBLOADPNG)
add_subdirectory(loadpng)
endif()
2014-10-26 01:22:58 +00:00
if(NOT USE_SHARED_PIXMAN)
add_subdirectory(pixman-cmake)
endif()
if(NOT USE_SHARED_FREETYPE)
set(SKIP_INSTALL_ALL on)
set(WITH_BZip2 OFF CACHE BOOL "")
# If we don't do this, the compilation fails because it looks like
# ftgzip.c includes our zlib.h, but uses the zconf.h in the
# freetype2 library.
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/freetype2/src/gzip/zlib.h)
file(RENAME
${CMAKE_CURRENT_SOURCE_DIR}/freetype2/src/gzip/zlib.h
${CMAKE_CURRENT_SOURCE_DIR}/freetype2/src/gzip/zlib.h.included)
endif()
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/freetype2/src/gzip/zconf.h)
file(RENAME
${CMAKE_CURRENT_SOURCE_DIR}/freetype2/src/gzip/zconf.h
${CMAKE_CURRENT_SOURCE_DIR}/freetype2/src/gzip/zconf.h.included)
endif()
add_subdirectory(freetype2)
if(NOT USE_SHARED_LIBPNG)
add_dependencies(freetype ${PNG_LIBRARIES})
endif()
endif()
if(NOT USE_SHARED_HARFBUZZ)
if(NOT USE_SHARED_FREETYPE)
set(ENV{FREETYPE_DIR} ${FREETYPE_DIR})
endif()
2018-03-26 19:14:38 +00:00
set(HB_HAVE_FREETYPE ON CACHE BOOL "Enable freetype interop helpers")
set(HB_HAVE_GRAPHITE2 OFF CACHE BOOL "Enable Graphite2 complementary shaper")
set(HB_BUILTIN_UCDN ON CACHE BOOL "Use HarfBuzz provided UCDN")
set(HB_HAVE_GLIB OFF CACHE BOOL "Enable glib unicode functions")
set(HB_HAVE_ICU OFF CACHE BOOL "Enable icu unicode functions")
set(HB_HAVE_CORETEXT OFF CACHE BOOL "Enable CoreText shaper backend on macOS")
set(HB_HAVE_UNISCRIBE OFF CACHE BOOL "Enable Uniscribe shaper backend on Windows")
set(HB_HAVE_DIRECTWRITE OFF CACHE BOOL "Enable DirectWrite shaper backend on Windows")
add_subdirectory(harfbuzz)
endif()
add_subdirectory(simpleini)
add_subdirectory(fmt)
# Add cmark without tests
if(NOT USE_SHARED_CMARK)
set(CMARK_TESTS OFF CACHE BOOL "Build cmark tests and enable testing")
add_subdirectory(cmark)
set(cmark_headers
${CMAKE_CURRENT_SOURCE_DIR}/cmark/src/cmark.h
${CMAKE_CURRENT_BINARY_DIR}/cmark/src/cmark_export.h
${CMAKE_CURRENT_BINARY_DIR}/cmark/src/cmark_version.h)
foreach(fn ${cmark_headers})
get_filename_component(fn_name "${fn}" NAME)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/cmark/${fn_name}
COMMAND ${CMAKE_COMMAND} -E copy ${fn} ${CMAKE_CURRENT_BINARY_DIR}/cmark/${fn_name}
MAIN_DEPENDENCY ${fn})
list(APPEND copy_cmark_headers ${CMAKE_CURRENT_BINARY_DIR}/cmark/${fn_name})
endforeach()
add_custom_target(copy_cmark_headers DEPENDS ${copy_cmark_headers})
add_dependencies(libcmark_static copy_cmark_headers)
endif()
# JSON
add_subdirectory(json11)
# libarchive
2017-06-12 16:20:32 +00:00
set(ENABLE_TEST OFF CACHE BOOL "Enable unit and regression tests")
set(ENABLE_COVERAGE OFF CACHE BOOL "Enable code coverage (GCC only, automatically sets ENABLE_TEST to ON)")
2017-06-24 16:44:25 +00:00
set(ENABLE_LZMA OFF CACHE BOOL "Enable the use of the system LZMA library if found")
set(ENABLE_CNG OFF CACHE BOOL "Enable the use of CNG(Crypto Next Generation)")
set(ENABLE_BZip2 OFF CACHE BOOL "Enable the use of the system BZip2 library if found")
add_subdirectory(libarchive)
target_include_directories(archive_static INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/libarchive/libarchive>)
# benchmark
if(ENABLE_BENCHMARKS)
2018-04-03 15:40:38 +00:00
set(BENCHMARK_ENABLE_TESTING OFF CACHE BOOL "Enable testing of the benchmark library.")
add_subdirectory(benchmark)
endif()
# mujs
add_library(mujs
mujs/jsarray.c
mujs/jsboolean.c
mujs/jsbuiltin.c
mujs/jscompile.c
mujs/jsdate.c
mujs/jsdtoa.c
mujs/jsdump.c
mujs/jserror.c
mujs/jsfunction.c
mujs/jsgc.c
mujs/jsintern.c
mujs/jslex.c
mujs/jsmath.c
mujs/jsnumber.c
mujs/jsobject.c
mujs/json.c
mujs/jsparse.c
mujs/jsproperty.c
mujs/jsregexp.c
mujs/jsrun.c
mujs/jsstate.c
mujs/jsstring.c
mujs/jsvalue.c
mujs/regexp.c
mujs/utf.c
mujs/utftype.c)
target_include_directories(mujs PUBLIC .)