Skip to content

Commit

Permalink
Merge pull request ghaerr#8 from NicolasIriarte/1-fix-intallation-path
Browse files Browse the repository at this point in the history
Update CMake files to export all headers and pkgconfig files.
  • Loading branch information
ghaerr authored Jul 21, 2022
2 parents ecc670b + abc899a commit e7db22b
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 18 deletions.
10 changes: 10 additions & 0 deletions agg-src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,21 @@ CONFIGURE_FILE( ${antigrain_SOURCE_DIR}/bin/UseAgg.cmake.in
${antigrain_BINARY_DIR}/bin/UseAgg.cmake
@ONLY IMMEDIATE )

SET( prefix ${CMAKE_INSTALL_PREFIX} )
SET( exec_prefix ${CMAKE_INSTALL_PREFIX}/bin )
SET( libdir ${CMAKE_INSTALL_PREFIX}/lib )
SET( includedir ${CMAKE_INSTALL_PREFIX}/include )

CONFIGURE_FILE( ${antigrain_SOURCE_DIR}/libagg.pc.in libagg.pc
@ONLY )


ADD_SUBDIRECTORY( myapp )

INSTALL( FILES ${antigrain_BINARY_DIR}/bin/AggConfigOutBuild.cmake DESTINATION "bin" RENAME AggConfig.cmake )
INSTALL( FILES ${antigrain_BINARY_DIR}/bin/AggConfig.cmake DESTINATION "bin" )
INSTALL( FILES ${antigrain_BINARY_DIR}/bin/UseAgg.cmake DESTINATION "bin" )
INSTALL( FILES ${antigrain_BINARY_DIR}/libagg.pc DESTINATION "lib/pkgconfig" )

#-------------------------------------------------------------------
# Build a CPack installer if CPack is available and this is a build
Expand Down
42 changes: 24 additions & 18 deletions agg-src/src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
SET( util_HEADERS
${antigrain_SOURCE_DIR}/include/util/agg_color_conv_rgb8.h
${antigrain_SOURCE_DIR}/include/util/agg_color_conv_rgb16.h
${antigrain_SOURCE_DIR}/include/util/agg_color_conv.h )

