[Proj] Proj 4.9.1RC3 Released

Charles Karney charles.karney at sri.com
Sat Feb 21 10:21:24 PST 2015


On 02/21/2015 12:31 PM, Howard Butler wrote:
> All,
>
> Proj4 4.9.1RC3 is now released for testing. Should no significant issues be identified, this is the last release candidate, and I will motion the MetaCRS list to promote it to final on Wednesday.
>
> Thanks for testing the past two RC's.
>
> Howard
>
> http://download.osgeo.org/proj/proj-4.9.1RC3.tar.gz

The attached patch addresses the following cmake issues:

Set "build" and "api" versions on the libraries.  This way we end up
with the same installed so files as with autoconf.

Sets the CMAKE_BUILD_TYPE to Release (if not specified).

Sets the rpath using the configured library path (instead of hardcoding
"lib").

Provides support for find_package(PROJ 4.9) as follows

   The name of the package is "PROJ" (uppercase).

   proj-config.cmake gets installed in share/cmake/PROJ (non Windows) or
   cmake (Windows).

   This defines (for example)
     PROJ_FOUND = 1
     PROJ_INCLUDE_DIRS = /usr/local/include
     PROJ_LIBRARIES = proj
     PROJ_LIBRARY_DIRS = /usr/local/lib
     PROJ_BINARY_DIRS = /usr/local/bin
     PROJ_VERSION = 4.9.1

   Here proj is a "target" name which means that it inherits
   dependencies, etc.

   find_package will look under CMAKE_PREFIX_PATH for proj-config.cmake.

There are no remaining issues for me (so far!).

   --Charles

-------------- next part --------------
--- proj-4.9.1RC3/CMakeLists.txt	2015-02-20 22:46:19.000000000 -0500
+++ proj-4.9.1RC3-patch1/CMakeLists.txt	2015-02-21 12:55:33.067871841 -0500
@@ -32,7 +32,8 @@
 #################################################################################
 include(Proj4Version)
 proj_version(MAJOR 4 MINOR 9 PATCH 1)
-set(PROJ_SOVERSION "9.0.0")
+set(PROJ_API_VERSION "9")
+set(PROJ_BUILD_VERSION "9.0.0")
 
 #################################################################################
 # Build features and variants
@@ -45,6 +46,12 @@
 boost_report_value(PROJ_PLATFORM_NAME)
 boost_report_value(PROJ_COMPILER_NAME)
 
