[Liblas-commits] hg: Added install target of runtime components to
CMake build co...
liblas-commits at liblas.org
liblas-commits at liblas.org
Sun Sep 27 17:54:16 EDT 2009
changeset 97f58cc1660a in /home/www/liblas.org/hg
details: http://hg.liblas.org/main/hg?cmd=changeset;node=97f58cc1660a
summary: Added install target of runtime components to CMake build configuration
diffstat:
CMakeLists.txt | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++----
apps/CMakeLists.txt | 22 ++++++++++++++++++++--
src/CMakeLists.txt | 14 ++++++++++++++
3 files changed, 88 insertions(+), 6 deletions(-)
diffs (174 lines):
diff -r 7979f84370b6 -r 97f58cc1660a CMakeLists.txt
--- a/CMakeLists.txt Sun Sep 27 19:06:09 2009 +0100
+++ b/CMakeLists.txt Sun Sep 27 22:54:07 2009 +0100
@@ -23,10 +23,13 @@
###############################################################################
# CMake settings
-CMAKE_MINIMUM_REQUIRED( VERSION 2.4.0 )
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0)
SET(CMAKE_COLOR_MAKEFILE ON)
+# Allow advanced users to generate Makefiles printing detailed commands
+MARK_AS_ADVANCED(CMAKE_VERBOSE_MAKEFILE)
+
# Path to additional CMake modules
SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/build/cmake ${CMAKE_MODULE_PATH})
@@ -73,6 +76,9 @@
###############################################################################
# Search for dependencies
+# Boost C++ Libraries support - optional, default=OFF
+# TODO
+
# zlib support - optional, default=OFF
SET(WITH_ZLIB FALSE CACHE BOOL "Choose if zlib support should be built")
@@ -128,11 +134,55 @@
# Oracle support - optional, default=OFF
# TODO
-# Boost C++ Libraries support - optional, default=OFF
-# TODO
+###############################################################################
+# Installation settings
+
+IF(WIN32)
+ SET(DEFAULT_LIB_SUBDIR lib)
+ SET(DEFAULT_DATA_SUBDIR .)
+ SET(DEFAULT_INCLUDE_SUBDIR include)
+
+ IF (MSVC)
+ SET(DEFAULT_BIN_SUBDIR bin)
+ ELSE()
+ SET(DEFAULT_BIN_SUBDIR .)
+ ENDIF()
+ELSE()
+ # Common locatoins for Unix and Mac OS X
+ SET(DEFAULT_BIN_SUBDIR bin)
+ SET(DEFAULT_LIB_SUBDIR lib)
+ SET(DEFAULT_DATA_SUBDIR share/liblas)
+ SET(DEFAULT_INCLUDE_SUBDIR include/liblas)
+ENDIF()
+
+# Locations are changeable by user to customize layout of libLAS installation
+# (default values are platform-specific)
+SET(LIBLAS_BIN_SUBDIR ${DEFAULT_BIN_SUBDIR} CACHE STRING
+ "Subdirectory where executables will be installed")
+SET(LIBLAS_LIB_SUBDIR ${DEFAULT_LIB_SUBDIR} CACHE STRING
+ "Subdirectory where libraries will be installed")
+SET(LIBLAS_INCLUDE_SUBDIR ${DEFAULT_INCLUDE_SUBDIR} CACHE STRING
+ "Subdirectory where header files will be installed")
+SET(LIBLAS_DATA_SUBDIR ${DEFAULT_DATA_SUBDIR} CACHE STRING
+ "Subdirectory where data will be installed")
+
+# Mark *_SUBDIR variables as advanced and dedicated to use by power-users only.
+MARK_AS_ADVANCED(LIBLAS_BIN_SUBDIR LIBLAS_LIB_SUBDIR LIBLAS_INCLUDE_SUBDIR LIBLAS_DATA_SUBDIR)
+
+# Full paths for the installation
+SET(LIBLAS_BIN_DIR ${LIBLAS_BIN_SUBDIR})
+SET(LIBLAS_LIB_DIR ${LIBLAS_LIB_SUBDIR})
+SET(LIBLAS_INCLUDE_DIR ${LIBLAS_INCLUDE_SUBDIR})
+SET(LIBLAS_DATA_DIR ${LIBLAS_DATA_SUBDIR})
###############################################################################
-# List of directories to process
+# Installation commands
+
+INSTALL(FILES AUTHORS ChangeLog COPYING INSTALL LICENSE.txt README
+ DESTINATION ${LIBLAS_DATA_DIR}/doc)
+
+###############################################################################
+# Processing of project directories
ADD_SUBDIRECTORY(src)
diff -r 7979f84370b6 -r 97f58cc1660a apps/CMakeLists.txt
--- a/apps/CMakeLists.txt Sun Sep 27 19:06:09 2009 +0100
+++ b/apps/CMakeLists.txt Sun Sep 27 22:54:07 2009 +0100
@@ -5,17 +5,20 @@
# Copyright (c) 2009 Mateusz Loskot <mateusz at loskot.net>
#
###############################################################################
+
INCLUDE_DIRECTORIES(
.
../include
../include/liblas/capi)
-# Standard utilities
+###############################################################################
+# Collect programs to build
+
SET(LASINFO lasinfo)
+SET(LASMERGE lasmerge)
SET(LAS2LAS las2las)
SET(LAS2TXT las2txt)
SET(TXT2LAS txt2las)
-SET(LASMERGE lasmerge)
# Utilities depending on 3rd-pary libraries
IF(GDAL_FOUND)
@@ -30,6 +33,13 @@
SET(LAS2OCI las2oci)
ENDIF()
+SET(LIBLAS_UTILITIES
+ ${LASINFO} ${LASMERGE} ${LAS2LAS} ${LAS2TXT} ${TXT2LAS}
+ ${LAS2OGR} ${LASINDEX} ${LAS2OCI})
+
+###############################################################################
+# Configure build targets
+
SET(APPS_CPP_DEPENDENCIES
${LIBLAS_LIB_NAME}
${GEOTIFF_LIBRARY}
@@ -89,3 +99,11 @@
ADD_EXECUTABLE(${LAS2OCI} las2oci.cpp)
TARGET_LINK_LIBRARIES(${LAS2CI} ${APPS_CPP_DEPENDENCIES})
ENDIF(LAS2OCI)
+
+###############################################################################
+# Targets installation
+
+INSTALL(TARGETS ${LIBLAS_UTILITIES}
+ RUNTIME DESTINATION ${LIBLAS_BIN_DIR}
+ LIBRARY DESTINATION ${LIBLAS_LIB_DIR}
+ ARCHIVE DESTINATION ${LIBLAS_LIB_DIR})
diff -r 7979f84370b6 -r 97f58cc1660a src/CMakeLists.txt
--- a/src/CMakeLists.txt Sun Sep 27 19:06:09 2009 +0100
+++ b/src/CMakeLists.txt Sun Sep 27 22:54:07 2009 +0100
@@ -20,6 +20,9 @@
index/storage.cpp)
ENDIF()
+###############################################################################
+# Source files specification
+
SET(LIBLAS_HEADERS_DIR ../include/liblas)
SET(LIBLAS_HPP
@@ -107,6 +110,9 @@
# Standard include directory of libLAS library
INCLUDE_DIRECTORIES(../include)
+###############################################################################
+# Targets settings
+
# Static libLAS C++ library
ADD_LIBRARY(${LIBLAS_LIB_NAME} STATIC ${LIBLAS_SOURCES})
@@ -119,3 +125,11 @@
${GEOTIFF_LIBRARY}
${SPATIALINDEX_LIBRARY}
${ZLIB_LIBRARIES})
+
+###############################################################################
+# Targets installation
+
+INSTALL(TARGETS ${LIBLAS_LIB_NAME} ${LIBLAS_C_LIB_NAME}
+ RUNTIME DESTINATION ${LIBLAS_BIN_DIR}
+ LIBRARY DESTINATION ${LIBLAS_LIB_DIR}
+ ARCHIVE DESTINATION ${LIBLAS_LIB_DIR})
More information about the Liblas-commits
mailing list