diff options
| author | Mickael Savinaud <savmickael@users.noreply.github.com> | 2011-07-13 16:49:53 +0000 |
|---|---|---|
| committer | Mickael Savinaud <savmickael@users.noreply.github.com> | 2011-07-13 16:49:53 +0000 |
| commit | 65f7f8dc506e3c889e137bef1c730644fc7798eb (patch) | |
| tree | d2b3b3c100541849d7e47e3982b053a61bcd2eda /thirdparty | |
| parent | 36c8d85f4335b3d6dd518e45efe3b6ccedda4c06 (diff) | |
improved some CMakeLists files linked to the build of applications which used thirdparty
Diffstat (limited to 'thirdparty')
| -rw-r--r-- | thirdparty/CMakeLists.txt | 167 | ||||
| -rw-r--r-- | thirdparty/FindLCMS.cmake | 24 | ||||
| -rw-r--r-- | thirdparty/FindLCMS2.cmake | 23 |
3 files changed, 148 insertions, 66 deletions
diff --git a/thirdparty/CMakeLists.txt b/thirdparty/CMakeLists.txt index 08710380..c779ff95 100644 --- a/thirdparty/CMakeLists.txt +++ b/thirdparty/CMakeLists.txt @@ -1,20 +1,149 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6) -IF(BUILD_THIRDPARTY) -# -IF(NOT ZLIB_FOUND) - ADD_SUBDIRECTORY(libz) -ENDIF(NOT ZLIB_FOUND) -# -IF(NOT PNG_FOUND) - ADD_SUBDIRECTORY(libpng) -ENDIF(NOT PNG_FOUND) -# -IF(NOT LCMS2_FOUND) - ADD_SUBDIRECTORY(liblcms2) -ENDIF(NOT LCMS2_FOUND) -# -IF(NOT TIFF_FOUND) - ADD_SUBDIRECTORY(libtiff) -ENDIF(NOT TIFF_FOUND) -# -ENDIF(BUILD_THIRDPARTY) + +IF(UNIX OR CYGWIN) + SET(CMAKE_INCLUDE_PATH /usr/include /usr/local/include /opt/include + /opt/local/include /usr/include/libpng /usr/include/libpng14 + /usr/include/libpng12 /usr/local/include/libpng + /usr/local/include/libpng14 /usr/local/include/libpng12 + /opt/include/libpng /opt/include/libpng14 /opt/include/libpng12 + /opt/local/include/libpng /opt/local/include/libpng14) + SET(CMAKE_LIBRARY_PATH /usr/lib /usr/local/lib /opt/lib /opt/local/lib) +ENDIF(UNIX OR CYGWIN) + +#------------ +# Try to find lib Z +FIND_PACKAGE(ZLIB) + +IF(ZLIB_FOUND) + + SET(Z_LIBNAME ${ZLIB_LIBRARIES} PARENT_SCOPE) + SET(Z_INCLUDE_DIRNAME ${ZLIB_INCLUDE_DIRS} PARENT_SCOPE) + message("Your system seems to have a Z lib available, we will used it to generate PNG lib") + +ELSE (ZLIB_FOUND) # not found + + IF(BUILD_THIRDPARTY) + # Try to build it + message("We will build Z lib from thirdparty") + ADD_SUBDIRECTORY(libz) + SET(Z_LIBNAME ${ZLIB_LIBRARIES} PARENT_SCOPE) + SET(Z_INCLUDE_DIRNAME ${ZLIB_INCLUDE_DIRS} PARENT_SCOPE) + SET(ZLIB_FOUND 1) + ELSE (BUILD_THIRDPARTY) + message("Z lib not found, activate BUILD_THIRDPARTY if you want build it (necessary to build libPNG)") + ENDIF(BUILD_THIRDPARTY) + +ENDIF(ZLIB_FOUND) + +#------------ +# Try to find lib PNG (which depends to zlib) +IF (ZLIB_FOUND) + FIND_PACKAGE(PNG) + + IF(PNG_FOUND) + + message("Your system seems to have a PNG lib available, we will used it") + SET(HAVE_PNG_H 1 PARENT_SCOPE) + SET(HAVE_LIBPNG 1 PARENT_SCOPE) + SET(PNG_LIBNAME ${PNG_LIBRARIES} PARENT_SCOPE) + SET(PNG_INCLUDE_DIRNAME ${PNG_INCLUDE_DIR} PARENT_SCOPE) + + ELSE(PNG_FOUND) # not found + + IF(BUILD_THIRDPARTY) + # Try to build it + message("We will build PNG lib from thirdparty") + ADD_SUBDIRECTORY(libpng) + SET(HAVE_PNG_H 1 PARENT_SCOPE) + SET(HAVE_LIBPNG 1 PARENT_SCOPE) + SET(PNG_LIBNAME ${PNG_LIBRARIES} PARENT_SCOPE) + SET(PNG_INCLUDE_DIRNAME ${PNG_INCLUDE_DIR} PARENT_SCOPE) + ELSE (BUILD_THIRDPARTY) + SET(HAVE_PNG_H 0 PARENT_SCOPE) + SET(HAVE_LIBPNG 0 PARENT_SCOPE) + message("PNG lib not found, activate BUILD_THIRDPARTY if you want build it") + ENDIF(BUILD_THIRDPARTY) + + ENDIF(PNG_FOUND) + +ELSE (ZLIB_FOUND) + message(WARNING "To add lib PNG we need that ZLIB was previously found") +ENDIF (ZLIB_FOUND) + +#------------ +# Try to find lib TIFF +FIND_PACKAGE(TIFF) + +IF(TIFF_FOUND) + + message("Your system seems to have a TIFF lib available, we will used it") + SET(HAVE_TIFF_H 1 PARENT_SCOPE) + SET(HAVE_LIBTIFF 1 PARENT_SCOPE) + SET(TIFF_LIBNAME ${TIFF_LIBRARIES} PARENT_SCOPE) + SET(TIFF_INCLUDE_DIRNAME ${TIFF_INCLUDE_DIR} PARENT_SCOPE) + +ELSE (TIFF_FOUND) # not found + + IF(BUILD_THIRDPARTY) + # Try to build it + message("We will build TIFF lib from thirdparty") + ADD_SUBDIRECTORY(libtiff) + SET(TIFF_LIBNAME ${TIFF_LIBRARIES} PARENT_SCOPE) + SET(TIFF_INCLUDE_DIRNAME ${TIFF_INCLUDE_DIR} PARENT_SCOPE) + SET(HAVE_TIFF_H 1 PARENT_SCOPE) + SET(HAVE_LIBTIFF 1 PARENT_SCOPE) + ELSE (BUILD_THIRDPARTY) + SET(HAVE_TIFF_H 0 PARENT_SCOPE) + SET(HAVE_LIBTIFF 0 PARENT_SCOPE) + message("TIFF lib not found, activate BUILD_THIRDPARTY if you want build it") + ENDIF(BUILD_THIRDPARTY) + +ENDIF(TIFF_FOUND) + +#------------ +# Try to find lib LCMS2 (or by default LCMS) +FIND_PACKAGE(LCMS2) + +IF(LCMS2_FOUND) + + message("Your system seems to have a LCMS2 lib available, we will used it") + SET(HAVE_LCMS2_H 1 PARENT_SCOPE) + SET(HAVE_LIBLCMS2 1 PARENT_SCOPE) + SET(LCMS_LIBNAME ${LCMS2_LIBRARIES} PARENT_SCOPE) + SET(LCMS_INCLUDE_DIRNAME ${LCMS2_INCLUDE_DIRS} PARENT_SCOPE) + +ELSE (LCMS2_FOUND) # not found lcms2 + # try to find LCMS + FIND_PACKAGE(LCMS) + + IF(LCMS_FOUND) + + message("Your system seems to have a LCMS lib available, we will used it") + SET(HAVE_LCMS_H 1 PARENT_SCOPE) + SET(HAVE_LIBLCMS 1 PARENT_SCOPE) + SET(LCMS_LIBNAME ${LCMS_LIBRARIES} PARENT_SCOPE) + SET(LCMS_INCLUDE_DIRNAME ${LCMS_INCLUDE_DIRS} PARENT_SCOPE) + + ELSE (LCMS_FOUND) # not found lcms + SET(HAVE_LCMS_H 0 PARENT_SCOPE) + SET(HAVE_LIBLCMS 0 PARENT_SCOPE) + + IF( BUILD_THIRDPARTY) + + # Try to build lcms2 + message("We will build LCMS2 lib from thirdparty") + ADD_SUBDIRECTORY(liblcms2) + SET(LCMS_LIBNAME "lcms2" PARENT_SCOPE) + SET(LCMS_INCLUDE_DIRNAME ${OPENJPEG_SOURCE_DIR}/thirdparty/liblcms2/include PARENT_SCOPE) # + SET(HAVE_LCMS2_H 1 PARENT_SCOPE) + SET(HAVE_LIBLCMS2 1 PARENT_SCOPE) + ELSE (BUILD_THIRDPARTY) + SET(HAVE_LCMS2_H 0 PARENT_SCOPE) + SET(HAVE_LIBLCMS2 0 PARENT_SCOPE) + message("LCMS2 or LCMS lib not found, activate BUILD_THIRDPARTY if you want build it") + ENDIF(BUILD_THIRDPARTY) + + ENDIF (LCMS_FOUND) +ENDIF(LCMS2_FOUND) + + diff --git a/thirdparty/FindLCMS.cmake b/thirdparty/FindLCMS.cmake deleted file mode 100644 index 8125e620..00000000 --- a/thirdparty/FindLCMS.cmake +++ /dev/null @@ -1,24 +0,0 @@ -# - Find LCMS library -# Find the native LCMS includes and library -# This module defines -# LCMS_INCLUDE_DIR, where to find tiff.h, etc. -# LCMS_LIBRARIES, libraries to link against to use LCMS. -# LCMS_FOUND, If false, do not try to use LCMS. -# also defined, but not for general use are -# LCMS_LIBRARY, where to find the LCMS library. -# -FIND_PATH(LCMS_INCLUDE_DIR lcms.h PATHS /usr/include /usr/local/include /opt/include /opt/local/include) -# -SET(LCMS_NAMES ${LCMS_NAMES} lcms liblcms liblcms_static) -FIND_LIBRARY(LCMS_LIBRARY NAMES ${LCMS_NAMES} ) -# -# handle the QUIETLY and REQUIRED arguments and set LCMS_FOUND to TRUE if -# all listed variables are TRUE -INCLUDE(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(LCMS DEFAULT_MSG LCMS_LIBRARY LCMS_INCLUDE_DIR) -# -IF(LCMS_FOUND) - SET( LCMS_LIBRARIES ${LCMS_LIBRARY} ) -ENDIF(LCMS_FOUND) - -MARK_AS_ADVANCED(LCMS_INCLUDE_DIR LCMS_LIBRARY) diff --git a/thirdparty/FindLCMS2.cmake b/thirdparty/FindLCMS2.cmake deleted file mode 100644 index 219800e8..00000000 --- a/thirdparty/FindLCMS2.cmake +++ /dev/null @@ -1,23 +0,0 @@ -# - Find LCMS2 library -# Find the native LCMS2 includes and library -# This module defines -# LCMS2_INCLUDE_DIR, where to find tiff.h, etc. -# LCMS2_LIBRARIES, libraries to link against to use LCMS2. -# LCMS2_FOUND, If false, do not try to use LCMS2. -# also defined, but not for general use are -# LCMS2_LIBRARY, where to find the LCMS2 library. -# -FIND_PATH(LCMS2_INCLUDE_DIR lcms2.h PATHS /usr/include /usr/local/include /opt/include /opt/local/include) -SET(LCMS2_NAMES ${LCMS2_NAMES} lcms2 liblcms2 liblcms2_static) -FIND_LIBRARY(LCMS2_LIBRARY NAMES ${LCMS2_NAMES} ) - -# handle the QUIETLY and REQUIRED arguments and set LCMS2_FOUND to TRUE if -# all listed variables are TRUE -INCLUDE(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(LCMS2 DEFAULT_MSG LCMS2_LIBRARY LCMS2_INCLUDE_DIR) -# -IF(LCMS2_FOUND) - SET( LCMS2_LIBRARIES ${LCMS2_LIBRARY} ) -ENDIF(LCMS2_FOUND) -# -MARK_AS_ADVANCED(LCMS2_INCLUDE_DIR LCMS2_LIBRARY) |
