2012-01-06 01:12:57 -03:00
|
|
|
# ASEPRITE
|
2016-02-16 18:52:15 -03:00
|
|
|
# Copyright (C) 2001-2016 David Capello
|
2010-08-10 21:49:32 -03:00
|
|
|
|
2010-09-30 17:04:32 -03:00
|
|
|
include_directories(.)
|
2010-08-10 21:49:32 -03:00
|
|
|
|
2010-08-25 16:18:46 -03:00
|
|
|
if(MSVC)
|
|
|
|
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
|
|
|
|
endif(MSVC)
|
|
|
|
|
2010-09-30 17:04:32 -03:00
|
|
|
if(NOT USE_SHARED_JPEGLIB)
|
|
|
|
add_subdirectory(jpeg)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(NOT USE_SHARED_ZLIB)
|
2016-03-31 17:48:54 -03:00
|
|
|
set(SKIP_INSTALL_ALL on)
|
|
|
|
set(ZLIB_LIBRARY zlibstatic)
|
2016-04-01 09:50:09 -03:00
|
|
|
# Don't build zlib tests
|
|
|
|
set(ZLIB_TESTS OFF CACHE BOOL "Build zlib tests")
|
2010-09-30 17:04:32 -03:00
|
|
|
add_subdirectory(zlib)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(NOT USE_SHARED_LIBPNG)
|
2016-04-01 09:17:40 -03:00
|
|
|
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")
|
2016-03-31 17:48:54 -03:00
|
|
|
set(ZLIB_INCLUDE_DIR "${ZLIB_INCLUDE_DIRS}")
|
2010-09-30 17:04:32 -03:00
|
|
|
add_subdirectory(libpng)
|
|
|
|
endif()
|
|
|
|
|
2015-09-07 14:43:31 -03:00
|
|
|
if(WITH_WEBP_SUPPORT)
|
|
|
|
if(NOT USE_SHARED_LIBWEBP)
|
2016-10-31 19:50:32 -03:00
|
|
|
# Skia already includes webp library
|
|
|
|
if(NOT USE_SKIA_BACKEND)
|
|
|
|
add_subdirectory(libwebp-cmake)
|
|
|
|
endif()
|
2015-09-07 14:43:31 -03:00
|
|
|
endif()
|
2015-09-01 13:04:11 +02:00
|
|
|
endif()
|
|
|
|
|
2012-03-15 00:17:49 -03:00
|
|
|
if(NOT USE_SHARED_GIFLIB)
|
|
|
|
add_subdirectory(giflib)
|
|
|
|
endif()
|
|
|
|
|
2012-03-19 14:04:24 -03:00
|
|
|
if(NOT USE_SHARED_TINYXML)
|
|
|
|
add_subdirectory(tinyxml)
|
|
|
|
endif()
|
|
|
|
|
2015-04-23 19:14:13 -03:00
|
|
|
if(NOT USE_SHARED_CURL)
|
2015-03-10 13:50:12 -03:00
|
|
|
set(BUILD_RELEASE_DEBUG_DIRS ON BOOL)
|
2016-04-19 14:09:38 -03:00
|
|
|
set(CMAKE_USE_OPENSSL OFF CACHE BOOL "Use OpenSSL code. Experimental")
|
2011-07-27 21:26:22 -03:00
|
|
|
add_subdirectory(curl)
|
|
|
|
endif()
|
2012-03-15 00:17:49 -03:00
|
|
|
|
2015-03-16 15:05:13 -03:00
|
|
|
if(USE_ALLEG4_BACKEND AND NOT USE_SHARED_LIBLOADPNG)
|
|
|
|
add_subdirectory(loadpng)
|
2012-07-08 21:21:01 -03:00
|
|
|
endif()
|
2013-03-31 00:36:00 -03:00
|
|
|
|
2014-10-25 22:22:58 -03:00
|
|
|
if(NOT USE_SHARED_PIXMAN)
|
|
|
|
add_subdirectory(pixman-cmake)
|
|
|
|
endif()
|
2014-10-30 01:06:27 -03:00
|
|
|
|
2015-09-22 19:27:44 -03:00
|
|
|
if(NOT USE_SHARED_FREETYPE)
|
2016-03-31 17:48:54 -03:00
|
|
|
set(SKIP_INSTALL_ALL on)
|
|
|
|
|
|
|
|
# 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()
|
|
|
|
|
2015-09-22 19:27:44 -03:00
|
|
|
add_subdirectory(freetype2)
|
2016-04-04 12:24:40 -03:00
|
|
|
|
|
|
|
if(NOT USE_SHARED_LIBPNG)
|
|
|
|
add_dependencies(freetype png_static)
|
|
|
|
endif()
|
2015-09-22 19:27:44 -03:00
|
|
|
endif()
|
|
|
|
|
2014-10-16 21:27:25 -03:00
|
|
|
add_subdirectory(simpleini)
|
2016-12-06 16:03:51 -03:00
|
|
|
|
|
|
|
# Add cmark without tests
|
|
|
|
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)
|