mirror of
https://github.com/aseprite/aseprite.git
synced 2025-02-20 18:40:57 +00:00
Add "allegro" library as part of the ASE build process.
This commit is contained in:
parent
c6ba92dd0e
commit
948a5e0a5d
@ -2,9 +2,6 @@
|
||||
# Copyright (C) 2001-2010 David Capello
|
||||
|
||||
if(WIN32)
|
||||
# Allegro library on Windows
|
||||
set(alleg_lib alleg)
|
||||
|
||||
# System libraries on Windows
|
||||
set(sys_libs
|
||||
User32 Shell32 ComCtl32 ComDlg32 Gdi32 Msimg32
|
||||
@ -18,30 +15,6 @@ if(WIN32)
|
||||
else()
|
||||
# Pthreads
|
||||
set(sys_libs ${sys_libs} pthread)
|
||||
|
||||
# Allegro library on Unix like systems
|
||||
find_program(allegro_config "allegro-config")
|
||||
|
||||
execute_process(COMMAND ${allegro_config} --cflags
|
||||
OUTPUT_VARIABLE allegro_c_flags
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
RESULT_VARIABLE ret)
|
||||
if(NOT ret EQUAL 0)
|
||||
message("Error running allegro-config")
|
||||
endif()
|
||||
|
||||
if(USE_STATIC_ALLEGRO)
|
||||
execute_process(COMMAND ${allegro_config} --libs --static
|
||||
OUTPUT_VARIABLE allegro_link_flags
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
else()
|
||||
execute_process(COMMAND ${allegro_config} --libs
|
||||
OUTPUT_VARIABLE allegro_link_flags
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
endif()
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${allegro_c_flags}")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${allegro_link_flags}")
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
@ -86,7 +59,7 @@ else()
|
||||
endif()
|
||||
|
||||
# All libraries for .exe files
|
||||
set(all_libs aseprite-library gui-lib gfx-lib base-lib ${libs3rdparty} ${alleg_lib} ${sys_libs})
|
||||
set(all_libs aseprite-library gui-lib gfx-lib base-lib ${libs3rdparty} allegro ${sys_libs})
|
||||
|
||||
# Directories where .h files can be found
|
||||
include_directories(
|
||||
@ -101,6 +74,7 @@ include_directories(
|
||||
######################################################################
|
||||
# Sub-libraries
|
||||
|
||||
add_subdirectory(allegro)
|
||||
add_subdirectory(base)
|
||||
add_subdirectory(gfx)
|
||||
add_subdirectory(gui)
|
||||
|
@ -75,10 +75,10 @@ set(COMPAT_VERSION 4.4.0)
|
||||
set(ALLEGRO_DLL_SHORTVER 44)
|
||||
|
||||
# Search in the `cmake' directory for additional CMake modules.
|
||||
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
|
||||
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
|
||||
|
||||
# Search for C header files in these directories.
|
||||
include_directories(${CMAKE_SOURCE_DIR}/include)
|
||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
|
||||
include_directories(${CMAKE_BINARY_DIR}/include)
|
||||
|
||||
# Put libraries into `lib'.
|
||||
@ -95,7 +95,7 @@ include(Common)
|
||||
# Build options
|
||||
#
|
||||
|
||||
option(SHARED "Build shared library for main Allegro library" on)
|
||||
option(SHARED "Build shared library for main Allegro library" off)
|
||||
set(BUILD_SHARED_LIBS ${SHARED}) # actual CMake variable
|
||||
|
||||
# On some 64-bit platforms, libraries should be installed into `lib64'
|
||||
@ -369,7 +369,7 @@ if(WANT_MODULES AND ALLEGRO_UNIX)
|
||||
set(ALLEGRO_WITH_MODULES 1)
|
||||
set(ALLEGRO_MODULES_PATH
|
||||
${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/allegro/${ALLEGRO_VERSION})
|
||||
install(FILES ${CMAKE_SOURCE_DIR}/modules.lst
|
||||
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/modules.lst
|
||||
DESTINATION "${ALLEGRO_MODULES_PATH}"
|
||||
)
|
||||
endif(WANT_MODULES AND ALLEGRO_UNIX)
|
||||
@ -687,7 +687,7 @@ macro(add_headers location)
|
||||
endmacro(add_headers)
|
||||
|
||||
configure_file(
|
||||
${CMAKE_SOURCE_DIR}/include/allegro/platform/alplatf.h.cmake
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include/allegro/platform/alplatf.h.cmake
|
||||
${CMAKE_BINARY_DIR}/include/allegro/platform/alplatf.h
|
||||
@ONLY
|
||||
)
|
||||
@ -697,7 +697,7 @@ add_headers(allegro/platform
|
||||
|
||||
if(UNIX)
|
||||
configure_file(
|
||||
${CMAKE_SOURCE_DIR}/include/allegro/platform/alunixac.h.cmake
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include/allegro/platform/alunixac.h.cmake
|
||||
${CMAKE_BINARY_DIR}/include/allegro/platform/alunixac.h
|
||||
)
|
||||
add_headers(allegro/platform
|
||||
@ -880,7 +880,7 @@ if(UNIX) # including MACOSX
|
||||
endif()
|
||||
|
||||
configure_file(
|
||||
${CMAKE_SOURCE_DIR}/misc/allegro-config.in
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/misc/allegro-config.in
|
||||
${CMAKE_BINARY_DIR}/allegro-config
|
||||
@ONLY
|
||||
)
|
||||
@ -891,119 +891,3 @@ if(UNIX) # including MACOSX
|
||||
endif(UNIX)
|
||||
|
||||
#-----------------------------------------------------------------------------#
|
||||
#
|
||||
# Addons
|
||||
#
|
||||
|
||||
option(WANT_ALLEGROGL "Enable AllegroGL" on)
|
||||
option(WANT_LOADPNG "Enable loadpng" on)
|
||||
option(WANT_LOGG "Enable logg" on)
|
||||
option(WANT_JPGALLEG "Enable JPGAlleg" on)
|
||||
|
||||
if(WANT_FRAMEWORKS)
|
||||
set(ADDON_LINKAGE SHARED)
|
||||
else()
|
||||
set(ADDON_LINKAGE STATIC)
|
||||
endif()
|
||||
|
||||
if(WANT_ALLEGROGL)
|
||||
add_subdirectory(addons/allegrogl)
|
||||
endif()
|
||||
if(WANT_LOADPNG)
|
||||
add_subdirectory(addons/loadpng)
|
||||
endif()
|
||||
if(WANT_LOGG)
|
||||
add_subdirectory(addons/logg)
|
||||
endif()
|
||||
if(WANT_JPGALLEG)
|
||||
add_subdirectory(addons/jpgalleg)
|
||||
endif()
|
||||
|
||||
#-----------------------------------------------------------------------------#
|
||||
#
|
||||
# pkg-config files - after addons to get properties
|
||||
#
|
||||
|
||||
set(PKG_CONFIG_FILES
|
||||
allegro
|
||||
allegrogl
|
||||
jpgalleg
|
||||
loadpng
|
||||
logg
|
||||
)
|
||||
|
||||
if(UNIX)
|
||||
set(prefix "${CMAKE_INSTALL_PREFIX}")
|
||||
set(INCLUDE_PREFIX "\${prefix}")
|
||||
set(bindir "\${exec_prefix}/bin")
|
||||
set(includedir "\${prefix}/include")
|
||||
set(libdir "\${exec_prefix}/lib${LIB_SUFFIX}")
|
||||
set(lib_type "${BUILD_TYPE_SUFFIX}")
|
||||
# We only use -static suffixes on Windows, for the main library.
|
||||
set(lib_linkage "")
|
||||
|
||||
foreach(name ${PKG_CONFIG_FILES})
|
||||
set(target ${name})
|
||||
|
||||
# For static linking: get extra libraries to link with.
|
||||
get_target_property(link_with ${target} static_link_with)
|
||||
|
||||
configure_file(
|
||||
misc/${name}.pc.in
|
||||
${LIBRARY_OUTPUT_PATH}/pkgconfig/${name}${lib_type}.pc
|
||||
@ONLY
|
||||
)
|
||||
install(FILES ${LIBRARY_OUTPUT_PATH}/pkgconfig/${name}${lib_type}.pc
|
||||
DESTINATION "lib${LIB_SUFFIX}/pkgconfig"
|
||||
)
|
||||
endforeach(name)
|
||||
endif(UNIX)
|
||||
|
||||
#-----------------------------------------------------------------------------#
|
||||
#
|
||||
# Documentation
|
||||
#
|
||||
|
||||
add_subdirectory(docs)
|
||||
|
||||
#-----------------------------------------------------------------------------#
|
||||
#
|
||||
# Samples - after addons because skater can use AllegroGL
|
||||
#
|
||||
|
||||
option(WANT_EXAMPLES "Build example programs" on)
|
||||
|
||||
if(WANT_EXAMPLES)
|
||||
add_subdirectory(examples)
|
||||
add_subdirectory(demos/shooter)
|
||||
add_subdirectory(demos/skater)
|
||||
endif(WANT_EXAMPLES)
|
||||
|
||||
#-----------------------------------------------------------------------------#
|
||||
#
|
||||
# Tools - after addons because of grabber plugins
|
||||
#
|
||||
|
||||
option(WANT_TOOLS "Build tool programs" on)
|
||||
|
||||
if(WANT_TOOLS)
|
||||
add_subdirectory(tools)
|
||||
|
||||
# Note to packagers: setup is mostly a historical footnote on modern
|
||||
# operating systems. Do not feel the need to package it.
|
||||
add_subdirectory(setup)
|
||||
endif(WANT_TOOLS)
|
||||
|
||||
#-----------------------------------------------------------------------------#
|
||||
#
|
||||
# Tests
|
||||
#
|
||||
|
||||
option(WANT_TESTS "Build test programs" on)
|
||||
|
||||
if(WANT_TESTS)
|
||||
add_subdirectory(tests)
|
||||
endif(WANT_TESTS)
|
||||
|
||||
#-----------------------------------------------------------------------------#
|
||||
# vim: set sts=4 sw=4 et:
|
||||
|
4
src/allegro/README.txt
Normal file
4
src/allegro/README.txt
Normal file
@ -0,0 +1,4 @@
|
||||
This is a modified version of Allegro library (branch 4.4) specially
|
||||
patched for ASE.
|
||||
|
||||
- David Capello
|
Loading…
x
Reference in New Issue
Block a user