Skip to content

Commit

Permalink
Merge commit '3246cd739eaf70f49c9550291bc67bb2b0853eca'
Browse files Browse the repository at this point in the history
# Conflicts:
#	agg-src/CMakeLists.txt
#	agg-src/src/CMakeLists.txt
  • Loading branch information
GerHobbelt committed Feb 7, 2024
2 parents c4f36b4 + 3246cd7 commit 0d6876e
Show file tree
Hide file tree
Showing 3 changed files with 333 additions and 187 deletions.
120 changes: 17 additions & 103 deletions agg-src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ PROJECT( antigrain )
# additional are modified Find routines
SET ( CMAKE_MODULE_PATH "${antigrain_SOURCE_DIR}/bin" )

CMAKE_MINIMUM_REQUIRED( VERSION 2.4.8 )
CMAKE_MINIMUM_REQUIRED( VERSION 3.0 )

SET(AGG_MAJOR_VERSION 0 )
SET(AGG_MINOR_VERSION 1 )
Expand All @@ -28,6 +28,16 @@ OPTION( agg_USE_SDL_PLATFORM "Use SDL as platform" OFF)
OPTION( agg_USE_PACK "Package Agg" OFF)
OPTION( agg_USE_AGG2D "Agg 2D graphical context" OFF)
OPTION( agg_USE_DEBUG "For debug version" OFF)
OPTION( agg_BUILD_EXAMPLES "Build the AGG examples" ON)
OPTION( agg_BUILD_DEMO "Build the AGG demo" ON)
OPTION( agg_BUILD_PLATFORM "Build the AGG platform helper" ON)
OPTION( agg_BUILD_CONTROLS "Build the AGG controls" ON)

IF( agg_BUILD_DEMO OR agg_BUILD_EXAMPLES )
MESSAGE(STATUS "Force enable the platform and controls helper due to Demo / Example being build.")
SET( agg_BUILD_PLATFORM ON CACHE BOOL "Build the AGG platform helper" FORCE)
SET( agg_BUILD_CONTROLS ON CACHE BOOL "Build the AGG controls" FORCE)
ENDIF( agg_BUILD_DEMO OR agg_BUILD_EXAMPLES )

IF( agg_USE_DEBUG )
#SET( PFDEBUG "d" )
Expand Down Expand Up @@ -83,110 +93,12 @@ IF ( ${CMAKE_GENERATOR} MATCHES "Borland Makefiles" )

ENDIF ( ${CMAKE_GENERATOR} MATCHES "Borland Makefiles" )

##################################################
# Set all includes, flags, libraries, related to expat
##################################################

IF( agg_USE_EXPAT )

FIND_PACKAGE( EXPAT )

IF(EXPAT_FOUND)
INCLUDE_DIRECTORIES(${EXPAT_INCLUDE_DIRS})
LINK_LIBRARIES(${EXPAT_LIBRARIES})
ELSE(EXPAT_FOUND)
MESSAGE(SEND_ERROR "expat not found")
ENDIF(EXPAT_FOUND)
ENDIF( agg_USE_EXPAT )

##################################################
# Set all includes, flags, libraries, related to freetype
##################################################

IF( agg_USE_FREETYPE )
FIND_PACKAGE( Freetype )
IF( FREETYPE_FOUND )
INCLUDE_DIRECTORIES( ${FREETYPE_INCLUDE_DIRS} )
LINK_LIBRARIES( ${FREETYPE_LIBRARIES} )
LINK_DIRECTORIES( ${FREETYPE_LINK_DIR} )
ELSE( FREETYPE_FOUND )
MESSAGE(SEND_ERROR "freetype not found")
ENDIF( FREETYPE_FOUND )
ENDIF( agg_USE_FREETYPE )

##################################################
# Set all includes, flags, libraries, related to SDL
##################################################

FIND_PACKAGE( SDL QUIET )
IF( SDL_FOUND )
IF ( agg_USE_SDL_PLATFORM )
INCLUDE_DIRECTORIES(${SDL_INCLUDE_DIR})
LINK_LIBRARIES(${SDL_LIBRARY})
ENDIF ( agg_USE_SDL_PLATFORM )
ELSE( SDL_FOUND )
IF ( agg_USE_SDL_PLATFORM )
MESSAGE( "SDL libray was not found, disable agg_USE_SDL_PLATFORM please" )
ENDIF ( agg_USE_SDL_PLATFORM )
ENDIF( SDL_FOUND )

# the main include dir of Agg
INCLUDE_DIRECTORIES( ${antigrain_SOURCE_DIR}/include )
SET( AGG_INCLUDE_DIRS ${AGG_INCLUDE_DIRS} include )

