Skip to content
Permalink
Browse files

Make PDAL version information available for macros

  • Loading branch information
nyalldawson committed Nov 6, 2020
1 parent 0cadba1 commit f98bdc04a68fc77e3997749ae8e8a7dd1ad3756d
Showing with 28 additions and 3 deletions.
  1. +3 −0 CMakeLists.txt
  2. +19 −3 cmake/FindPDAL.cmake
  3. +6 −0 cmake_templates/qgsconfig.h.in
@@ -398,6 +398,9 @@ IF(WITH_CORE)
IF (WITH_PDAL)
FIND_PACKAGE(PDAL) # PDAL provider
ENDIF (WITH_PDAL)
IF (PDAL_FOUND)
SET(HAVE_PDAL TRUE) # used in qgsconfig.h
ENDIF (PDAL_FOUND)

#############################################################
# search for Qt5
@@ -41,15 +41,31 @@ FIND_LIBRARY(PDAL_UTIL_LIBRARY NAMES pdal_util libpdal_util PATHS
)
FIND_LIBRARY(PDAL_UTIL_LIBRARY NAMES pdal_util libpdal_util)

FIND_PROGRAM(PDAL_BIN pdal
$ENV{LIB_DIR}/bin
/usr/local/bin/
/usr/bin/
NO_DEFAULT_PATH
)
FIND_PROGRAM(PDAL_BIN pdal)

IF (PDAL_INCLUDE_DIR AND PDAL_CPP_LIBRARY AND PDAL_UTIL_LIBRARY)
IF (PDAL_INCLUDE_DIR AND PDAL_CPP_LIBRARY AND PDAL_UTIL_LIBRARY AND PDAL_BIN)
SET(PDAL_FOUND TRUE)
SET(PDAL_LIBRARIES ${PDAL_CPP_LIBRARY} ${PDAL_UTIL_LIBRARY})
ENDIF (PDAL_INCLUDE_DIR AND PDAL_CPP_LIBRARY AND PDAL_UTIL_LIBRARY)
ENDIF (PDAL_INCLUDE_DIR AND PDAL_CPP_LIBRARY AND PDAL_UTIL_LIBRARY AND PDAL_BIN)

IF (PDAL_FOUND)
# extract PDAL version
EXEC_PROGRAM(${PDAL_BIN}
ARGS --version
OUTPUT_VARIABLE PDAL_VERSION_OUT )
STRING(REGEX REPLACE "^.*([0-9]+)\\.([0-9]+)\\.([0-9]+).*$" "\\1" PDAL_VERSION_MAJOR "${PDAL_VERSION_OUT}")
STRING(REGEX REPLACE "^.*([0-9]+)\\.([0-9]+)\\.([0-9]+).*$" "\\2" PDAL_VERSION_MINOR "${PDAL_VERSION_OUT}")
STRING(REGEX REPLACE "^.*([0-9]+)\\.([0-9]+)\\.([0-9]+).*$" "\\3" PDAL_VERSION_MICRO "${PDAL_VERSION_OUT}")
STRING(CONCAT PDAL_VERSION ${PDAL_VERSION_MAJOR} "." ${PDAL_VERSION_MINOR} "." ${PDAL_VERSION_MICRO})

IF (NOT PDAL_FIND_QUIETLY)
MESSAGE(STATUS "Found PDAL: ${PDAL_LIBRARIES}")
MESSAGE(STATUS "Found PDAL: ${PDAL_LIBRARIES} (${PDAL_VERSION})")
ENDIF (NOT PDAL_FIND_QUIETLY)

ELSE (PDAL_FOUND)
@@ -80,5 +80,11 @@

#cmakedefine HAVE_LAZPERF

#cmakedefine HAVE_PDAL
#define PDAL_VERSION "${PDAL_VERSION}"
#define PDAL_VERSION_MAJOR "${PDAL_VERSION_MAJOR}"
#define PDAL_VERSION_MINOR "${PDAL_VERSION_MINOR}"
#define PDAL_VERSION_MICRO "${PDAL_VERSION_MICRO}"

#endif

0 comments on commit f98bdc0

Please sign in to comment.
You can’t perform that action at this time.