Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/PDAL/PDAL
Browse files Browse the repository at this point in the history
  • Loading branch information
Howard Butler committed Nov 16, 2014
2 parents 2ba1e88 + d649a2a commit 1f40e74
Show file tree
Hide file tree
Showing 118 changed files with 3,538 additions and 2,507 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -2,6 +2,7 @@
# these are generated by cmake
#
pdal_defines.h
plugins/pgpointcloud/Pgtest-Support.hpp

#
# rst outputs
Expand Down
221 changes: 41 additions & 180 deletions CMakeLists.txt
Expand Up @@ -89,13 +89,28 @@ endif(WIN32)

# Choose package components
option(WITH_APPS "Choose if PDAL utilities should be built" TRUE)
option(WITH_GREYHOUND "Choose if Greyhound support should be built" FALSE)
option(WITH_PCL "Choose if PCL support should be built" FALSE)
option(BUILD_PLUGIN_GREYHOUND "Choose if Greyhound support should be built" FALSE)
option(BUILD_PLUGIN_HEXBIN "Whether or not HexBin filter is built" FALSE)
option(BUILD_PLUGIN_ICEBRIDGE "Choose if Icebridge support should be built" FALSE)
option(BUILD_PLUGIN_MRSID "Choose if MrSID/LiDAR support should be built" FALSE)
option(BUILD_PLUGIN_NITF "Choose if NITF support should be built (only install supported is from http://github.com/hobu/nitro)" FALSE)
option(BUILD_PLUGIN_OCI "Choose if OCI support should be built" TRUE)
option(BUILD_PLUGIN_P2G "Choose if Points2Grid support should be built" FALSE)
option(BUILD_PLUGIN_PCL "Choose if PCL support should be built" FALSE)
option(BUILD_PLUGIN_PGPOINTCLOUD "Choose if PostgreSQL PointCloud support should be built" TRUE)
option(BUILD_PLUGIN_SQLITE "Choose if SQLite database support should be built" FALSE)
option(BUILD_PLUGIN_RIVLIB "Choose if RiVLib support should be built" FALSE)
option(WITH_TESTS "Choose if PDAL unit tests should be built" TRUE)

# Choose to use pkg-config or not
option(WITH_PKGCONFIG "Choose whether a pkgconfig file (PDAL.pc) should be installed" TRUE)

# Choose dependent options
cmake_dependent_option(BUILD_PGPOINTCLOUD_TESTS "Choose if PostgreSQL PointCloud tests should be built" ON BUILD_PLUGIN_PGPOINTCLOUD ON)
cmake_dependent_option(BUILD_SQLITE_TESTS "Choose if SQLite tests should be built" ON BUILD_PLUGIN_SQLITE ON)
cmake_dependent_option(BUILD_OCI_TESTS "Choose if OCI tests should be built" ON BUILD_PLUGIN_OCI ON)
cmake_dependent_option(BUILD_RIVLIB_TESTS "Choose if RiVLib tests should be built" ON BUILD_PLUGIN_RIVLIB ON)


#------------------------------------------------------------------------------
# test harness settings
Expand Down Expand Up @@ -290,13 +305,13 @@ find_package(GEOS 3.3)
if (GEOS_FOUND)
find_file(GEOS_VERSION_H version.h "${GEOS_INCLUDE_DIR}/geos")
if ("${GEOS_VERSION_H}" STREQUAL "GEOS_VERSION_H-NOTFOUND")
set(GEOS_LIBRARY "")
set(GEOS_LIBRARY "")
set(GEOS_FOUND FALSE)
set(WITH_GEOS FALSE)
else()
include_directories("${GEOS_INCLUDE_DIR}")
set(PDAL_HAVE_GEOS 1)
message(STATUS "...building with GEOS")
message(STATUS "...building with GEOS")
endif()
else()
set(GEOS_LIBRARY "")
Expand Down Expand Up @@ -324,71 +339,6 @@ if(WITH_GEOTIFF)
endif()


