summaryrefslogtreecommitdiffstats
path: root/config/cmake/HDFMacros.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'config/cmake/HDFMacros.cmake')
-rw-r--r--config/cmake/HDFMacros.cmake87
1 files changed, 38 insertions, 49 deletions
diff --git a/config/cmake/HDFMacros.cmake b/config/cmake/HDFMacros.cmake
index 60ee6e8..be32066 100644
--- a/config/cmake/HDFMacros.cmake
+++ b/config/cmake/HDFMacros.cmake
@@ -15,6 +15,10 @@ MACRO (EXTERNAL_JPEG_LIBRARY compress_type jpeg_pic)
INSTALL_COMMAND ""
CMAKE_ARGS
-DBUILD_SHARED_LIBS:BOOL=OFF
+ -DJPEG_EXTERNALLY_CONFIGURED:BOOL=ON
+ -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
+ -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
+ -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}
-DCMAKE_BUILD_TYPE:STRING="Release"
-DCMAKE_ANSI_CFLAGS:STRING="${jpeg_pic}"
)
@@ -25,13 +29,17 @@ MACRO (EXTERNAL_JPEG_LIBRARY compress_type jpeg_pic)
INSTALL_COMMAND ""
CMAKE_ARGS
-DBUILD_SHARED_LIBS:BOOL=OFF
+ -DJPEG_EXTERNALLY_CONFIGURED:BOOL=ON
+ -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
+ -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
+ -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}
-DCMAKE_BUILD_TYPE:STRING="Release"
-DCMAKE_ANSI_CFLAGS:STRING="${jpeg_pic}"
)
ENDIF (${compress_type} MATCHES "SVN")
EXTERNALPROJECT_GET_PROPERTY (JPEG BINARY_DIR SOURCE_DIR)
- SET (JPEG_LIBRARY "${BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/libjpeg${CMAKE_STATIC_LIBRARY_SUFFIX}")
+ SET (JPEG_LIBRARY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/libjpeg${CMAKE_STATIC_LIBRARY_SUFFIX}")
SET (JPEG_INCLUDE_DIR_GEN "${BINARY_DIR}")
SET (JPEG_INCLUDE_DIR "${SOURCE_DIR}/src")
SET (JPEG_FOUND 1)
@@ -46,15 +54,10 @@ MACRO (PACKAGE_JPEG_LIBRARY compress_type)
COMMENT "Copying ${JPEG_INCLUDE_DIR_GEN}/jconfig.h to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/"
)
SET (EXTERNAL_HEADER_LIST ${EXTERNAL_HEADER_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/jconfig.h)
- ADD_CUSTOM_TARGET (JPEG-Library-Copy ALL
- COMMAND ${CMAKE_COMMAND} -E copy_if_different ${JPEG_LIBRARY} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/
- COMMENT "Copying ${JPEG_LIBRARY} to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/"
- )
GET_FILENAME_COMPONENT(JPEG_LIB_NAME ${JPEG_LIBRARY} NAME)
- SET (EXTERNAL_LIBRARY_LIST ${EXTERNAL_LIBRARY_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${JPEG_LIB_NAME})
+ SET (EXTERNAL_LIBRARY_LIST ${EXTERNAL_LIBRARY_LIST} ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${JPEG_LIB_NAME})
IF (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ")
ADD_DEPENDENCIES (JPEG-GenHeader-Copy JPEG)
- ADD_DEPENDENCIES (JPEG-Library-Copy JPEG)
ENDIF (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ")
ENDMACRO (PACKAGE_JPEG_LIBRARY)
@@ -67,6 +70,10 @@ MACRO (EXTERNAL_SZIP_LIBRARY compress_type libtype encoding)
INSTALL_COMMAND ""
CMAKE_ARGS
-DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS}
+ -DSZIP_EXTERNALLY_CONFIGURED:BOOL=ON
+ -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
+ -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
+ -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}
-DSZIP_ENABLE_ENCODING:BOOL=${encoding}
)
ELSEIF (${compress_type} MATCHES "TGZ")
@@ -76,6 +83,10 @@ MACRO (EXTERNAL_SZIP_LIBRARY compress_type libtype encoding)
INSTALL_COMMAND ""
CMAKE_ARGS
-DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS}
+ -DSZIP_EXTERNALLY_CONFIGURED:BOOL=ON
+ -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
+ -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
+ -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}
-DSZIP_ENABLE_ENCODING:BOOL=${encoding}
)
ENDIF (${compress_type} MATCHES "SVN")
@@ -97,12 +108,12 @@ MACRO (EXTERNAL_SZIP_LIBRARY compress_type libtype encoding)
IF (${libtype} MATCHES "SHARED")
IF (WIN32 AND NOT MINGW)
- SET (SZIP_LIBRARY "${BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/${CMAKE_IMPORT_LIBRARY_PREFIX}szip${DBG_EXT}${CMAKE_IMPORT_LIBRARY_SUFFIX}")
+ SET (SZIP_LIBRARY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${CMAKE_IMPORT_LIBRARY_PREFIX}szip${DBG_EXT}${CMAKE_IMPORT_LIBRARY_SUFFIX}")
ELSE (WIN32 AND NOT MINGW)
- SET (SZIP_LIBRARY "${BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/${CMAKE_SHARED_LIBRARY_PREFIX}szip${DBG_EXT}${CMAKE_SHARED_LIBRARY_SUFFIX}")
+ SET (SZIP_LIBRARY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${CMAKE_SHARED_LIBRARY_PREFIX}szip${DBG_EXT}${CMAKE_SHARED_LIBRARY_SUFFIX}")
ENDIF (WIN32 AND NOT MINGW)
ELSE (${libtype} MATCHES "SHARED")
- SET (SZIP_LIBRARY "${BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/libszip${DBG_EXT}${CMAKE_STATIC_LIBRARY_SUFFIX}")
+ SET (SZIP_LIBRARY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/libszip${DBG_EXT}${CMAKE_STATIC_LIBRARY_SUFFIX}")
ENDIF (${libtype} MATCHES "SHARED")
SET (SZIP_INCLUDE_DIR_GEN "${BINARY_DIR}")
SET (SZIP_INCLUDE_DIR "${SOURCE_DIR}/src")
@@ -118,30 +129,15 @@ MACRO (PACKAGE_SZIP_LIBRARY compress_type libtype)
COMMENT "Copying ${SZIP_INCLUDE_DIR_GEN}/SZconfig.h to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/"
)
SET (EXTERNAL_HEADER_LIST ${EXTERNAL_HEADER_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/SZconfig.h)
- ADD_CUSTOM_TARGET (SZIP-Library-Copy ALL
- COMMAND ${CMAKE_COMMAND} -E copy_if_different ${SZIP_LIBRARY} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/
- COMMENT "Copying ${SZIP_LIBRARY} to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/"
- )
GET_FILENAME_COMPONENT(SZIP_LIB_NAME ${SZIP_LIBRARY} NAME)
- SET (EXTERNAL_LIBRARY_LIST ${EXTERNAL_LIBRARY_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${SZIP_LIB_NAME})
+ SET (EXTERNAL_LIBRARY_LIST ${EXTERNAL_LIBRARY_LIST} ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${SZIP_LIB_NAME})
IF (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ")
ADD_DEPENDENCIES (SZIP-GenHeader-Copy SZIP)
- ADD_DEPENDENCIES (SZIP-Library-Copy SZIP)
ENDIF (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ")
IF (WIN32 AND NOT CYGWIN)
IF (${libtype} MATCHES "SHARED")
GET_FILENAME_COMPONENT(SZIP_DLL_NAME ${SZIP_LIBRARY} NAME_WE)
- # MESSAGE (STATUS "SZIP_DLL_NAME: ${SZIP_DLL_NAME}")
- GET_FILENAME_COMPONENT(SZIP_BIN_PATH ${SZIP_LIBRARY} PATH)
- # MESSAGE (STATUS "SZIP_BIN_PATH: ${SZIP_BIN_PATH}")
- SET (EXTERNAL_LIBRARYDLL_LIST ${EXTERNAL_LIBRARYDLL_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${SZIP_DLL_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX})
- ADD_CUSTOM_TARGET (SZIP-Dll-Copy ALL
- COMMAND ${CMAKE_COMMAND} -E copy_if_different ${SZIP_BIN_PATH}/${SZIP_DLL_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/
- COMMENT "Copying ${SZIP_BIN_PATH}/${SZIP_DLL_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX} to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/"
- )
- IF (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ")
- ADD_DEPENDENCIES (SZIP-Dll-Copy SZIP)
- ENDIF (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ")
+ SET (EXTERNAL_LIBRARYDLL_LIST ${EXTERNAL_LIBRARYDLL_LIST} ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${SZIP_DLL_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX})
ENDIF (${libtype} MATCHES "SHARED")
ENDIF (WIN32 AND NOT CYGWIN)
ENDMACRO (PACKAGE_SZIP_LIBRARY)
@@ -155,6 +151,10 @@ MACRO (EXTERNAL_ZLIB_LIBRARY compress_type libtype)
INSTALL_COMMAND ""
CMAKE_ARGS
-DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS}
+ -DZLIB_EXTERNALLY_CONFIGURED:BOOL=ON
+ -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
+ -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
+ -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}
-DHDF_LEGACY_NAMING:BOOL=${HDF_LEGACY_NAMING}
)
ELSEIF (${compress_type} MATCHES "TGZ")
@@ -164,6 +164,10 @@ MACRO (EXTERNAL_ZLIB_LIBRARY compress_type libtype)
INSTALL_COMMAND ""
CMAKE_ARGS
-DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS}
+ -DZLIB_EXTERNALLY_CONFIGURED:BOOL=ON
+ -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:PATH=${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
+ -DCMAKE_LIBRARY_OUTPUT_DIRECTORY:PATH=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
+ -DCMAKE_ARCHIVE_OUTPUT_DIRECTORY:PATH=${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}
-DHDF_LEGACY_NAMING:BOOL=${HDF_LEGACY_NAMING}
)
ENDIF (${compress_type} MATCHES "SVN")
@@ -185,19 +189,19 @@ MACRO (EXTERNAL_ZLIB_LIBRARY compress_type libtype)
IF (${libtype} MATCHES "SHARED")
IF (WIN32 AND NOT MINGW)
- SET (ZLIB_LIBRARY "${BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/${CMAKE_IMPORT_LIBRARY_PREFIX}zlib1${DBG_EXT}${CMAKE_IMPORT_LIBRARY_SUFFIX}")
+ SET (ZLIB_LIBRARY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${CMAKE_IMPORT_LIBRARY_PREFIX}zlib1${DBG_EXT}${CMAKE_IMPORT_LIBRARY_SUFFIX}")
ELSE (WIN32 AND NOT MINGW)
- SET (ZLIB_LIBRARY "${BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/${CMAKE_SHARED_LIBRARY_PREFIX}z${DBG_EXT}${CMAKE_SHARED_LIBRARY_SUFFIX}")
+ SET (ZLIB_LIBRARY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${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 "${BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/zlib${DBG_EXT}${CMAKE_STATIC_LIBRARY_SUFFIX}")
+ SET (ZLIB_LIBRARY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/zlib${DBG_EXT}${CMAKE_STATIC_LIBRARY_SUFFIX}")
ELSE (HDF_LEGACY_NAMING)
- SET (ZLIB_LIBRARY "${BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/libzlib${DBG_EXT}${CMAKE_STATIC_LIBRARY_SUFFIX}")
+ SET (ZLIB_LIBRARY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/libzlib${DBG_EXT}${CMAKE_STATIC_LIBRARY_SUFFIX}")
ENDIF (HDF_LEGACY_NAMING)
ELSE (WIN32 AND NOT MINGW)
- SET (ZLIB_LIBRARY "${BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/libz${DBG_EXT}${CMAKE_STATIC_LIBRARY_SUFFIX}")
+ SET (ZLIB_LIBRARY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/libz${DBG_EXT}${CMAKE_STATIC_LIBRARY_SUFFIX}")
ENDIF (WIN32 AND NOT MINGW)
ENDIF (${libtype} MATCHES "SHARED")
SET (ZLIB_INCLUDE_DIR_GEN "${BINARY_DIR}")
@@ -214,30 +218,15 @@ MACRO (PACKAGE_ZLIB_LIBRARY compress_type libtype)
COMMENT "Copying ${ZLIB_INCLUDE_DIR_GEN}/zconf.h to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/"
)
SET (EXTERNAL_HEADER_LIST ${EXTERNAL_HEADER_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/zconf.h)
- ADD_CUSTOM_TARGET (ZLIB-Library-Copy ALL
- COMMAND ${CMAKE_COMMAND} -E copy_if_different ${ZLIB_LIBRARY} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/
- COMMENT "Copying ${ZLIB_LIBRARY} to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/"
- )
GET_FILENAME_COMPONENT(ZLIB_LIB_NAME ${ZLIB_LIBRARY} NAME)
- SET (EXTERNAL_LIBRARY_LIST ${EXTERNAL_LIBRARY_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${ZLIB_LIB_NAME})
+ SET (EXTERNAL_LIBRARY_LIST ${EXTERNAL_LIBRARY_LIST} ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${ZLIB_LIB_NAME})
IF (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ")
ADD_DEPENDENCIES (ZLIB-GenHeader-Copy ZLIB)
- ADD_DEPENDENCIES (ZLIB-Library-Copy ZLIB)
ENDIF (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ")
IF (WIN32 AND NOT CYGWIN)
IF (${libtype} MATCHES "SHARED")
GET_FILENAME_COMPONENT(ZLIB_DLL_NAME ${ZLIB_LIBRARY} NAME_WE)
- # MESSAGE (STATUS "ZLIB_DLL_NAME: ${ZLIB_DLL_NAME}")
- GET_FILENAME_COMPONENT(ZLIB_BIN_PATH ${ZLIB_LIBRARY} PATH)
- # MESSAGE (STATUS "ZLIB_BIN_PATH: ${ZLIB_BIN_PATH}")
- SET (EXTERNAL_LIBRARYDLL_LIST ${EXTERNAL_LIBRARYDLL_LIST} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${ZLIB_DLL_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX})
- ADD_CUSTOM_TARGET (ZLIB-Dll-Copy ALL
- COMMAND ${CMAKE_COMMAND} -E copy_if_different ${ZLIB_BIN_PATH}/${ZLIB_DLL_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/
- COMMENT "Copying ${ZLIB_BIN_PATH}/${ZLIB_DLL_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX} to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/"
- )
- IF (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ")
- ADD_DEPENDENCIES (ZLIB-Dll-Copy ZLIB)
- ENDIF (${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ")
+ SET (EXTERNAL_LIBRARYDLL_LIST ${EXTERNAL_LIBRARYDLL_LIST} ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${ZLIB_DLL_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX})
ENDIF (${libtype} MATCHES "SHARED")
ENDIF (WIN32 AND NOT CYGWIN)
ENDMACRO (PACKAGE_ZLIB_LIBRARY)