Add support to link ASE with the shared versions of libjpeg, libpng, and zlib.

This commit is contained in:
David Capello 2010-09-30 17:04:32 -03:00
parent 9ed888b82b
commit 3163a5ac98
3 changed files with 52 additions and 7 deletions

View File

@ -13,6 +13,9 @@ project(aseprite)
option(USE_STATIC_LIBC "Use static version of C and C++ runtimes" off)
option(USE_STATIC_ALLEGRO "Use static version of Allegro library" off)
option(USE_SHARED_JPEGLIB "Use your installed copy of jpeglib" off)
option(USE_SHARED_ZLIB "Use your installed copy of zlib" off)
option(USE_SHARED_LIBPNG "Use your installed copy of libpng" off)
######################################################################
# Directories of third-party libraries

View File

@ -38,7 +38,38 @@ if(MSVC)
endif(MSVC)
# Third-party libraries
set(libs3rdparty freetype jpeg libart_lgpl libpng loadpng tinyxml zlib)
set(libs3rdparty freetype libart_lgpl loadpng tinyxml)
if(USE_SHARED_JPEGLIB)
find_package(JPEG)
if(JPEG_FOUND)
set(libs3rdparty ${libs3rdparty} ${JPEG_LIBRARIES})
include_directories(${JPEG_INCLUDE_DIR})
endif(JPEG_FOUND)
else()
set(libs3rdparty ${libs3rdparty} jpeg)
endif()
if(USE_SHARED_ZLIB)
find_package(ZLIB)
if(ZLIB_FOUND)
set(libs3rdparty ${libs3rdparty} ${ZLIB_LIBRARIES})
include_directories(${ZLIB_INCLUDE_DIR})
endif(ZLIB_FOUND)
else()
set(libs3rdparty ${libs3rdparty} zlib)
endif()
if(USE_SHARED_LIBPNG)
find_package(PNG)
if(PNG_FOUND)
set(libs3rdparty ${libs3rdparty} ${PNG_LIBRARIES})
add_definitions(${PNG_DEFINITIONS})
include_directories(${PNG_INCLUDE_DIR})
endif(PNG_FOUND)
else()
set(libs3rdparty ${libs3rdparty} libpng)
endif()
# All libraries for .exe files
set(all_libs aseprite-library gui-lib gfx-lib base-lib ${alleg_lib} ${libs3rdparty} ${sys_libs})

View File

@ -1,17 +1,28 @@
# ASE - Allegro Sprite Editor
# Copyright (C) 2001-2010 David Capello
include_directories(. libpng zlib)
include_directories(.)
if(MSVC)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
endif(MSVC)
add_subdirectory(freetype)
if(NOT USE_SHARED_JPEGLIB)
add_subdirectory(jpeg)
add_subdirectory(libart_lgpl)
endif()
if(NOT USE_SHARED_ZLIB)
include_directories(zlib)
add_subdirectory(zlib)
endif()
if(NOT USE_SHARED_LIBPNG)
include_directories(libpng)
add_subdirectory(libpng)
endif()
add_subdirectory(gtest)
add_subdirectory(freetype)
add_subdirectory(libart_lgpl)
add_subdirectory(loadpng)
add_subdirectory(tinyxml)
add_subdirectory(zlib)
add_subdirectory(gtest)