summaryrefslogtreecommitdiffstats
path: root/config/cmake_ext_mod/HDFLibMacros.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'config/cmake_ext_mod/HDFLibMacros.cmake')
-rw-r--r--config/cmake_ext_mod/HDFLibMacros.cmake122
1 files changed, 37 insertions, 85 deletions
diff --git a/config/cmake_ext_mod/HDFLibMacros.cmake b/config/cmake_ext_mod/HDFLibMacros.cmake
index 2eda66c..9df2b4b 100644
--- a/config/cmake_ext_mod/HDFLibMacros.cmake
+++ b/config/cmake_ext_mod/HDFLibMacros.cmake
@@ -14,25 +14,7 @@ macro (EXTERNAL_JPEG_LIBRARY compress_type jpeg_pic)
# May need to build JPEG with PIC on x64 machines with gcc
# Need to use CMAKE_ANSI_CFLAGS define so that compiler test works
- if (${compress_type} MATCHES "SVN")
- EXTERNALPROJECT_ADD (JPEG
- SVN_REPOSITORY ${JPEG_URL}
- # [SVN_REVISION rev]
- INSTALL_COMMAND ""
- CMAKE_ARGS
- -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS}
- -DJPEG_PACKAGE_EXT:STRING=${HDF_PACKAGE_EXT}
- -DJPEG_EXTERNALLY_CONFIGURED:BOOL=OFF
- -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
- -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX}
- -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_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY}
- -DCMAKE_ANSI_CFLAGS:STRING=${jpeg_pic}
- -DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE}
- )
- elseif (${compress_type} MATCHES "GIT")
+ if (${compress_type} MATCHES "GIT")
EXTERNALPROJECT_ADD (JPEG
GIT_REPOSITORY ${JPEG_URL}
GIT_TAG ${JPEG_BRANCH}
@@ -49,6 +31,7 @@ macro (EXTERNAL_JPEG_LIBRARY compress_type jpeg_pic)
-DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY}
-DCMAKE_ANSI_CFLAGS:STRING=${jpeg_pic}
-DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE}
+ -DPACKAGE_NAMESPACE=${HDF_PACKAGE_NAMESPACE}
)
elseif (${compress_type} MATCHES "TGZ")
EXTERNALPROJECT_ADD (JPEG
@@ -67,23 +50,24 @@ macro (EXTERNAL_JPEG_LIBRARY compress_type jpeg_pic)
-DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY}
-DCMAKE_ANSI_CFLAGS:STRING=${jpeg_pic}
-DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE}
+ -DPACKAGE_NAMESPACE=${HDF_PACKAGE_NAMESPACE}
)
endif ()
externalproject_get_property (JPEG BINARY_DIR SOURCE_DIR)
##include (${BINARY_DIR}/${JPEG_PACKAGE_NAME}${HDF_PACKAGE_EXT}-targets.cmake)
# Create imported target jpeg-static
- add_library(jpeg-static STATIC IMPORTED)
- HDF_IMPORT_SET_LIB_OPTIONS (jpeg-static "jpeg" STATIC "")
- add_dependencies (jpeg-static JPEG)
- set (JPEG_STATIC_LIBRARY "jpeg-static")
+ add_library(${HDF_PACKAGE_NAMESPACE}jpeg-static STATIC IMPORTED)
+ HDF_IMPORT_SET_LIB_OPTIONS (${HDF_PACKAGE_NAMESPACE}jpeg-static "jpeg" STATIC "")
+ add_dependencies (${HDF_PACKAGE_NAMESPACE}jpeg-static JPEG)
+ set (JPEG_STATIC_LIBRARY "${HDF_PACKAGE_NAMESPACE}jpeg-static")
set (JPEG_LIBRARIES ${JPEG_STATIC_LIBRARY})
if (BUILD_SHARED_LIBS)
# Create imported target jpeg-shared
- add_library(jpeg-shared SHARED IMPORTED)
- HDF_IMPORT_SET_LIB_OPTIONS (jpeg-shared "jpeg" SHARED "")
- add_dependencies (jpeg-shared JPEG)
- set (JPEG_SHARED_LIBRARY "jpeg-shared")
+ add_library(${HDF_PACKAGE_NAMESPACE}jpeg-shared SHARED IMPORTED)
+ HDF_IMPORT_SET_LIB_OPTIONS (${HDF_PACKAGE_NAMESPACE}jpeg-shared "jpeg" SHARED "")
+ add_dependencies (${HDF_PACKAGE_NAMESPACE}jpeg-shared JPEG)
+ set (JPEG_SHARED_LIBRARY "${HDF_PACKAGE_NAMESPACE}jpeg-shared")
set (JPEG_LIBRARIES ${JPEG_LIBRARIES} ${JPEG_SHARED_LIBRARY})
endif ()
@@ -100,33 +84,14 @@ 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)
- if (${compress_type} MATCHES "GIT" OR ${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ")
+ if (${compress_type} MATCHES "GIT" OR ${compress_type} MATCHES "TGZ")
add_dependencies (JPEG-GenHeader-Copy JPEG)
endif ()
endmacro ()
#-------------------------------------------------------------------------------
macro (EXTERNAL_SZIP_LIBRARY compress_type encoding)
- if (${compress_type} MATCHES "SVN")
- EXTERNALPROJECT_ADD (SZIP
- SVN_REPOSITORY ${SZIP_URL}
- # [SVN_REVISION rev]
- INSTALL_COMMAND ""
- CMAKE_ARGS
- -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS}
- -DSZIP_PACKAGE_EXT:STRING=${HDF_PACKAGE_EXT}
- -DSZIP_EXTERNALLY_CONFIGURED:BOOL=OFF
- -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
- -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX}
- -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_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY}
- -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS}
- -DSZIP_ENABLE_ENCODING:BOOL=${encoding}
- -DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE}
- )
- elseif (${compress_type} MATCHES "GIT")
+ if (${compress_type} MATCHES "GIT")
EXTERNALPROJECT_ADD (SZIP
GIT_REPOSITORY ${SZIP_URL}
GIT_TAG ${SZIP_BRANCH}
@@ -144,6 +109,7 @@ macro (EXTERNAL_SZIP_LIBRARY compress_type encoding)
-DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS}
-DSZIP_ENABLE_ENCODING:BOOL=${encoding}
-DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE}
+ -DPACKAGE_NAMESPACE=${HDF_PACKAGE_NAMESPACE}
)
elseif (${compress_type} MATCHES "TGZ")
EXTERNALPROJECT_ADD (SZIP
@@ -163,23 +129,24 @@ macro (EXTERNAL_SZIP_LIBRARY compress_type encoding)
-DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS}
-DSZIP_ENABLE_ENCODING:BOOL=${encoding}
-DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE}
+ -DPACKAGE_NAMESPACE=${HDF_PACKAGE_NAMESPACE}
)
endif ()
externalproject_get_property (SZIP BINARY_DIR SOURCE_DIR)
##include (${BINARY_DIR}/${SZIP_PACKAGE_NAME}${HDF_PACKAGE_EXT}-targets.cmake)
# Create imported target szip-static
- add_library(szip-static STATIC IMPORTED)
- HDF_IMPORT_SET_LIB_OPTIONS (szip-static "szip" STATIC "")
- add_dependencies (szip-static SZIP)
- set (SZIP_STATIC_LIBRARY "szip-static")
+ add_library(${HDF_PACKAGE_NAMESPACE}szip-static STATIC IMPORTED)
+ HDF_IMPORT_SET_LIB_OPTIONS (${HDF_PACKAGE_NAMESPACE}szip-static "szip" STATIC "")
+ add_dependencies (${HDF_PACKAGE_NAMESPACE}szip-static SZIP)
+ set (SZIP_STATIC_LIBRARY "${HDF_PACKAGE_NAMESPACE}szip-static")
set (SZIP_LIBRARIES ${SZIP_STATIC_LIBRARY})
if (BUILD_SHARED_LIBS)
# Create imported target szip-shared
- add_library(szip-shared SHARED IMPORTED)
- HDF_IMPORT_SET_LIB_OPTIONS (szip-shared "szip" SHARED "")
- add_dependencies (szip-shared SZIP)
- set (SZIP_SHARED_LIBRARY "szip-shared")
+ add_library(${HDF_PACKAGE_NAMESPACE}szip-shared SHARED IMPORTED)
+ HDF_IMPORT_SET_LIB_OPTIONS (${HDF_PACKAGE_NAMESPACE}szip-shared "szip" SHARED "")
+ add_dependencies (${HDF_PACKAGE_NAMESPACE}szip-shared SZIP)
+ set (SZIP_SHARED_LIBRARY "${HDF_PACKAGE_NAMESPACE}szip-shared")
set (SZIP_LIBRARIES ${SZIP_LIBRARIES} ${SZIP_SHARED_LIBRARY})
endif ()
@@ -196,32 +163,14 @@ macro (PACKAGE_SZIP_LIBRARY compress_type)
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)
- if (${compress_type} MATCHES "GIT" OR ${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ")
+ if (${compress_type} MATCHES "GIT" OR ${compress_type} MATCHES "TGZ")
add_dependencies (SZIP-GenHeader-Copy SZIP)
endif ()
endmacro ()
#-------------------------------------------------------------------------------
macro (EXTERNAL_ZLIB_LIBRARY compress_type)
- if (${compress_type} MATCHES "SVN")
- EXTERNALPROJECT_ADD (ZLIB
- SVN_REPOSITORY ${ZLIB_URL}
- # [SVN_REVISION rev]
- INSTALL_COMMAND ""
- CMAKE_ARGS
- -DBUILD_SHARED_LIBS:BOOL=${BUILD_SHARED_LIBS}
- -DZLIB_PACKAGE_EXT:STRING=${HDF_PACKAGE_EXT}
- -DZLIB_EXTERNALLY_CONFIGURED:BOOL=OFF
- -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
- -DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_INSTALL_PREFIX}
- -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_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY}
- -DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS}
- -DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE}
- )
- elseif (${compress_type} MATCHES "GIT")
+ if (${compress_type} MATCHES "GIT")
EXTERNALPROJECT_ADD (ZLIB
GIT_REPOSITORY ${ZLIB_URL}
GIT_TAG ${ZLIB_BRANCH}
@@ -238,6 +187,7 @@ macro (EXTERNAL_ZLIB_LIBRARY compress_type)
-DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY}
-DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS}
-DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE}
+ -DPACKAGE_NAMESPACE=${HDF_PACKAGE_NAMESPACE}
)
elseif (${compress_type} MATCHES "TGZ")
EXTERNALPROJECT_ADD (ZLIB
@@ -256,6 +206,7 @@ macro (EXTERNAL_ZLIB_LIBRARY compress_type)
-DCMAKE_PDB_OUTPUT_DIRECTORY:PATH=${CMAKE_PDB_OUTPUT_DIRECTORY}
-DCMAKE_ANSI_CFLAGS:STRING=${CMAKE_ANSI_CFLAGS}
-DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE}
+ -DPACKAGE_NAMESPACE=${HDF_PACKAGE_NAMESPACE}
)
endif ()
externalproject_get_property (ZLIB BINARY_DIR SOURCE_DIR)
@@ -267,17 +218,18 @@ macro (EXTERNAL_ZLIB_LIBRARY compress_type)
endif ()
##include (${BINARY_DIR}/${ZLIB_PACKAGE_NAME}${HDF_PACKAGE_EXT}-targets.cmake)
# Create imported target zlib-static
- add_library(zlib-static STATIC IMPORTED)
- HDF_IMPORT_SET_LIB_OPTIONS (zlib-static ${ZLIB_LIB_NAME} STATIC "")
- add_dependencies (zlib-static ZLIB)
- set (ZLIB_STATIC_LIBRARY "zlib-static")
+ add_library(${HDF_PACKAGE_NAMESPACE}zlib-static STATIC IMPORTED)
+# add_library(${HDF_PACKAGE_NAMESPACE}zlib-static ALIAS zlib-static)
+ HDF_IMPORT_SET_LIB_OPTIONS (${HDF_PACKAGE_NAMESPACE}zlib-static ${ZLIB_LIB_NAME} STATIC "")
+ add_dependencies (${HDF_PACKAGE_NAMESPACE}zlib-static ZLIB)
+ set (ZLIB_STATIC_LIBRARY "${HDF_PACKAGE_NAMESPACE}zlib-static")
set (ZLIB_LIBRARIES ${ZLIB_STATIC_LIBRARY})
if (BUILD_SHARED_LIBS)
# Create imported target zlib-shared
- add_library(zlib-shared SHARED IMPORTED)
- HDF_IMPORT_SET_LIB_OPTIONS (zlib-shared ${ZLIB_LIB_NAME} SHARED "")
- add_dependencies (zlib-shared ZLIB)
- set (ZLIB_SHARED_LIBRARY "zlib-shared")
+ add_library(${HDF_PACKAGE_NAMESPACE}zlib-shared SHARED IMPORTED)
+ HDF_IMPORT_SET_LIB_OPTIONS (${HDF_PACKAGE_NAMESPACE}zlib-shared ${ZLIB_LIB_NAME} SHARED "")
+ add_dependencies (${HDF_PACKAGE_NAMESPACE}zlib-shared ZLIB)
+ set (ZLIB_SHARED_LIBRARY "${HDF_PACKAGE_NAMESPACE}zlib-shared")
set (ZLIB_LIBRARIES ${ZLIB_LIBRARIES} ${ZLIB_SHARED_LIBRARY})
endif ()
@@ -294,7 +246,7 @@ macro (PACKAGE_ZLIB_LIBRARY compress_type)
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)
- if (${compress_type} MATCHES "GIT" OR ${compress_type} MATCHES "SVN" OR ${compress_type} MATCHES "TGZ")
+ if (${compress_type} MATCHES "GIT" OR ${compress_type} MATCHES "TGZ")
add_dependencies (ZLIB-GenHeader-Copy ZLIB)
endif ()
endmacro ()