-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automate release generation from tags and refactor CI #115
Conversation
Updated this builder to create the tarball using CMake/CPack and attach it as an artifact to the build |
@rouault can we kill the VCPKG CI builder? It's now busted and points at a bunch of old stuff. It either needs to be updated or dropped. Additionally, we still need a CTest target for the tests on UNIX. |
yes, it was just a means of testing on Windows, not an aim per se. Conda based builds will do just fine. |
Hi @hobu, Thx for this PR! Also, related to #117 here are some improvements that could be integrated:
cmake %CMAKE_OPTS% -G %CMAKE_TGT_NINJA% ^
-DCMAKE_INSTALL_PREFIX=%PATH_INSTALL% ^
-DCMAKE_BUILD_TYPE=%CMAKE_BUILD_TYPE% ^
-DBUILD_SHARED_LIBS=ON ^
-DPROJ_LIBRARY=%PATH_INSTALL:\=/%/_proj/lib/proj.lib ^
-DPROJ_INCLUDE_DIR=%PATH_INSTALL:\=/%/_proj/include ^
-DJPEG_LIBRARY_RELEASE=%PATH_INSTALL:\=/%/lib/jpeg.lib ^
-DJPEG_DIR=%PATH_INSTALL:\=/% ^
-DWITH_ZLIB=ON ^
-DWITH_UTILITIES=OFF ^
-DWITH_TIFF=ON ^
-DWITH_JPEG=ON ^
-DWITH_TOWGS84=ON ^
-DBUILD_DOC=OFF ^
-DBUILD_MAN=OFF ^
-DLIB_SUFFIX= ^
%PATH_SRC%\%1\%1 diff --git "a/libgeotiff/CMakeLists.txt" "b/libgeotiff/CMakeLists.txt"
index 44c6b23..811505b 100644
--- "a/libgeotiff/CMakeLists.txt"
+++ "b/libgeotiff/CMakeLists.txt"
@@ -46,6 +46,8 @@ SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
# General build settings
option(BUILD_SHARED_LIBS "Set ON to build shared library" ON)
+option(BUILD_MAN "Set ON to build man pages" ON)
+option(BUILD_DOC "Set ON to build doc files" ON)
IF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE Debug CACHE STRING
@@ -82,26 +84,31 @@ CHECK_INCLUDE_FILES(strings.h GEOTIFF_HAVE_STRINGS_H)
###############################################################################
# User-defined build settings
-SET(WITH_UTILITIES TRUE CACHE BOOL "Choose if GeoTIFF utilities should be built")
+option(WITH_UTILITIES "Choose if GeoTIFF utilities should be built" ON)
+
+SET(LIB_SUFFIX _i CACHE STRING "Static library suffix")
###############################################################################
# Search for dependencies
# TIFF support - required, default=ON
-SET(WITH_TIFF TRUE CACHE BOOL "Choose if TIFF support should be built")
+option(WITH_TIFF "Choose if TIFF support should be built" ON)
-FIND_PACKAGE(PROJ NO_MODULE REQUIRED)
+FIND_PACKAGE(PROJ NO_MODULE QUIET)
+if (NOT PROJ_FOUND)
+ FIND_PACKAGE(PROJ REQUIRED)
+endif ()
# Zlib support - optional, default=OFF
-SET(WITH_ZLIB FALSE CACHE BOOL "Choose if zlib support should be built")
+option(WITH_ZLIB "Choose if zlib support should be built" OFF)
# JPEG support - optional, default=OFF
-SET(WITH_JPEG FALSE CACHE BOOL "Choose if JPEG support should be built")
+option(WITH_JPEG "Choose if JPEG support should be built" OFF)
# Turn off TOWGS84 support
-SET(WITH_TOWGS84 TRUE CACHE BOOL "Build with TOWGS84 support")
+option(WITH_TOWGS84 "Build with TOWGS84 support" ON)
IF (NOT WITH_TOWGS84)
SET(GEO_NORMALIZE_DISABLE_TOWGS84 1)
endif()
@@ -154,13 +161,16 @@ SET(GEOTIFF_MAN_PAGES
# ${PROJECT_BINARY_DIR}/geotiff_version.h
# Install doc files
-INSTALL(FILES
+if(BUILD_DOC)
+ INSTALL(FILES
AUTHORS ChangeLog COPYING LICENSE README README_BIN README.WIN
DESTINATION ${CMAKE_INSTALL_DOCDIR})
+endif ()
# Install man pages
-INSTALL(FILES ${GEOTIFF_MAN_PAGES} DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
-
+if(BUILD_MAN)
+ INSTALL(FILES ${GEOTIFF_MAN_PAGES} DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
+endif ()
# Install header files for development distribution
INSTALL(FILES ${GEOTIFF_LIB_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
@@ -202,9 +212,9 @@ set_property(TARGET ${GEOTIFF_LIBRARY_TARGET} PROPERTY POSITION_INDEPENDENT_CODE
set_property(TARGET ${GEOTIFF_LIBRARY_TARGET} PROPERTY OUTPUT_NAME ${GEOTIFF_LIB_NAME})
IF(WITH_JPEG)
- FIND_PACKAGE(JPEG NO_MODULE QUIET CONFIG)
+ FIND_PACKAGE(JPEG NO_MODULE QUIET)
if (NOT JPEG_FOUND)
- FIND_PACKAGE(JPEG CONFIG)
+ FIND_PACKAGE(JPEG)
endif ()
IF(JPEG_FOUND)
@@ -257,7 +267,7 @@ TARGET_INCLUDE_DIRECTORIES(${GEOTIFF_LIBRARY_TARGET} PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/libxtiff>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
IF(WIN32 AND MSVC)
- SET_TARGET_PROPERTIES(${GEOTIFF_LIBRARY_TARGET} PROPERTIES IMPORT_SUFFIX "_i.lib")
+ SET_TARGET_PROPERTIES(${GEOTIFF_LIBRARY_TARGET} PROPERTIES IMPORT_SUFFIX "${LIB_SUFFIX}.lib")
ENDIF(WIN32 AND MSVC)
# Unix, linux:
@@ -332,10 +342,11 @@ target_include_directories( ${GEOTIFF_LIBRARY_TARGET} PUBLIC
INSTALL( TARGETS ${GEOTIFF_LIBRARY_TARGET}
EXPORT depends
- RUNTIME DESTINATION ${CMAKE_INSTALLL_BINDIR}
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} )
+INSTALL(FILES $<TARGET_PDB_FILE:${GEOTIFF_LIBRARY_TARGET}> DESTINATION ${CMAKE_INSTALL_BINDIR} OPTIONAL)
# Install libgeotiff.pc
set(prefix "${CMAKE_INSTALL_PREFIX}")
@@ -371,3 +382,16 @@ IF(WITH_UTILITIES)
ENDIF()
ADD_SUBDIRECTORY(cmake)
+
+message(STATUS "
+################################
+Summary of build options:
+ Build shared library: ${BUILD_SHARED_LIBS}
+ Build man pages: ${BUILD_MAN}
+ Build doc files: ${BUILD_DOC}
+ Build GeoTIFF utilities: ${WITH_UTILITIES}
+ Build TIFF support: ${WITH_TIFF}
+ Build zlib support: ${WITH_ZLIB}
+ Build JPEG support: ${WITH_JPEG}
+ Build TOWGS84 support: ${WITH_TOWGS84}
+################################")
++NoNo |
@hobu Any comment regarding above @nono303 's remark ? I know that with GDAL I had some issues with find_package(PROJ) with module vs config, depending on the PROJ version. In https://github.com/OSGeo/gdal/blob/be425562003bf26bd9927a99076edc807f189ee5/cmake/helpers/CheckDependentLibraries.cmake#L381I've some fairly complicated logic to make that configurable |
@nono303 I have applied your patch with some small modifications
|
Squash it all down as you see fit. Sorry for such a big ball of stuff. |
Many Thx @hobu! U applied it in a better way ;) ...just to be sure about
Is this what you are looking for : SQLite3 TIFF TIFF? |
PROJ and TIFF are hard requirements of libgeotiff. We should update the find_package calls to reflect this (it wasn't always true). |
All clear now !
|
This PR does a bunch of stuff at once (sorry):
Remove Travis configpackage_source
target is available for dist generationgithub.repository_owner == OSGeo
makefile.mpw
makefile.vc