# freetype specific lib of Agg
IF( agg_USE_FREETYPE )
INCLUDE_DIRECTORIES( ${antigrain_SOURCE_DIR}/font_freetype )
SET( AGG_INCLUDE_DIRS ${AGG_INCLUDE_DIRS} font_freetype )
ADD_DEFINITIONS( -DAGG_USE_FREETYPE )
SET( AGG_FLAGS ${AGG_FLAGS} -DAGG_USE_FREETYPE )
LINK_LIBRARIES( freetypefont )
SET( AGG_LIBRARIES ${AGG_LIBRARIES} aggfontfreetype${PFDEBUG} )
ENDIF( agg_USE_FREETYPE )

# GPC lib if used within Agg
IF ( agg_USE_GPC )
INCLUDE_DIRECTORIES( ${antigrain_SOURCE_DIR}/gpc )
SET( AGG_INCLUDE_DIRS ${AGG_INCLUDE_DIRS} gpc )
ADD_DEFINITIONS( -DAGG_USE_GPC )
SET( AGG_FLAGS ${AGG_FLAGS} -DAGG_USE_GPC )
LINK_LIBRARIES( gpcbool )
SET( AGG_LIBRARIES ${AGG_LIBRARIES} gpc${PFDEBUG} )
ENDIF ( agg_USE_GPC )

# agg2d lib if used within Agg
IF ( agg_USE_AGG2D )
INCLUDE_DIRECTORIES( ${antigrain_SOURCE_DIR}/agg2d )
SET( AGG_INCLUDE_DIRS ${AGG_INCLUDE_DIRS} agg2d )
ADD_DEFINITIONS( -DAGG_USE_AGG2D )
OPTION( agg_USE_AGG2D_FREETYPE "Agg 2D graphical context uses freetype" OFF)
SET( AGG_FLAGS ${AGG_FLAGS} -DAGG_USE_AGG2D )
LINK_LIBRARIES( agg2d )
SET( AGG_LIBRARIES ${AGG_LIBRARIES} agg2d${PFDEBUG} )
ENDIF ( agg_USE_AGG2D )

IF ( agg_USE_AGG2D_FREETYPE )
ADD_DEFINITIONS( -DAGG2D_USE_FREETYPE )
SET( AGG_FLAGS ${AGG_FLAGS} -DAGG2D_USE_FREETYPE )
ENDIF ( agg_USE_AGG2D_FREETYPE )

# sld as platform or os
IF( SDL_FOUND AND agg_USE_SDL_PLATFORM )
LINK_LIBRARIES( controls sdlplatform antigrain )
SET( AGG_LIBRARIES ${AGG_LIBRARIES} aggctrl${PFDEBUG} aggsdlplatform${PFDEBUG} agg${PFDEBUG} )
ELSE( SDL_FOUND AND agg_USE_SDL_PLATFORM )
LINK_LIBRARIES( controls platform antigrain )
SET( AGG_LIBRARIES ${AGG_LIBRARIES} aggctrl${PFDEBUG} aggplatform${PFDEBUG} agg${PFDEBUG} )
ENDIF( SDL_FOUND AND agg_USE_SDL_PLATFORM )

SET( AGG_FLAGS ${AGG_FLAGS} CACHE STRING "Agg package flags" FORCE )
SET( AGG_INCLUDE_DIRS ${AGG_INCLUDE_DIRS} CACHE STRING "Agg package libs include paths" FORCE )
SET( AGG_LIBRARY_DIRS ${AGG_LIBRARY_DIRS} CACHE STRING "Agg package libs directory paths" FORCE )
SET( AGG_LIBRARIES ${AGG_LIBRARIES} CACHE STRING "Agg package libraries" FORCE )

ADD_SUBDIRECTORY( src )

ADD_SUBDIRECTORY( examples )
IF ( agg_BUILD_EXAMPLES )
ADD_SUBDIRECTORY( examples )
ENDIF( agg_BUILD_EXAMPLES )

CONFIGURE_FILE( ${antigrain_SOURCE_DIR}/bin/AggConfig.cmake.in
${antigrain_BINARY_DIR}/bin/AggConfig.cmake
Expand All @@ -213,7 +125,9 @@ CONFIGURE_FILE( ${antigrain_SOURCE_DIR}/libagg.pc.in libagg.pc
@ONLY )


ADD_SUBDIRECTORY( myapp )
IF ( agg_BUILD_DEMO )
ADD_SUBDIRECTORY( myapp )
ENDIF ( agg_BUILD_DEMO )

INSTALL( FILES ${antigrain_BINARY_DIR}/bin/AggConfigOutBuild.cmake DESTINATION "bin" RENAME AggConfig.cmake )
INSTALL( FILES ${antigrain_BINARY_DIR}/bin/AggConfig.cmake DESTINATION "bin" )
Expand Down
Loading

0 comments on commit 0d6876e

Please sign in to comment.