#
# SQLite (optional)
#
option(WITH_SQLITE "Choose if sqlite database support should be built" FALSE)
if (WITH_SQLITE)
find_package(SQLite3)
mark_as_advanced(CLEAR SQLITE3_INCLUDE_DIR)
mark_as_advanced(CLEAR SQLITE3_LIBRARY)
include_directories(${SQLITE3_INCLUDE_DIR})
set(PDAL_HAVE_SQLITE 1)
endif()


#
# PGPointCloud (optional)
#
option(WITH_PGPOINTCLOUD "Choose if PostgreSQL PointCloud support should be built" TRUE)
cmake_dependent_option(
WITH_PGPOINTCLOUD_TESTS
"Choose if PostgreSQL PointCloud tests should be built"
OFF
WITH_PGPOINTCLOUD
OFF
)
if (WITH_PGPOINTCLOUD)
find_package(PostgreSQL)
if (POSTGRESQL_FOUND)
set(PDAL_HAVE_POSTGRESQL 1)
mark_as_advanced(CLEAR POSTGRESQL_INCLUDE_DIR)
mark_as_advanced(CLEAR POSTGRESQL_LIBRARIES)
include_directories(${POSTGRESQL_INCLUDE_DIR})
message(STATUS "..building with PgPointCloud")
else()
set(WITH_PGPOINTCLOUD FALSE)
set(POSTGRESQL_LIBRARIES "")
endif()
endif()


#
# Nitro (optional)
#
option(WITH_NITRO "Choose if Nitro support (only install supported is from http://github.com/hobu/nitro)" TRUE)
if(WITH_NITRO)
find_package(Nitro 2.6)
IF (NITRO_FOUND)
set(PDAL_HAVE_NITRO 1)
include_directories(${NITRO_INCLUDE_DIR})
include_directories("${NITRO_INCLUDE_DIR}/nitro/c++")
include_directories("${NITRO_INCLUDE_DIR}/nitro/c")
add_definitions("-D_REENTRANT")
if (WIN32)
add_definitions("-DSIZEOF_SIZE_T=4")
add_definitions("-DIMPORT_NITRO_API")
else()
add_definitions("-D__POSIX")
endif()
message(STATUS "...building with Nitro")
else()
set(WITH_NITRO FALSE)
set(NITRO_LIBRARIES "")
endif()
endif()


#
# ICONV (optional)
#
Expand All @@ -406,23 +356,6 @@ if(WITH_ICONV)
endif()


#
# Oracle support (optional)
#
option(WITH_ORACLE "Choose if Oracle support should be built" TRUE)
if(WITH_ORACLE)
find_package(Oracle)
if(ORACLE_FOUND)
include_directories(${ORACLE_INCLUDE_DIR})
set(PDAL_HAVE_ORACLE 1)
message(STATUS "...building with Oracle")
else()
set(WITH_ORACLE FALSE)
set(ORACLE_LIBRARY "")
endif()
endif()


#
# LASZIP support (optional)
#
Expand All @@ -445,6 +378,16 @@ if(WITH_LASZIP)
endif()
endif()

option(WITH_COMPRESSION "Choose to use laz-perf compression for database drivers" FALSE)
if (WITH_COMPRESSION)
find_package(Lazperf)
if (LAZPERF_FOUND)
include_directories(${LAZPERF_INCLUDE_DIR})
set(PDAL_HAVE_LAZPERF 1)
else()
set(WITH_COMPRESSION FALSE)
endif()
endif()

#
# ZLIB support - required
Expand All @@ -459,25 +402,6 @@ if(ZLIB_FOUND)
endif()


#
# MrSID/LiDAR support (optional)
#
option(WITH_MRSID "Choose if MrSID/LiDAR support should be built" FALSE)

if(WITH_MRSID)

set(MRSID_ROOT "/Users/hobu/installs/mrsid/Lidar_DSDK" CACHE STRING "Root directory of MrSID install")

