diff options
| author | Robert Schumacher <roschuma@microsoft.com> | 2017-07-07 18:44:28 -0700 |
|---|---|---|
| committer | Robert Schumacher <roschuma@microsoft.com> | 2017-07-07 18:44:28 -0700 |
| commit | 6e97f0018482e15e9b06f536a4ed12a73789c958 (patch) | |
| tree | d1a0474754ad1f3c9ad34ff4d55004472336e4cf | |
| parent | e60f06f7e94b1b1e107c46ff29d60d46dad124fb (diff) | |
| download | vcpkg-6e97f0018482e15e9b06f536a4ed12a73789c958.tar.gz vcpkg-6e97f0018482e15e9b06f536a4ed12a73789c958.zip | |
[matio] Use target_X cmake directives. Prefer modern cmake ZLIB::ZLIB.
| -rw-r--r-- | ports/matio/CMakeLists.txt | 34 | ||||
| -rw-r--r-- | ports/matio/CONTROL | 2 |
2 files changed, 15 insertions, 21 deletions
diff --git a/ports/matio/CMakeLists.txt b/ports/matio/CMakeLists.txt index 2f085d7e1..31b7e1e2b 100644 --- a/ports/matio/CMakeLists.txt +++ b/ports/matio/CMakeLists.txt @@ -16,34 +16,28 @@ set(SRC src/snprintf.c ) -include_directories(src visual_studio) - -add_library(libmatio ${SRC}) - -add_definitions( +add_library(libmatio ${SRC}) +target_include_directories(libmatio PRIVATE src visual_studio) +target_compile_definitions(libmatio PRIVATE -DH5_NO_DEPRECATED_SYMBOLS - -DMAT73=1 -DREPLACE_GETOPT + -DMAT73=1 + -DREPLACE_GETOPT -DMATIO_HAVE_INTTYPES_H=1 -DMATIO_HAVE_STDINT_H=1 ) -if(BUILD_SHARED_LIBS) - add_definitions (-DH5_BUILT_AS_DYNAMIC_LIB) -else() - add_definitions(-DH5_BUILT_AS_STATIC_LIB) -endif() - find_package(ZLIB REQUIRED) - -include_directories( ${ZLIB_INCLUDE_DIRS} ) -target_link_libraries(libmatio ${ZLIB_LIBRARIES}) -add_definitions(-DHAVE_ZLIB=1) +target_link_libraries(libmatio PRIVATE ZLIB::ZLIB) +target_compile_definitions(libmatio PRIVATE -DHAVE_ZLIB=1) find_package(HDF5 REQUIRED) - -include_directories( ${HDF5_INCLUDE_DIRS} ) -target_link_libraries(libmatio ${HDF5_C_LIBRARIES}) -add_definitions(-DHAVE_HDF5=1) +target_include_directories(libmatio PRIVATE ${HDF5_INCLUDE_DIRS} ) +target_link_libraries(libmatio PRIVATE ${HDF5_C_LIBRARIES}) +if(BUILD_SHARED_LIBS) + target_compile_definitions(libmatio PRIVATE -DHAVE_HDF5=1 -DH5_BUILT_AS_DYNAMIC_LIB) +else() + target_compile_definitions(libmatio PRIVATE -DHAVE_HDF5=1 -DH5_BUILT_AS_STATIC_LIB) +endif() install( TARGETS libmatio diff --git a/ports/matio/CONTROL b/ports/matio/CONTROL index eb2f87b70..f4dac30a1 100644 --- a/ports/matio/CONTROL +++ b/ports/matio/CONTROL @@ -1,4 +1,4 @@ Source: matio -Version: 1.5.10 +Version: 1.5.10-1 Description: MATLAB MAT File I/O Library Build-Depends: zlib, hdf5 |
