[Liblas-commits] hg: fix up liblas-config generation thanks to Mateusz' work in GEOS

liblas-commits at liblas.org liblas-commits at liblas.org
Thu Dec 23 22:01:57 EST 2010


details:   http://hg.liblas.orghg/rev/dfcba7cf296a
changeset: 2639:dfcba7cf296a
user:      Howard Butler <hobu.inc at gmail.com>
date:      Thu Dec 23 21:01:50 2010 -0600
description:
fix up liblas-config generation thanks to Mateusz' work in GEOS

diffstat:

 CMakeLists.txt        |   2 +-
 apps/CMakeLists.txt   |  18 +++++++++++
 apps/liblas-config.in |  80 +++++++++++++++++++++++++++++++++++++++++++++++---
 3 files changed, 93 insertions(+), 7 deletions(-)

diffs (156 lines):

diff -r 124f0b82a28d -r dfcba7cf296a CMakeLists.txt
--- a/CMakeLists.txt	Thu Dec 23 14:16:49 2010 -0600
+++ b/CMakeLists.txt	Thu Dec 23 21:01:50 2010 -0600
@@ -12,6 +12,7 @@
 SET(LIBLAS_VERSION_MAJOR "1")
 SET(LIBLAS_VERSION_MINOR "6")
 SET(LIBLAS_VERSION_PATCH "0b3")
+set(VERSION "${LIBLAS_VERSION_MAJOR}.${LIBLAS_VERSION_MINOR}.${LIBLAS_VERSION_PATCH}")
 
 if(WIN32)
   # Name of C++ library
@@ -308,7 +309,6 @@
   set(DEFAULT_LIB_SUBDIR lib)
   set(DEFAULT_DATA_SUBDIR share/liblas)
   set(DEFAULT_INCLUDE_SUBDIR include)
-  configure_file(${CMAKE_CURRENT_SOURCE_DIR}/apps/liblas-config.in ${CMAKE_CURRENT_BINARY_DIR}/apps/liblas-config)
 endif()
 
 # Locations are changeable by user to customize layout of libLAS installation
diff -r 124f0b82a28d -r dfcba7cf296a apps/CMakeLists.txt
--- a/apps/CMakeLists.txt	Thu Dec 23 14:16:49 2010 -0600
+++ b/apps/CMakeLists.txt	Thu Dec 23 21:01:50 2010 -0600
@@ -184,3 +184,21 @@
     RUNTIME DESTINATION ${LIBLAS_BIN_DIR}
     LIBRARY DESTINATION ${LIBLAS_LIB_DIR}
     ARCHIVE DESTINATION ${LIBLAS_LIB_DIR})