find_package(MrSID)
if(MRSID_FOUND)
set(CMAKE_REQUIRED_LIBRARIES "${MRSID_LIBRARY}")
include_directories(${MRSID_INCLUDE_DIR})
add_definitions(-DHAVE_MRSID=1)
set(PDAL_HAVE_MRSID 1)
endif()
endif()


#
# CARIS/BDB support (optional)
#
Expand All @@ -488,55 +412,6 @@ if(WITH_CARIS)
endif()


#
# Points2Grid (optional)
#
option(WITH_P2G "Choose if Points2Grid support should be built" FALSE)
if(WITH_P2G)
find_package(Points2Grid)
if(P2G_FOUND)
set(CMAKE_REQUIRED_LIBRARIES "${P2G_LIBRARY}")
include_directories(${P2G_INCLUDE_DIR})
add_definitions(-DHAVE_P2G=1)
set(PDAL_HAVE_P2G 1)
endif()
endif()


#
# HDF5 - optional
#
option(WITH_HDF5 "Choose if HDF5 support should be built" FALSE)
if(WITH_HDF5)
set (HDF5_FIND_COMPONENTS "CXX")
find_package(HDF5 COMPONENTS CXX)
if(HDF5_FOUND)
include_directories(${HDF5_INCLUDE_DIR})
add_definitions(-DHAVE_HDF5=1)
set(PDAL_HAVE_HDF5 1)
message(STATUS "Found HDF5")
else()
set(WITH_HDF5 FALSE)
set(PDAL_HAVE_HDF5 0)
message(STATUS "HDF5 not found")
endif()
endif()


#
# Hexer - optional
#
option(WITH_HEXER "Whether or not hexbin filter is built" FALSE)
if(WITH_HEXER)
find_package(Hexer)
if(HEXER_FOUND)
include_directories(${HEXER_INCLUDE_DIR})
add_definitions(-DHAVE_HEXER=1)
set(PDAL_HAVE_HEXER 1)
endif()
endif()


#
# Python - optional
#
Expand All @@ -561,13 +436,13 @@ endif()


#
# libxml2 (used iff ORACLE or PGPOINTCLOUD or SQLITE)
# libxml2 (used iff OCI or PGPOINTCLOUD or SQLITE)
#
option(WITH_LIBXML2 "Choose if libxml2 support should be built " FALSE)
if (WITH_LIBXML2 OR
(WITH_ORACLE OR
WIT_PGPOINTCLOUD OR
WITH_SQLITE))
(BUILD_PLUGIN_OCI OR
BUILD_PLUGIN_PGPOINTCLOUD OR
BUILD_PLUGIN_SQLITE))
set(WITH_LIBXML2 TRUE)
else()
set(WITH_LIBXML2 FALSE)
Expand All @@ -587,21 +462,6 @@ if(WITH_LIBXML2)
endif()


option(USE_PDAL_PLUGIN_TEXT "Build the text driver as a plugin rather than embedding" FALSE)
option(USE_PDAL_PLUGIN_SOCI "Build the soci driver as a plugin rather than embedding" FALSE)
option(USE_PDAL_PLUGIN_OCI "Build the oci driver as a plugin rather than embedding" FALSE)
option(USE_PDAL_PLUGIN_MRSID "Build the MrSID driver as a plugin rather than embedding" FALSE)
option(USE_PDAL_PLUGIN_CARIS "Build the Caris driver as a plugin rather than embedding" FALSE)
option(USE_PDAL_PLUGIN_NITRO "Build the NITF writer as a plugin rather than embedding" FALSE)

if (USE_PDAL_PLUGIN_TEXT OR USE_PDAL_PLUGIN_SOCI OR USE_PDAL_PLUGIN_OCI OR
USE_PDAL_PLUGIN_MRSID OR USE_PDAL_PLUGIN_CARIS OR USE_PDAL_PLUGIN_NITRO)
if (PDAL_BUILD_STATIC)
message(SEND_ERROR "Cannot build separate plugins with statically compiled PDAL")
endif()
endif()


