Skip to content

Commit

Permalink
Do not use the embedded libloadpng.
Browse files Browse the repository at this point in the history
Add the option to use a shared libloadpng library.
Patch by Tobias Hansen <[email protected]>
  • Loading branch information
dacap committed Jul 9, 2012
1 parent c3030b9 commit a35aa75
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ option(USE_SHARED_GIFLIB "Use your installed copy of giflib" 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)
option(USE_SHARED_LIBLOADPNG "Use your installed copy of libloadpng" off)
option(USE_SHARED_TINYXML "Use your installed copy of tinyxml" off)
option(USE_SHARED_GTEST "Use your installed copy of gtest" off)
option(USE_SHARED_ALLEGRO4 "Use shared Allegro 4 library (without resize support)" off)
Expand Down
13 changes: 11 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ set(aseprite_libraries aseprite-library undo-lib filters-lib ui-lib gfx-lib base
include_directories(. .. ../third_party)

# Third-party libraries
set(libs3rdparty loadpng)
include_directories(${LOADPNG_DIR})

if(USE_SHARED_JPEGLIB)
find_package(JPEG)
Expand Down Expand Up @@ -73,6 +71,17 @@ else()
include_directories(${TINYXML_DIR})
endif()

if(USE_SHARED_LIBLOADPNG)
find_library(LIBLOADPNG_LIBRARY NAMES loadpng)
find_path(LIBLOADPNG_INCLUDE_DIR NAMES loadpng.h)

set(libs3rdparty ${libs3rdparty} ${LIBLOADPNG_LIBRARY})
include_directories(${LIBLOADPNG_INCLUDE_DIR})
else()
set(libs3rdparty ${libs3rdparty} loadpng)
include_directories(${LOADPNG_DIR})
endif()

if (CMAKE_USE_PTHREADS_INIT)
set(sys_libs ${sys_libs} ${CMAKE_THREAD_LIBS_INIT})
endif()
Expand Down
4 changes: 3 additions & 1 deletion third_party/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,6 @@ if(ENABLE_UPDATER AND NOT USE_SHARED_CURL)
add_subdirectory(curl)
endif()

add_subdirectory(loadpng)
if(NOT USE_SHARED_LIBLOADPNG)
add_subdirectory(loadpng)
endif()

0 comments on commit a35aa75

Please sign in to comment.