Skip to content

Commit

Permalink
Merge pull request #63 from rouault/bump_cmake
Browse files Browse the repository at this point in the history
Bump CMake min to 3.0.0 and remove apparently unneeded cmake_policy() declarations
  • Loading branch information
rouault authored Dec 17, 2021
2 parents ecf1e06 + d989f19 commit 70c8b09
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 21 deletions.
28 changes: 8 additions & 20 deletions libgeotiff/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ SET(GEOTIFF_LIBRARY_TARGET geotiff_library)

##############################################################################
# CMake settings
CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0)
CMAKE_MINIMUM_REQUIRED(VERSION 3.0.0)

SET(CMAKE_COLOR_MAKEFILE ON)

Expand Down Expand Up @@ -54,12 +54,6 @@ IF(CMAKE_BUILD_TYPE MATCHES Debug)
SET(GEOTIFF_BUILD_PEDANTIC TRUE)
ENDIF()

if (CMAKE_MAJOR_VERSION GREATER 2)
cmake_policy(SET CMP0022 OLD) # interface link libraries
cmake_policy(SET CMP0042 OLD) # osx rpath
endif()


# TODO: Still testing the output paths --mloskot
SET(GEOTIFF_BUILD_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)

Expand Down Expand Up @@ -338,11 +332,10 @@ IF(WIN32 AND MSVC)
ENDIF(WIN32 AND MSVC)

# Unix, linux:
IF(UNIX)
if(UNIX)
SET_TARGET_PROPERTIES(
${GEOTIFF_LIBRARY_TARGET}
PROPERTIES
OUTPUT_NAME ${GEOTIFF_LIB_NAME}
VERSION ${LINK_VERSION}
SOVERSION ${LINK_SOVERSION}
CLEAN_DIRECT_OUTPUT 1 )
Expand All @@ -352,21 +345,16 @@ IF(UNIX)
PROPERTIES
INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib")
endif()

ELSE(UNIX)
# Default:
SET_TARGET_PROPERTIES(${GEOTIFF_LIBRARY_TARGET} PROPERTIES
OUTPUT_NAME ${GEOTIFF_LIB_NAME})
ENDIF(UNIX)
endif()

SET_TARGET_PROPERTIES(${GEOTIFF_LIBRARY_TARGET} PROPERTIES
OUTPUT_NAME ${GEOTIFF_LIB_NAME})

TARGET_LINK_LIBRARIES(${GEOTIFF_LIBRARY_TARGET}
${TIFF_LIBRARIES}
${PROJ_LIBRARIES}
${ZLIB_LIBRARIES}
${JPEG_LIBRARIES})
TARGET_LINK_LIBRARIES(${GEOTIFF_LIBRARY_TARGET} PUBLIC
${TIFF_LIBRARIES})

TARGET_LINK_LIBRARIES(${GEOTIFF_LIBRARY_TARGET} PRIVATE
${PROJ_LIBRARIES})

# INSTALL(TARGETS ${GEOTIFF_ARCHIVE_TARGET} ${GEOTIFF_LIBRARY_TARGET}
# RUNTIME DESTINATION ${GEOTIFF_BIN_DIR}
Expand Down
3 changes: 2 additions & 1 deletion libgeotiff/bin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@ MESSAGE(STATUS "Adding GeoTIFF utilities to build")

FOREACH(utility ${GEOTIFF_UTILITIES})
ADD_EXECUTABLE(${utility} ${utility}.c ${GETOPT_SOURCE})
TARGET_LINK_LIBRARIES(${utility} xtiff ${GEOTIFF_LIBRARY_TARGET})
TARGET_LINK_LIBRARIES(${utility} PRIVATE xtiff ${GEOTIFF_LIBRARY_TARGET})
ENDFOREACH()

ADD_EXECUTABLE(geotifcp geotifcp.c ${GETOPT_SOURCE})
TARGET_LINK_LIBRARIES(geotifcp
PRIVATE
xtiff
${GEOTIFF_LIBRARY_TARGET}
${JPEG_LIBRARIES}
Expand Down

0 comments on commit 70c8b09

Please sign in to comment.