#------------------------------------------------------------------------------
# installation commands
#------------------------------------------------------------------------------
Expand Down Expand Up @@ -632,13 +492,6 @@ include_directories("${CMAKE_CURRENT_BINARY_DIR}/include")
# subdirectory controls
#------------------------------------------------------------------------------

add_subdirectory(src)
add_subdirectory(plugins)

if(WITH_APPS)
add_subdirectory(apps)
endif()

if(WITH_TESTS)
message(STATUS "Building with PDAL unit tests")
enable_testing()
Expand All @@ -663,6 +516,14 @@ else()
endif()


add_subdirectory(src)
add_subdirectory(plugins)

if(WITH_APPS)
add_subdirectory(apps)
endif()



#------------------------------------------------------------------------------
# CPACK controls
Expand Down
24 changes: 14 additions & 10 deletions cmake/examples/hobu-config.sh
Expand Up @@ -2,7 +2,7 @@ USR_LOCAL="/usr/local"
USR="/usr"
TIFF_HOME=$USR_LOCAL
LASZIP_HOME=$USR_LOCAL
LIBXML2_HOME=$USR
LIBXML2_HOME=/usr/local/Cellar/libxml2/2.9.2/
GEOTIFF_HOME=$USR_LOCAL
P2G_HOME=$USR_LOCAL
HEXER_HOME="/usr/local"
Expand All @@ -12,6 +12,7 @@ SO_EXT=dylib
# CXX=/usr/local/bin/g++-4.8

ORACLE_HOME=$HOME/oracle
LAZPERF_HOME=$HOME/dev/git/laz-perf
export ORACLE_HOME
CONFIG="Unix Makefiles"
#CONFIG="Ninja"
Expand All @@ -23,16 +24,18 @@ fi
CC=$CC CXX=$CXX cmake -G "$CONFIG" \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_INSTALL_PREFIX=/Users/hobu \
-DWITH_ORACLE=ON \
-DBUILD_PLUGIN_OCI=ON \
-DWITH_GEOTIFF=ON \
-DWITH_SQLITE=ON \
-DWITH_P2G=ON \
-DWITH_HEXER=ON \
-DWITH_NITRO=ON \
-DWITH_MRSID=OFF \
-DWITH_HDF5=ON \
-DWITH_PCL=ON \
-DWITH_PGPOINTCLOUD=ON \
-DBUILD_PLUGIN_SQLITE=ON \
-DBUILD_PLUGIN_PGPOINTCLOUD=ON \
-DBUILD_OCI_TESTS=ON \
-DBUILD_PLUGIN_HEXBIN=ON \
-DBUILD_PLUGIN_NITF=ON \
-DBUILD_PLUGIN_P2G=ON \
-DBUILD_PLUGIN_MRSID=OFF \
-DBUILD_PLUGIN_ICEBRIDGE=ON \
-DBUILD_PLUGIN_PCL=ON \
-DWITH_COMPRESSION=ON \
-DMRSID_INCLUDE_DIR=/Users/hobu/dev/release/mrsid/Lidar_DSDK/include \
-DMRSID_LIBRARY=/Users/hobu/dev/release/mrsid/Lidar_DSDK/lib/liblti_lidar_dsdk.dylib \
-DHEXER_INCLUDE_DIR=${HEXER_HOME}/include \
Expand All @@ -46,6 +49,7 @@ CC=$CC CXX=$CXX cmake -G "$CONFIG" \
-DLASZIP_LIBRARY=${LASZIP_HOME}/lib/liblaszip.${SO_EXT} \
-DLIBXML2_INCLUDE_DIR=${LIBXML2_HOME}/include/libxml2 \
-DLIBXML2_LIBRARIES=${LIBXML2_HOME}/lib/libxml2.${SO_EXT} \
-DLAZPERF_INCLUDE_DIR=${LAZPERF_HOME}/ \
-DSQLITE3_INCLUDE_DIR=${SQLITE_HOME}/include \
-DSQLITE3_LIBRARY=${SQLITE_HOME}/lib/libsqlite3.${SO_EXT}

Expand Down

0 comments on commit 1f40e74

Please sign in to comment.