SET( antigrain_HEADERS
${antigrain_SOURCE_DIR}/include/agg_alpha_mask_u8.h
Expand All @@ -11,6 +15,7 @@ SET( antigrain_HEADERS
${antigrain_SOURCE_DIR}/include/agg_bounding_rect.h
${antigrain_SOURCE_DIR}/include/agg_bspline.h
${antigrain_SOURCE_DIR}/include/agg_clip_liang_barsky.h
${antigrain_SOURCE_DIR}/include/agg_pixfmt_base.h
${antigrain_SOURCE_DIR}/include/agg_color_gray.h
${antigrain_SOURCE_DIR}/include/agg_color_rgba.h
${antigrain_SOURCE_DIR}/include/agg_config.h
Expand Down Expand Up @@ -88,6 +93,7 @@ SET( antigrain_HEADERS
${antigrain_SOURCE_DIR}/include/agg_span_converter.h
${antigrain_SOURCE_DIR}/include/agg_span_gouraud.h
${antigrain_SOURCE_DIR}/include/agg_span_gouraud_gray.h
${antigrain_SOURCE_DIR}/include/agg_rasterizer_scanline_aa_nogamma.h
${antigrain_SOURCE_DIR}/include/agg_span_gouraud_rgba.h
${antigrain_SOURCE_DIR}/include/agg_span_gradient.h
${antigrain_SOURCE_DIR}/include/agg_span_gradient_alpha.h
Expand Down Expand Up @@ -122,7 +128,6 @@ SET( antigrain_HEADERS
${antigrain_SOURCE_DIR}/include/agg_vpgen_clip_polygon.h
${antigrain_SOURCE_DIR}/include/agg_vpgen_clip_polyline.h
${antigrain_SOURCE_DIR}/include/agg_vpgen_segmentator.h

${antigrain_SOURCE_DIR}/include/agg_span_gradient_contour.h
${antigrain_SOURCE_DIR}/include/agg_span_gradient_image.h
)
Expand Down Expand Up @@ -158,7 +163,7 @@ ADD_LIBRARY( antigrain
)

#controls code for interactive modifying samples
SET( controls_HEADERS
SET( controls_HEADERS
${antigrain_SOURCE_DIR}/include/ctrl/agg_slider_ctrl.h
${antigrain_SOURCE_DIR}/include/ctrl/agg_spline_ctrl.h
${antigrain_SOURCE_DIR}/include/ctrl/agg_scale_ctrl.h
Expand All @@ -171,7 +176,7 @@ SET( controls_HEADERS
${antigrain_SOURCE_DIR}/include/ctrl/agg_bezier_ctrl.h
)

ADD_LIBRARY( controls
ADD_LIBRARY( controls
ctrl/agg_spline_ctrl.cpp
ctrl/agg_slider_ctrl.cpp
ctrl/agg_scale_ctrl.cpp
Expand All @@ -194,14 +199,14 @@ IF ( agg_USE_FREETYPE )
ADD_LIBRARY( freetypefont
../font_freetype/agg_font_freetype.h
../font_freetype/agg_font_freetype.cpp
)
)
SET_TARGET_PROPERTIES( freetypefont PROPERTIES OUTPUT_NAME aggfontfreetype${PFDEBUG} )
INSTALL( TARGETS freetypefont DESTINATION lib )
INSTALL( FILES ../font_freetype/agg_font_freetype.h DESTINATION agg/font_freetype )
INSTALL( FILES ../font_freetype/agg_font_freetype.h DESTINATION agg/font_freetype )
ENDIF ( agg_USE_FREETYPE )

#platform stuff to ease sample use
SET( platform_HEADERS
SET( platform_HEADERS
${antigrain_SOURCE_DIR}/include/platform/agg_platform_support.h
)

Expand All @@ -212,32 +217,32 @@ IF(WIN32)
../src/platform/win32/agg_win32_bmp.cpp
../src/platform/win32/agg_platform_support.cpp
../font_win32_tt/agg_font_win32_tt.cpp
${platform_HEADERS}

${platform_HEADERS}
)
INSTALL( FILES ../font_win32_tt/agg_font_win32_tt.h DESTINATION agg/font_win32_tt )
INSTALL( FILES ../font_win32_tt/agg_font_win32_tt.h DESTINATION agg/font_win32_tt )
ENDIF(WIN32)
IF(UNIX)
ADD_LIBRARY( platform
../src/platform/X11/agg_platform_support.cpp

${platform_HEADERS}
${platform_HEADERS}
)
ENDIF(UNIX)
IF(APPLE)
ADD_LIBRARY( platform
../src/platform/mac/agg_mac_pmap.cpp
../src/platform/mac/agg_platform_support.cpp

${platform_HEADERS}
${platform_HEADERS}
)
ENDIF(APPLE)

IF( SDL_FOUND AND agg_USE_SDL_PLATFORM )
ADD_LIBRARY( sdlplatform
../src/platform/sdl/agg_platform_support.cpp
${platform_HEADERS}

${platform_HEADERS}
)
INSTALL( TARGETS sdlplatform DESTINATION lib )
SET_TARGET_PROPERTIES( sdlplatform PROPERTIES OUTPUT_NAME aggsdlplatform${PFDEBUG} )
Expand All @@ -253,7 +258,7 @@ IF ( agg_USE_GPC )
../gpc/gpc.h
)
INSTALL( TARGETS gpcbool DESTINATION lib )
INSTALL( FILES ../gpc/gpc.h DESTINATION agg/gpc )
INSTALL( FILES ../gpc/gpc.h DESTINATION agg/gpc )
SET_TARGET_PROPERTIES( gpcbool PROPERTIES OUTPUT_NAME gpc${PFDEBUG} )
ENDIF ( agg_USE_GPC )

Expand All @@ -265,15 +270,16 @@ IF ( agg_USE_AGG2D )
../agg2d/agg2d.h
)
INSTALL( TARGETS agg2d DESTINATION lib )
INSTALL( FILES ../agg2d/agg2d.h DESTINATION agg/agg2d )
INSTALL( FILES ../agg2d/agg2d.h DESTINATION agg/agg2d )
SET_TARGET_PROPERTIES( agg2d PROPERTIES OUTPUT_NAME agg2d${PFDEBUG} )
ENDIF ( agg_USE_AGG2D )

SET_TARGET_PROPERTIES( antigrain PROPERTIES OUTPUT_NAME agg${PFDEBUG} )
SET_TARGET_PROPERTIES( controls PROPERTIES OUTPUT_NAME aggctrl${PFDEBUG} )
SET_TARGET_PROPERTIES( platform PROPERTIES OUTPUT_NAME aggplatform${PFDEBUG} )

INSTALL( FILES ${antigrain_HEADERS} DESTINATION agg/include )
INSTALL( FILES ${controls_HEADERS} DESTINATION agg/include/ctrl )
INSTALL( FILES ${platform_HEADERS} DESTINATION agg/include/platform )
INSTALL( FILES ${antigrain_HEADERS} DESTINATION include/agg2 )
INSTALL( FILES ${controls_HEADERS} DESTINATION include/agg2/ctrl )
INSTALL( FILES ${platform_HEADERS} DESTINATION include/agg2/platform )
INSTALL( FILES ${util_HEADERS} DESTINATION include/agg2/util )
INSTALL( TARGETS antigrain controls platform DESTINATION lib )

0 comments on commit e7db22b

Please sign in to comment.