+
+
+if(UNIX)
+
+  # Autoconf compatibility variables to use the same script source.
+  set(prefix ${CMAKE_INSTALL_PREFIX})
+  set(exec_prefix ${CMAKE_INSTALL_PREFIX}/bin)
+  set(libdir ${CMAKE_INSTALL_PREFIX}/lib)
+
+  configure_file(${CMAKE_CURRENT_SOURCE_DIR}/liblas-config.in
+    ${CMAKE_CURRENT_BINARY_DIR}/liblas-config @ONLY)
+
+  install(FILES ${CMAKE_CURRENT_BINARY_DIR}/liblas-config
+    DESTINATION bin/
+    PERMISSIONS
+    OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
+
+endif()
diff -r 124f0b82a28d -r dfcba7cf296a apps/liblas-config.in
--- a/apps/liblas-config.in	Thu Dec 23 14:16:49 2010 -0600
+++ b/apps/liblas-config.in	Thu Dec 23 21:01:50 2010 -0600
@@ -1,5 +1,65 @@
 #!/bin/sh
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
 
+INCLUDES="-I${prefix}/include "
+LIBS="-L$libdir -llas -llas_c -L at Boost_LIBRARY_DIRS@ @Boost_PROGRAM_OPTIONS_LIBRARY@"
+
+GDAL_INCLUDE="@GDAL_INCLUDE_DIR@"
+if test -n "$GDAL_INCLUDE" ; then 
+    INCLUDES="$INCLUDES -I$GDAL_INCLUDE"
+fi
+GDAL_LIBRARY="@GDAL_LIBRARY@"
+if test -n "$GDAL_LIBRARY" ; then 
+    LIBS="$LIBS $GDAL_LIBRARY"
+fi
+
+GEOTIFF_INCLUDE="@GEOTIFF_INCLUDE_DIR@"
+if test -n "$GEOTIFF_INCLUDE" ; then 
+    INCLUDES="$INCLUDES -I$GEOTIFF_INCLUDE"
+fi
+GEOTIFF_LIBRARY="@GEOTIFF_LIBRARY@"
+if test -n "$GEOTIFF_LIBRARY" ; then 
+    LIBS="$LIBS $GEOTIFF_LIBRARY"
+fi
+
+
+ORACLE_INCLUDE="@ORACLE_INCLUDE_DIR@"
+if test -n "$ORACLE_INCLUDE" ; then 
+    INCLUDES="$INCLUDES -I$ORACLE_INCLUDE"
+fi
+ORACLE_OCI_LIBRARY="@ORACLE_OCI_LIBRARY@"
+if test -n "$ORACLE_OCI_LIBRARY" ; then 
+    LIBS="$LIBS $ORACLE_OCI_LIBRARY @ORACLE_NNZ_LIBRARY@ @ORACLE_OCCI_LIBRARY@ @ORACLE_OCIEI_LIBRARY@"
+fi
+
+TIFF_INCLUDE="@TIFF_INCLUDE_DIR@"
+if test -n "$TIFF_INCLUDE" ; then 
+    INCLUDES="$INCLUDES -I$TIFF_INCLUDE"
+fi
+TIFF_LIBRARY="@TIFF_LIBRARY@"
+if test -n "$TIFF_LIBRARY" ; then 
+    LIBS="$LIBS $TIFF_LIBRARY"
+fi
+
+LIBXML2_INCLUDE_DIR="@LIBXML2_INCLUDE_DIR@"
+if test -n "$LIBXML2_INCLUDE_DIR" ; then 
+    INCLUDES="$INCLUDES -I$LIBXML2_INCLUDE_DIR"
+fi
+LIBXML2_LIBRARIES="@LIBXML2_LIBRARIES@"
+if test -n "$LIBXML2_LIBRARIES" ; then 
+    LIBS="$LIBS $LIBXML2_LIBRARIES"
+fi
+
+LASZIP_INCLUDE_DIR="@LASZIP_INCLUDE_DIR@"
+if test -n "$LASZIP_INCLUDE_DIR" ; then 
+    INCLUDES="$INCLUDES -I$LASZIP_INCLUDE_DIR"
+fi
+LASZIP_LIBRARY="@LASZIP_LIBRARY@"
+if test -n "$LASZIP_LIBRARY" ; then 
+    LIBS="$LIBS $LASZIP_LIBRARY"
+fi
 
 
 usage()
@@ -22,8 +82,16 @@
 fi
 
 case $1 in 
-  --libs)
-    echo "${LIBS}"
+  --libs) 
+    echo $LIBS
+    ;;
+
+  --prefix)
+    echo ${prefix}
+     ;;
+
+  --ldflags)
+    echo -L${libdir}
     ;;
 
   --defines)
@@ -31,19 +99,19 @@
     ;;
 
   --includes)
-    echo -I${GDAL_INCLUDE_DIR} -I${GEOTIFF_INCLUDE_DIR} -I${LIBXML2_INCLUDE_DIR} -I${ORACLE_INCLUDE_DIR} -I${TIFF_INCLUDE_DIR}
+    echo ${INCLUDES}
     ;;
 
   --cflags)
-    echo ${CMAKE_C_FLAGS}
+    echo -I${prefix}/include 
     ;;
 
   --cxxflags)
-    echo ${CMAKE_CXX_FLAGS}
+    echo @CMAKE_CXX_FLAGS@
     ;;
     
   --version)
-    echo ${LIBLAS_VERSION_MAJOR}.${LIBLAS_VERSION_MINOR}.${LIBLAS_VERSION_PATCH}
+    echo @VERSION@
     ;;
 
   *)


More information about the Liblas-commits mailing list