+# Set a default build type for single-configuration cmake generators if
+# no build type is set.
+if (NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
+  set (CMAKE_BUILD_TYPE Release)
+endif ()
+
 option(PROJ4_TESTS "Enable build of collection of PROJ4 tests" ON)
 boost_report_value(PROJ4_TESTS)
 if(PROJ4_TESTS)
@@ -81,4 +88,5 @@
 add_subdirectory(nad)
 add_subdirectory(src)
 add_subdirectory(man)
+add_subdirectory(cmake)
 
--- proj-4.9.1RC3/src/CMakeLists.txt	2015-02-21 12:25:51.000000000 -0500
+++ proj-4.9.1RC3-patch1/src/CMakeLists.txt	2015-02-21 12:40:26.698144986 -0500
@@ -11,14 +11,14 @@
 if(NOT MSVC)
   if (NOT APPLE)
     # Use relative path so that package is relocatable
-    set(CMAKE_INSTALL_RPATH "\$ORIGIN/../lib")
+    set(CMAKE_INSTALL_RPATH "\$ORIGIN/../${LIBDIR}")
   else ()
-    set (CMAKE_INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib")
+    set (CMAKE_INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/${LIBDIR}")
     # TO DO: cmake 2.8.12 introduces a way to make the install tree
     # relocatable with OSX via
     # (1) set(CMAKE_MACOSX_RPATH ON) and
     # (2) setting the INSTALL_RPATH property on the executables to
-    # "@loader_path/../lib"
+    # "@loader_path/../${LIBDIR}"
   endif ()
 endif ()
 
--- proj-4.9.1RC3/src/lib_proj.cmake	2015-02-21 12:25:51.000000000 -0500
+++ proj-4.9.1RC3-patch1/src/lib_proj.cmake	2015-02-21 13:01:18.327850164 -0500
@@ -264,17 +264,20 @@
 if(WIN32)
   set_target_properties(${PROJ_CORE_TARGET}
     PROPERTIES
+    VERSION "${${PROJECT_INTERN_NAME}_BUILD_VERSION}"
     OUTPUT_NAME "${PROJ_CORE_TARGET_OUTPUT_NAME}"
     CLEAN_DIRECT_OUTPUT 1)
 elseif(BUILD_FRAMEWORKS_AND_BUNDLE)
   set_target_properties(${PROJ_CORE_TARGET}
     PROPERTIES
+    VERSION "${${PROJECT_INTERN_NAME}_BUILD_VERSION}"
     INSTALL_NAME_DIR ${PROJ_INSTALL_NAME_DIR}
     CLEAN_DIRECT_OUTPUT 1)
 else()
   set_target_properties(${PROJ_CORE_TARGET}
     PROPERTIES
-    SOVERSION "${${PROJECT_INTERN_NAME}_SOVERSION}"
+    VERSION "${${PROJECT_INTERN_NAME}_BUILD_VERSION}"
+    SOVERSION "${${PROJECT_INTERN_NAME}_API_VERSION}"
     CLEAN_DIRECT_OUTPUT 1)
 endif()
 
@@ -288,7 +291,9 @@
 set(PROJ_LIBRARIES ${PROJ_CORE_TARGET} )
 if(UNIX AND BUILD_LIBPROJ_SHARED)
     find_library(M_LIB m)
-    TARGET_LINK_LIBRARIES(${PROJ_CORE_TARGET} ${M_LIB})
+    if(M_LIB)
+      TARGET_LINK_LIBRARIES(${PROJ_CORE_TARGET} -lm)
+    endif()
 endif(UNIX AND BUILD_LIBPROJ_SHARED)
 if(USE_THREAD AND Threads_FOUND AND CMAKE_USE_PTHREADS_INIT AND BUILD_LIBPROJ_SHARED)
    TARGET_LINK_LIBRARIES(${PROJ_CORE_TARGET} ${CMAKE_THREAD_LIBS_INIT})
@@ -299,6 +304,7 @@
 # install
 ##############################################
 install(TARGETS ${PROJ_CORE_TARGET}
+        EXPORT targets
         RUNTIME DESTINATION ${BINDIR}
         LIBRARY DESTINATION ${LIBDIR}
         ARCHIVE DESTINATION ${LIBDIR}
--- /dev/null	2014-12-23 16:11:18.821437211 -0500
+++ proj-4.9.1RC3-patch1/cmake/CMakeLists.txt	2015-02-21 12:02:03.112413566 -0500
@@ -0,0 +1,29 @@
+# proj-config.cmake for the install tree.  It's installed in
+# ${INSTALL_CMAKE_DIR} and @PROJECT_ROOT_DIR@ is the relative
+# path to the root from there.  (Note that the whole install tree can
+# be relocated.)
+if (NOT WIN32)
+  set (INSTALL_CMAKE_DIR "share/cmake/${PROJECT_INTERN_NAME}")
+  set (PROJECT_ROOT_DIR "../../..")
+else ()
+  set (INSTALL_CMAKE_DIR "cmake")
+  set (PROJECT_ROOT_DIR "..")
+endif ()
+
+string(TOLOWER "${PROJECT_INTERN_NAME}" PROJECT_NAME_LOWER)
+configure_file (project-config.cmake.in project-config.cmake @ONLY)
+configure_file (project-config-version.cmake.in
+  project-config-version.cmake @ONLY)
+install (FILES
+  "${CMAKE_CURRENT_BINARY_DIR}/project-config.cmake"
+  DESTINATION "${INSTALL_CMAKE_DIR}"
+  RENAME "${PROJECT_NAME_LOWER}-config.cmake")
+install (FILES
+  "${CMAKE_CURRENT_BINARY_DIR}/project-config-version.cmake"
+  DESTINATION "${INSTALL_CMAKE_DIR}"
+  RENAME "${PROJECT_NAME_LOWER}-config-version.cmake")
+# Make information about the cmake targets (the library and the tools)
+# available.
+install (EXPORT targets
+  FILE ${PROJECT_NAME_LOWER}-targets.cmake
+  DESTINATION "${INSTALL_CMAKE_DIR}")
--- /dev/null	2014-12-23 16:11:18.821437211 -0500
+++ proj-4.9.1RC3-patch1/cmake/project-config.cmake.in	2015-02-21 12:26:54.333730492 -0500
@@ -0,0 +1,28 @@
+# Configure @PROJECT_INTERN_NAME@
+#
+# Set
+#  @PROJECT_INTERN_NAME at _FOUND = 1
+#  @PROJECT_INTERN_NAME at _INCLUDE_DIRS = /usr/local/include
+#  @PROJECT_INTERN_NAME at _LIBRARIES = proj
+#  @PROJECT_INTERN_NAME at _LIBRARY_DIRS = /usr/local/lib
+#  @PROJECT_INTERN_NAME at _BINARY_DIRS = /usr/local/bin
+#  @PROJECT_INTERN_NAME at _VERSION = 4.9.1 (for example)
+
+message (STATUS "Reading ${CMAKE_CURRENT_LIST_FILE}")
+# @PROJECT_INTERN_NAME at _VERSION is set by version file
+message (STATUS
+  "@PROJECT_INTERN_NAME@ configuration, version ${@PROJECT_INTERN_NAME at _VERSION}")
+
+# Tell the user project where to find our headers and libraries
+get_filename_component (_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)
+get_filename_component (_ROOT "${_DIR}/@PROJECT_ROOT_DIR@" ABSOLUTE)
+set (@PROJECT_INTERN_NAME at _INCLUDE_DIRS "${_ROOT}/@INCLUDEDIR@")
+set (@PROJECT_INTERN_NAME at _LIBRARY_DIRS "${_ROOT}/@LIBDIR@")
+set (@PROJECT_INTERN_NAME at _BINARY_DIRS "${_ROOT}/@BINDIR@")
+
+set (@PROJECT_INTERN_NAME at _LIBRARIES proj)
+# Read in the exported definition of the library
+include ("${_DIR}/@PROJECT_NAME_LOWER at -targets.cmake")
+
+unset (_ROOT)
+unset (_DIR)
--- /dev/null	2014-12-23 16:11:18.821437211 -0500
+++ proj-4.9.1RC3-patch1/cmake/project-config-version.cmake.in	2015-02-21 12:04:25.147622450 -0500
@@ -0,0 +1,48 @@
+# Version checking for @PROJECT_INTERN_NAME@
+
+set (PACKAGE_VERSION "@PROJ_VERSION@")
+set (PACKAGE_VERSION_MAJOR "@PROJ_VERSION_MAJOR@")
+set (PACKAGE_VERSION_MINOR "@PROJ_VERSION_MINOR@")
+set (PACKAGE_VERSION_PATCH "@PROJ_VERSION_PATCH@")
+
+if (NOT PACKAGE_FIND_NAME STREQUAL "@PROJECT_INTERN_NAME@")
+  # Check package name (in particular, because of the way cmake finds
+  # package config files, the capitalization could easily be "wrong").
+  # This is necessary to ensure that the automatically generated
+  # variables, e.g., <package>_FOUND, are consistently spelled.
+  set (REASON "package = @PROJECT_INTERN_NAME@, NOT ${PACKAGE_FIND_NAME}")
+  set (PACKAGE_VERSION_UNSUITABLE TRUE)
+elseif (NOT (APPLE OR (NOT DEFINED CMAKE_SIZEOF_VOID_P) OR
+      CMAKE_SIZEOF_VOID_P EQUAL @CMAKE_SIZEOF_VOID_P@))
+  # Reject if there's a 32-bit/64-bit mismatch (not necessary with Apple
+  # since a multi-architecture library is built for that platform).
+  set (REASON "sizeof(*void) =  @CMAKE_SIZEOF_VOID_P@")
+  set (PACKAGE_VERSION_UNSUITABLE TRUE)
+elseif (MSVC AND NOT MSVC_VERSION STREQUAL "@MSVC_VERSION@")
+  # Reject if there's a mismatch in MSVC compiler versions
+  set (REASON "_MSC_VER = @MSVC_VERSION@")
+  set (PACKAGE_VERSION_UNSUITABLE TRUE)
+elseif (NOT CMAKE_CROSSCOMPILING STREQUAL "@CMAKE_CROSSCOMPILING@")
+  # Reject if there's a mismatch in ${CMAKE_CROSSCOMPILING}
+  set (REASON "cross-compiling = @CMAKE_CROSSCOMPILING@")
+  set (PACKAGE_VERSION_UNSUITABLE TRUE)
+elseif (CMAKE_CROSSCOMPILING AND
+    NOT (CMAKE_SYSTEM_NAME STREQUAL "@CMAKE_SYSTEM_NAME@" AND
+      CMAKE_SYSTEM_PROCESSOR STREQUAL "@CMAKE_SYSTEM_PROCESSOR@"))
+  # Reject if cross-compiling and there's a mismatch in the target system
+  set (REASON "target = @CMAKE_SYSTEM_NAME at -@CMAKE_SYSTEM_PROCESSOR@")
+  set (PACKAGE_VERSION_UNSUITABLE TRUE)
+elseif (PACKAGE_FIND_VERSION)
+  if (PACKAGE_FIND_VERSION VERSION_EQUAL PACKAGE_VERSION)
+    set (PACKAGE_VERSION_EXACT TRUE)
+  elseif (PACKAGE_FIND_VERSION VERSION_LESS PACKAGE_VERSION
+    AND PACKAGE_FIND_VERSION_MAJOR EQUAL PACKAGE_VERSION_MAJOR)
+    set (PACKAGE_VERSION_COMPATIBLE TRUE)
+  endif ()
+endif ()
+
+# If unsuitable, append the reason to the package version so that it's
+# visible to the user.
+if (PACKAGE_VERSION_UNSUITABLE)
+  set (PACKAGE_VERSION "${PACKAGE_VERSION} (${REASON})")
+endif ()


More information about the Proj mailing list