Permalink
Browse files

Updated cmake macros

  • Loading branch information...
2 parents 1a821c3 + 3907d38 commit 2ac62a150dd333e51aa995c54289ec0d65374ae8 @drahosp drahosp committed Aug 20, 2012
Showing with 40 additions and 77 deletions.
  1. +2 −21 CMakeLists.txt
  2. +0 −5 Readme
  3. +38 −51 examples/CMakeLists.txt
View
@@ -187,26 +187,7 @@ endif ( USE_EXT_GD )
add_subdirectory ( tests )
add_subdirectory ( examples )
-set ( CPACK_PACKAGE_NAME "libgd" )
-set ( CPACK_PACKAGE_DESCRIPTION_SUMMARY "libGD, powerful and easy to use graphic library" )
-set ( CPACK_PACKAGE_VENDOR "http://www.libgd.org" )
-set ( CPACK_PACKAGE_VERSION_MAJOR "2" )
-set ( CPACK_PACKAGE_VERSION_MINOR "1" )
-set ( CPACK_PACKAGE_VERSION_PATCH "0" )
-
-if ( WIN32 )
- set ( CPACK_GENERATOR ZIP )
-else ( WIN32 )
- set ( CPACK_GENERATOR TGZ )
-endif ( WIN32 )
-
-set ( CPACK_SOURCE_GENERATOR TGZ )
-set ( CPACK_SOURCE_IGNORE_FILES "~$" "\\\\.swp$" "\\\\.cvsignore$" "^${PROJECT_SOURCE_DIR}.*/CVS/"
- "^${PROJECT_SOURCE_DIR}/debian/" "^${PROJECT_SOURCE_DIR}/old/" "^${PROJECT_SOURCE_DIR}/bld/"
- "^${PROJECT_SOURCE_DIR}/autom4te\\\\.cache/" )
-#~ install(FILES ${top_level_DOCFILES} DESTINATION ${DOC_DIR}) # LuaDist: ???
-include ( CPack )
-
-# LuaDist: install additional stuff
+install_doc ( ${top_level_DOCFILES} )
+
install_data ( ChangeLog NEWS docs/README.TXT docs/README-JPEG.TXT docs/README.JPN
docs/README.TESTING )
View
5 Readme
@@ -1,5 +0,0 @@
-Sorry, this package in not at the moment provided by LuaDist in source form.
-
-Please use your native system package manager to install libgd-2.0.35.
-
-On windows or systems lacking any package management install libgd manually.
View
@@ -1,54 +1,41 @@
-include_directories (BEFORE "${GD_SOURCE_DIR}/src" "${CMAKE_BINARY_DIR}")
-
-SET(TESTS_FILES
-# resize
-# ellipseaa
-# ellipse
- arc
-# ellipsearc
- crop
-# ellfullaa
- tgaread
- # nnquant
- gif
-)
-
-if (JPEG_FOUND)
- SET(TESTS_FILES
- "${TESTS_FILES}"
- nnquant
- copyrotated
- flip
- )
-endif (JPEG_FOUND)
-
-
-if (TIFF_FOUND)
- SET(TESTS_FILES
- "${TESTS_FILES}"
- tiffread
- )
-endif (TIFF_FOUND)
-
-FOREACH(test_name ${TESTS_FILES})
- add_executable(${test_name} "${test_name}.c")
- target_link_libraries (${test_name} ${GD_LIB})
-
+include_directories ( BEFORE "${GD_SOURCE_DIR}/src" "${CMAKE_BINARY_DIR}" )
+
+set ( TESTS_FILES # resize
+ # ellipseaa
+ # ellipse
+ # ellipsearc
+ # ellfullaa
+ # nnquant
+ gif )
+if ( PNG_FOUND )
+ set ( TESTS_FILES "${TESTS_FILES}" arc crop tgaread )
+endif ( )
+
+if ( JPEG_FOUND )
+ set ( TESTS_FILES "${TESTS_FILES}" nnquant copyrotated flip )
+endif ( JPEG_FOUND )
+
+if ( TIFF_FOUND )
+ set ( TESTS_FILES "${TESTS_FILES}" tiffread )
+endif ( TIFF_FOUND )
+
+foreach ( test_name ${TESTS_FILES} )
+ add_executable ( ${test_name} "${test_name}.c" )
+ target_link_libraries ( ${test_name} ${GD_LIB} )
# LuaDist: added instalation of examples:
- install(TARGETS ${test_name} RUNTIME DESTINATION ${INSTALL_EXAMPLE} LIBRARY DESTINATION ${INSTALL_EXAMPLE} ARCHIVE DESTINATION ${INSTALL_EXAMPLE})
-ENDFOREACH(test_name)
-
-if (WIN32 AND NOT MINGW AND NOT MSYS)
- add_executable(windows WIN32 "windows.c")
- target_link_libraries (windows ${GD_LIB})
-else (WIN32 AND NOT MINGW AND NOT MSYS)
- if (MINGW OR MSYS)
- add_executable(windows "windows.c")
- add_definitions("-mwindows")
- target_link_libraries(windows ${GD_LIB} stdc++ gdi32)
- endif (MINGW OR MSYS)
-endif (WIN32 AND NOT MINGW AND NOT MSYS)
-
+ install ( TARGETS ${test_name} DESTINATION ${INSTALL_EXAMPLE} COMPONENT Example )
+endforeach ( test_name )
+
+if ( WIN32 AND NOT MINGW AND NOT MSYS )
+ add_executable ( windows WIN32 "windows.c" )
+ target_link_libraries ( windows ${GD_LIB} )
+else ( WIN32 AND NOT MINGW AND NOT MSYS )
+ if ( MINGW OR MSYS )
+ add_executable ( windows "windows.c" )
+ add_definitions ( "-mwindows" )
+ target_link_libraries ( windows ${GD_LIB} stdc++ gdi32 )
+ endif ( MINGW OR MSYS )
+endif ( WIN32 AND NOT MINGW AND NOT MSYS )
# LuaDist: install sample images
-install(FILES noIcon.pic test_crop_threshold.png noIcon.sgi noIcon.tga noIconAlpha.tga DESTINATION ${INSTALL_EXAMPLE})
+install_example ( noIcon.pic test_crop_threshold.png noIcon.sgi noIcon.tga noIconAlpha.tga )

0 comments on commit 2ac62a1

Please sign in to comment.