[Liblas-commits] laszip: static build option

liblas-commits at liblas.org liblas-commits at liblas.org
Fri Jan 21 14:29:33 EST 2011


details:   http://hg.liblas.orglaszip/rev/24f8c5388535
changeset: 158:24f8c5388535
user:      Howard Butler <hobu.inc at gmail.com>
date:      Fri Jan 21 13:29:25 2011 -0600
description:
static build option

diffstat:

 CMakeLists.txt       |   2 ++
 hobu-config.bat      |   5 ++---
 src/CMakeLists.txt   |  11 +++++++++--
 tools/CMakeLists.txt |   2 ++
 4 files changed, 15 insertions(+), 5 deletions(-)

diffs (77 lines):

diff -r 053a9e23be31 -r 24f8c5388535 CMakeLists.txt
--- a/CMakeLists.txt	Fri Jan 21 12:56:49 2011 -0600
+++ b/CMakeLists.txt	Fri Jan 21 13:29:25 2011 -0600
@@ -59,6 +59,8 @@
 # Output directory in which to build ARCHIVE target files.
 set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LASZIP_BUILD_OUTPUT_DIRECTORY}) 
 
+
+set(BUILD_STATIC FALSE CACHE BOOL "Build LASzip statically" )
 ###############################################################################
 # Platform and compiler specific settings
 
diff -r 053a9e23be31 -r 24f8c5388535 hobu-config.bat
--- a/hobu-config.bat	Fri Jan 21 12:56:49 2011 -0600
+++ b/hobu-config.bat	Fri Jan 21 13:29:25 2011 -0600
@@ -3,8 +3,6 @@
 set G="NMake Makefiles"
 REM set G="Visual Studio 9 2008"
 REM set G="Visual Studio 10"
-REM set G="Visual Studio 9 2008"
-set LASZIP=D:\laszip
 REM set BUILD_TYPE=RelWithDebInfo
 REM set BUILD_TYPE=Debug
 set BUILD_TYPE=Release
@@ -12,4 +10,5 @@
 cmake -G %G% ^
     -DCMAKE_BUILD_TYPE=%BUILD_TYPE% ^
     -DCMAKE_VERBOSE_MAKEFILE=OFF ^
-    %LASZIP%
+    -DBUILD_STATIC=FALSE ^
+    .
diff -r 053a9e23be31 -r 24f8c5388535 src/CMakeLists.txt
--- a/src/CMakeLists.txt	Fri Jan 21 12:56:49 2011 -0600
+++ b/src/CMakeLists.txt	Fri Jan 21 13:29:25 2011 -0600
@@ -56,8 +56,10 @@
   )
 
 if(WIN32)
+if(NOT BUILD_STATIC)
     add_definitions("-DLASZIP_DLL_EXPORT=1")
 endif()
+endif()
 
 # Group source files for IDE source explorers (e.g. Visual Studio)
 source_group("CMake Files" FILES CMakeLists.txt)
@@ -68,10 +70,15 @@
 include_directories(../include ../include/laszip .)
 
 
-add_library(${LASZIP_LIB_NAME} SHARED ${LASZIP_SOURCES})
+if(BUILD_STATIC)
+    add_library(${LASZIP_LIB_NAME} STATIC ${LASZIP_SOURCES})
+else()
+    add_library(${LASZIP_LIB_NAME} SHARED ${LASZIP_SOURCES})
+endif()
+
 set_target_properties(${LASZIP_LIB_NAME}
   PROPERTIES SOVERSION "${LASZIP_LIB_SOVERSION}" )
-
+      
 ###############################################################################
 # Targets installation
 
diff -r 053a9e23be31 -r 24f8c5388535 tools/CMakeLists.txt
--- a/tools/CMakeLists.txt	Fri Jan 21 12:56:49 2011 -0600
+++ b/tools/CMakeLists.txt	Fri Jan 21 13:29:25 2011 -0600
@@ -26,8 +26,10 @@
     )
     
 if(WIN32)
+if(NOT BUILD_STATIC)
     add_definitions("-DLASZIP_DLL_EXPORT=1")
 endif()
+endif()
 
 
 # TODO: Experimental and requires testing --mloskot


More information about the Liblas-commits mailing list