Skip to content

Commit

Permalink
Merge branch 'cmake_upgrade'
Browse files Browse the repository at this point in the history
  • Loading branch information
xakod committed Mar 16, 2022
2 parents 3246cd7 + 9a5c262 commit 89fa0c1
Showing 1 changed file with 22 additions and 52 deletions.
74 changes: 22 additions & 52 deletions agg-src/myapp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,33 +1,12 @@
PROJECT( MyAggApp )

#modify this!!
SET( AGG_DIR ${antigrain_BINARY_DIR} )

# additional are modified Find routines
SET ( CMAKE_MODULE_PATH "${MyAggApp_BINARY_DIR}" )

CMAKE_MINIMUM_REQUIRED( VERSION 2.4.8 )
CMAKE_MINIMUM_REQUIRED( VERSION 3.0 )

# for the moment this decides the platform code.
IF(WIN32)
ADD_DEFINITIONS( -D_MSWVC_ -D_CRT_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE )
SET( WIN32GUI WIN32 )
INCLUDE_DIRECTORIES( ${antigrain_SOURCE_DIR}/font_win32_tt )
INCLUDE_DIRECTORIES( ${antigrain_SOURCE_DIR}/font_freetype )
ENDIF(WIN32)

IF(UNIX)
ADD_DEFINITIONS( -D__UNIX__ )
SET( WIN32GUI "" )
INCLUDE_DIRECTORIES( ${antigrain_SOURCE_DIR}/font_freetype )

FIND_PACKAGE(X11)
IF(X11_FOUND)
INCLUDE_DIRECTORIES(${X11_INCLUDE_DIRS})
LINK_LIBRARIES(${X11_LIBRARIES})
ENDIF(X11_FOUND)

ENDIF(UNIX)

##################################################
# Set all includes, flags, libraries, related to Agg
Expand All @@ -41,45 +20,36 @@ ELSE( AGG_FOUND )
MESSAGE( "AGG library was not found" )
ENDIF( AGG_FOUND )

##################################################
# 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 )

ADD_EXECUTABLE( my_demo ${WIN32GUI}
my_demo.cpp
)

TARGET_LINK_LIBRARIES ( my_demo antigrain)

IF( agg_USE_AGG2D )
ADD_EXECUTABLE( agg2d_demo ${WIN32GUI}
agg2d_demo.cpp
)
TARGET_LINK_LIBRARIES ( agg2d_demo antigrain)
ENDIF( agg_USE_AGG2D )

# for the moment this decides the platform code.
IF(WIN32)
ADD_DEFINITIONS( -D_CRT_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE )
SET( WIN32GUI WIN32 )
ENDIF(WIN32)

IF(UNIX)
ADD_DEFINITIONS( -D__UNIX__ )
SET( WIN32GUI "" )

FIND_PACKAGE(X11)
IF(X11_FOUND)
TARGET_INCLUDE_DIRECTORIES( agg2d_demo ${X11_INCLUDE_DIRS})
TARGET_LINK_LIBRARIES( agg2d_demo ${X11_LIBRARIES})
TARGET_INCLUDE_DIRECTORIES( my_demo ${X11_INCLUDE_DIRS})
TARGET_LINK_LIBRARIES( my_demo ${X11_LIBRARIES})
ENDIF(X11_FOUND)

ENDIF(UNIX)

0 comments on commit 89fa0c1

Please sign in to comment.