summaryrefslogtreecommitdiffstats
path: root/config/cmake/HDFMacros.cmake
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2011-05-04 16:18:22 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2011-05-04 16:18:22 (GMT)
commitece690cdb66a1d116f557fca4f5bf5800e4bc522 (patch)
tree0e5096d79cf25d6d1d0e6e6e1c853222f7b56eee /config/cmake/HDFMacros.cmake
parent82e9f2291208be85acc299839e717b5f5b620ec8 (diff)
downloadhdf5-ece690cdb66a1d116f557fca4f5bf5800e4bc522.zip
hdf5-ece690cdb66a1d116f557fca4f5bf5800e4bc522.tar.gz
hdf5-ece690cdb66a1d116f557fca4f5bf5800e4bc522.tar.bz2
[svn-r20717] Refactor ext lib import and install.
Change case of tools subtests to not conflict with tools tests. Tested: windows, local linux
Diffstat (limited to 'config/cmake/HDFMacros.cmake')
-rw-r--r--config/cmake/HDFMacros.cmake82
1 files changed, 65 insertions, 17 deletions
diff --git a/config/cmake/HDFMacros.cmake b/config/cmake/HDFMacros.cmake
index d8efad0..345c50d 100644
--- a/config/cmake/HDFMacros.cmake
+++ b/config/cmake/HDFMacros.cmake
@@ -48,13 +48,26 @@ MACRO (EXTERNAL_JPEG_LIBRARY compress_type jpeg_pic)
ELSE (${BLDTYPE} MATCHES "Debug")
SET (DBG_EXT "")
ENDIF (${BLDTYPE} MATCHES "Debug")
- SET (EXTERNAL_LIBRARY_LIST ${EXTERNAL_LIBRARY_LIST} ${JPEG_LIBRARY})
- IF (WIN32 AND NOT MINGW)
- SET (JPEG_LIBRARY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BLDTYPE}/libjpeg${DBG_EXT}${CMAKE_STATIC_LIBRARY_SUFFIX}")
+ # Create imported target szip
+ ADD_LIBRARY(jpeg STATIC IMPORTED)
+ ADD_DEPENDENCIES (jpeg JPEG)
+
+ IF (WIN32 AND NOT MINGW)
+ SET_TARGET_PROPERTIES(jpeg PROPERTIES
+ IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BLDTYPE}/libjpeg${DBG_EXT}${CMAKE_STATIC_LIBRARY_SUFFIX}"
+ IMPORTED_LINK_INTERFACE_LANGUAGES "C"
+ )
ELSE (WIN32 AND NOT MINGW)
- SET (JPEG_LIBRARY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libjpeg${DBG_EXT}${CMAKE_STATIC_LIBRARY_SUFFIX}")
+ SET_TARGET_PROPERTIES(jpeg PROPERTIES
+ IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libjpeg${DBG_EXT}${CMAKE_STATIC_LIBRARY_SUFFIX}"
+ IMPORTED_LINK_INTERFACE_LANGUAGES "C"
+ )
ENDIF (WIN32 AND NOT MINGW)
+
+# INCLUDE (${BINARY_DIR}/JPEG-targets.cmake)
+ SET (JPEG_LIBRARY "jpeg")
+
SET (JPEG_INCLUDE_DIR_GEN "${BINARY_DIR}")
SET (JPEG_INCLUDE_DIR "${SOURCE_DIR}/src")
SET (JPEG_FOUND 1)
@@ -117,21 +130,37 @@ MACRO (EXTERNAL_SZIP_LIBRARY compress_type libtype encoding)
SET (DBG_EXT "")
ENDIF (${BLDTYPE} MATCHES "Debug")
+ # Create imported target szip
+ ADD_LIBRARY(szip ${libtype} IMPORTED)
+ ADD_DEPENDENCIES (szip SZIP)
+
IF (${libtype} MATCHES "SHARED")
IF (WIN32 AND NOT MINGW)
- SET (SZIP_LIBRARY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BLDTYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}szip${DBG_EXT}${CMAKE_IMPORT_LIBRARY_SUFFIX}")
- SET (EXTERNAL_LIBRARYDLL_LIST ${EXTERNAL_LIBRARYDLL_LIST} "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BLDTYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}szip${DBG_EXT}${CMAKE_SHARED_LIBRARY_SUFFIX}")
+ SET_TARGET_PROPERTIES(szip PROPERTIES
+ IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BLDTYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}szip${DBG_EXT}${CMAKE_IMPORT_LIBRARY_SUFFIX}"
+ IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BLDTYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}szip${DBG_EXT}${CMAKE_SHARED_LIBRARY_SUFFIX}"
+ )
ELSE (WIN32 AND NOT MINGW)
- SET (SZIP_LIBRARY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_SHARED_LIBRARY_PREFIX}szip${DBG_EXT}${CMAKE_SHARED_LIBRARY_SUFFIX}")
+ SET_TARGET_PROPERTIES(szip PROPERTIES
+ IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_SHARED_LIBRARY_PREFIX}szip${DBG_EXT}${CMAKE_SHARED_LIBRARY_SUFFIX}"
+ )
ENDIF (WIN32 AND NOT MINGW)
ELSE (${libtype} MATCHES "SHARED")
IF (WIN32 AND NOT MINGW)
- SET (SZIP_LIBRARY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BLDTYPE}/libszip${DBG_EXT}${CMAKE_STATIC_LIBRARY_SUFFIX}")
+ SET_TARGET_PROPERTIES(szip PROPERTIES
+ IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BLDTYPE}/libszip${DBG_EXT}${CMAKE_STATIC_LIBRARY_SUFFIX}"
+ IMPORTED_LINK_INTERFACE_LANGUAGES "C"
+ )
ELSE (WIN32 AND NOT MINGW)
- SET (SZIP_LIBRARY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libszip${DBG_EXT}${CMAKE_STATIC_LIBRARY_SUFFIX}")
+ SET_TARGET_PROPERTIES(szip PROPERTIES
+ IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libszip${DBG_EXT}${CMAKE_STATIC_LIBRARY_SUFFIX}"
+ IMPORTED_LINK_INTERFACE_LANGUAGES "C"
+ )
ENDIF (WIN32 AND NOT MINGW)
ENDIF (${libtype} MATCHES "SHARED")
- SET (EXTERNAL_LIBRARY_LIST ${EXTERNAL_LIBRARY_LIST} ${SZIP_LIBRARY})
+
+# INCLUDE (${BINARY_DIR}/SZIP-targets.cmake)
+ SET (SZIP_LIBRARY "szip")
SET (SZIP_INCLUDE_DIR_GEN "${BINARY_DIR}")
SET (SZIP_INCLUDE_DIR "${SOURCE_DIR}/src")
@@ -194,26 +223,45 @@ MACRO (EXTERNAL_ZLIB_LIBRARY compress_type libtype)
ELSE (${BLDTYPE} MATCHES "Debug")
SET (DBG_EXT "")
ENDIF (${BLDTYPE} MATCHES "Debug")
+
+ # Create imported target szip
+ ADD_LIBRARY(zlib ${libtype} IMPORTED)
+ ADD_DEPENDENCIES (zlib ZLIB)
IF (${libtype} MATCHES "SHARED")
IF (WIN32 AND NOT MINGW)
- SET (ZLIB_LIBRARY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BLDTYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}zlib1${DBG_EXT}${CMAKE_IMPORT_LIBRARY_SUFFIX}")
- SET (EXTERNAL_LIBRARYDLL_LIST ${EXTERNAL_LIBRARYDLL_LIST} "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BLDTYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}zlib1${DBG_EXT}${CMAKE_SHARED_LIBRARY_SUFFIX}")
+ SET_TARGET_PROPERTIES(zlib PROPERTIES
+ IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BLDTYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}zlib1${DBG_EXT}${CMAKE_IMPORT_LIBRARY_SUFFIX}"
+ IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BLDTYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}zlib1${DBG_EXT}${CMAKE_SHARED_LIBRARY_SUFFIX}"
+ )
ELSE (WIN32 AND NOT MINGW)
- SET (ZLIB_LIBRARY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_SHARED_LIBRARY_PREFIX}z${DBG_EXT}${CMAKE_SHARED_LIBRARY_SUFFIX}")
+ SET_TARGET_PROPERTIES(zlib PROPERTIES
+ IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_SHARED_LIBRARY_PREFIX}z${DBG_EXT}${CMAKE_SHARED_LIBRARY_SUFFIX}"
+ )
ENDIF (WIN32 AND NOT MINGW)
ELSE (${libtype} MATCHES "SHARED")
IF (WIN32 AND NOT MINGW)
IF (HDF_LEGACY_NAMING)
- SET (ZLIB_LIBRARY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BLDTYPE}/zlib${DBG_EXT}${CMAKE_STATIC_LIBRARY_SUFFIX}")
+ SET_TARGET_PROPERTIES(zlib PROPERTIES
+ IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BLDTYPE}/zlib${DBG_EXT}${CMAKE_STATIC_LIBRARY_SUFFIX}"
+ IMPORTED_LINK_INTERFACE_LANGUAGES "C"
+ )
ELSE (HDF_LEGACY_NAMING)
- SET (ZLIB_LIBRARY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BLDTYPE}/libzlib${DBG_EXT}${CMAKE_STATIC_LIBRARY_SUFFIX}")
+ SET_TARGET_PROPERTIES(zlib PROPERTIES
+ IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BLDTYPE}/libzlib${DBG_EXT}${CMAKE_STATIC_LIBRARY_SUFFIX}"
+ IMPORTED_LINK_INTERFACE_LANGUAGES "C"
+ )
ENDIF (HDF_LEGACY_NAMING)
ELSE (WIN32 AND NOT MINGW)
- SET (ZLIB_LIBRARY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libz${DBG_EXT}${CMAKE_STATIC_LIBRARY_SUFFIX}")
+ SET_TARGET_PROPERTIES(zlib PROPERTIES
+ IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BLDTYPE}/libz${DBG_EXT}${CMAKE_STATIC_LIBRARY_SUFFIX}"
+ IMPORTED_LINK_INTERFACE_LANGUAGES "C"
+ )
ENDIF (WIN32 AND NOT MINGW)
ENDIF (${libtype} MATCHES "SHARED")
- SET (EXTERNAL_LIBRARY_LIST ${EXTERNAL_LIBRARY_LIST} ${ZLIB_LIBRARY})
+
+# INCLUDE (${BINARY_DIR}/ZLIB-targets.cmake)
+ SET (ZLIB_LIBRARY "zlib")
SET (ZLIB_INCLUDE_DIR_GEN "${BINARY_DIR}")
SET (ZLIB_INCLUDE_DIR "${SOURCE_DIR}/src")