[Liblas-commits] hg-main-tree: first pieces of mrsid cmake config

liblas-commits at liblas.org liblas-commits at liblas.org
Thu Mar 17 11:17:19 EDT 2011


details:   http://hg.libpc.orghg-main-tree/rev/84c592526b99
changeset: 330:84c592526b99
user:      Kirk McKelvey <kirkoman at gmail.com>
date:      Thu Mar 17 10:16:35 2011 -0500
description:
first pieces of mrsid cmake config

diffstat:

 cmake/modules/FindMrSID.cmake |  58 +++++++++++++++++++++++++++++++++++++++++++
 src/drivers/CMakeLists.txt    |   4 ++
 2 files changed, 62 insertions(+), 0 deletions(-)

diffs (76 lines):

diff -r eb8dc891ad8f -r 84c592526b99 cmake/modules/FindMrSID.cmake
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cmake/modules/FindMrSID.cmake	Thu Mar 17 10:16:35 2011 -0500
@@ -0,0 +1,58 @@
+###############################################################################
+#
+# CMake module to search for MrSID/MG4 libraries
+#
+# On success, the macro sets the following variables:
+# MRSID_FOUND        = if the library was found
+# MRSID_LIBRARY      = full path to the library
+# MRSID_INCLUDE_DIR  = full path to the headers
+# MRSID_VERSION      = version of library which was found
+#
+# Copyright (c) 2009 Mateusz Loskot <mateusz at loskot.net>
+#
+# Developed with inspiration from Petr Vanek <petr at scribus.info>
+# who wrote similar macro for TOra - http://torasql.com/
+#
+# Module source: http://github.com/mloskot/workshop/tree/master/cmake/
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+#
+###############################################################################
+
+if(MRSID_INCLUDE_DIR AND MRSID_LIBRARY)
+  # Already in cache, be silent
+  set(MRSID_FIND_QUIETLY TRUE)
+endif()
+
+if(NOT MRSID_FIND_QUIETLY)
+  message(STATUS "Searching for MrSID LiDAR library ${MrSID_FIND_VERSION}+")
+endif()
+
+if(NOT DEFINED ENV{MRSID_HOME})
+  message(FATAL_ERROR "Missing environment variable MRSID_HOME with location of MrSID LiDAR sdk")
+endif()
+
+set(MRSID_HOME $ENV{MRSID_HOME})
+
+find_path(MRSID_INCLUDE_DIR
+          lidar/Base.h
+          PATHS
+            ${MRSID_HOME}/include
+            ${MRSID_HOME}/Lidar_DSDK/include
+          NO_DEFAULT_PATH)
+
+find_library(MRSID_LIBRARY
+             NAMES
+               lti_lidar_dsdk
+               liblti_lidar_dsdk
+             HINTS
+               ${MRSID_INCLUDE_DIR}/../lib
+             NO_DEFAULT_PATH)
+
+
+# Handle the QUIETLY and REQUIRED arguments and set MRSID_FOUND to TRUE
+# if all listed variables are TRUE
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(MrSID DEFAULT_MSG MRSID_LIBRARY MRSID_INCLUDE_DIR)
+
diff -r eb8dc891ad8f -r 84c592526b99 src/drivers/CMakeLists.txt
--- a/src/drivers/CMakeLists.txt	Thu Mar 17 10:15:32 2011 -0500
+++ b/src/drivers/CMakeLists.txt	Thu Mar 17 10:16:35 2011 -0500
@@ -11,6 +11,10 @@
 add_subdirectory(las)
 add_subdirectory(liblas)
 
+if(MRSID_FOUND)
+    add_subdirectory(mrsid)
+endif()
+
 if(ORACLE_FOUND AND GDAL_FOUND)
     add_subdirectory(oci)
 endif()


More information about the Liblas-commits mailing list