diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 59 |
1 files changed, 41 insertions, 18 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index b0342a7..291ce86 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,8 @@ # $Id$ +SET(PACKAGE GD) +SET(PACKAGE_NAME GD) + CMAKE_MINIMUM_REQUIRED(VERSION 2.4.3 FATAL_ERROR) PROJECT(GD) SET(CPACK_PACKAGE_NAME "libgd") @@ -23,6 +26,7 @@ set(CPACK_SOURCE_IGNORE_FILES "^${PROJECT_SOURCE_DIR}/bld/" "^${PROJECT_SOURCE_DIR}/autom4te\\\\.cache/" ) + INCLUDE(CPack) SET(CMAKE_MODULE_PATH "${GD_SOURCE_DIR}/cmake/modules") @@ -30,10 +34,12 @@ if (BUILD_TEST) ENABLE_TESTING() endif(BUILD_TEST) -STRING(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_TOLOWER) -IF (CMAKE_BUILD_TYPE_TOLOWER MATCHES debug) - set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wall -O0") -ENDIF (CMAKE_BUILD_TYPE_TOLOWER MATCHES debug) +if (NOT WIN32) + STRING(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_TOLOWER) + IF (CMAKE_BUILD_TYPE_TOLOWER MATCHES debug) + set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wall -O0") + ENDIF (CMAKE_BUILD_TYPE_TOLOWER MATCHES debug) +endif (NOT WIN32) if (USE_EXT_GD) message("Using GD at: ${USE_EXT_GD}") @@ -52,6 +58,7 @@ if (USE_EXT_GD) message("No gd found") endif (GD_FOUND) else (USE_EXT_GD) + SET(GD_VERSION_MAJOR "2") SET(GD_VERSION_MINOR "1") SET(GD_VERSION_PATCH "0") @@ -60,9 +67,6 @@ else (USE_EXT_GD) SET(GD_VERSION_INT "20100") - SET(PACKAGE GD) - SET(PACKAGE_NAME GD) - SET(CMAKE_REQUIRED_INCLUDES "/usr/include" "/usr/local/include") message(STATUS "ft2build: ${CMAKE_REQUIRED_INCLUDES}") @@ -74,18 +78,37 @@ else (USE_EXT_GD) include(CheckPrototypeExists) SET(FONTCONFIG_FIND_QUIETLY, 1) - FIND_PACKAGE(PNG REQUIRED) - FIND_PACKAGE(ZLIB) - FIND_PACKAGE(JPEG) - FIND_PACKAGE(TIFF) + if (ENABLE_PNG) + FIND_PACKAGE(PNG REQUIRED) + endif (ENABLE_PNG) + + if (ENABLE_PNG) + FIND_PACKAGE(ZLIB) + endif (ENABLE_PNG) + + if (ENABLE_JPEG) + FIND_PACKAGE(JPEG) + endif (ENABLE_JPEG) + + if (ENABLE_TIFF) + FIND_PACKAGE(TIFF) + endif (ENABLE_TIFF) + + IF (NOT WIN32) + FIND_PACKAGE(PTHREAD) + ENDIF (NOT WIN32) + + if (ENABLE_FREETYPE) + FIND_PACKAGE(Freetype) + endif (ENABLE_FREETYPE) -IF (NOT WIN32) - FIND_PACKAGE(PTHREAD) -ENDIF (NOT WIN32) - FIND_PACKAGE(Freetype) - FIND_PACKAGE(XPM) + if (ENABLE_XPM) + FIND_PACKAGE(XPM) + endif (ENABLE_XPM) -# FIND_PACKAGE(Fontconfig) + if (ENABLE_FONTCONFIG) + FIND_PACKAGE(Fontconfig) + endif (ENABLE_FONTCONFIG) if (FREETYPE_FOUND) INCLUDE_DIRECTORIES(${FREETYPE_INCLUDE_DIR}) @@ -138,7 +161,7 @@ ENDIF (NOT WIN32) if (WIN32) SET(GD_LIB bgd) - ADD_DEFINITIONS( -DWIN32 -D_WIN32 -DMSWIN32 -DBGDWIN32) + ADD_DEFINITIONS( -DWIN32 -D_WIN32 -DMSWIN32 -DBGDWIN32 -DWINVER=0x0500 -D_WIN32_WINNT=0x0500 -D_WIN32_IE=0x0600) else(WIN32) SET(GD_LIB gd) endif(WIN32) |