[Liblas-commits] ann: add cmake config from liblas

liblas-commits at liblas.org liblas-commits at liblas.org
Fri Dec 18 16:36:15 EST 2009


changeset fca88914db55 in /Volumes/Data/www/liblas.org/ann
details: http://hg.liblas.organn?cmd=changeset;node=fca88914db55
summary: add cmake config from liblas

diffstat:

 CMakeLists.txt     |  156 +++++++++++++
 Makefile           |  282 ++++++++++++++---------
 src/CMakeLists.txt |  103 ++++++++
 src/Makefile       |  621 +++++++++++++++++++++++++++++++++++++++++++++-------
 4 files changed, 963 insertions(+), 199 deletions(-)

diffs (truncated from 1215 to 300 lines):

diff -r 6a49f8aff68d -r fca88914db55 CMakeLists.txt
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/CMakeLists.txt	Fri Dec 18 15:36:08 2009 -0600
@@ -0,0 +1,156 @@
+###############################################################################
+# Main CMake configuration file for libANN
+#
+# Author: Mateusz Loskot <mateusz at loskot.net>
+#
+# ************************************************************************
+# WARNING (mloskot): A PROTOTYPE - WORK IN PROGRESS
+# Here are details about this work: http://liblas.org/ticket/52
+# ************************************************************************
+#
+###############################################################################
+# libANN general settings
+PROJECT(libANN)
+
+# Name of C++ library
+SET(LIBANN_LIB_NAME ann)
+
+
+
+###############################################################################
+# CMake settings
+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})
+
+###############################################################################
+# General build settings
+
+IF(NOT CMAKE_BUILD_TYPE)
+    SET(CMAKE_BUILD_TYPE Debug CACHE STRING
+        "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel"
+        FORCE)
+ENDIF()
+
+SET(BUILD_PEDANTIC TRUE CACHE BOOL "Choose compilation in pedantic or relaxed mode")
+
+# TODO: Still testing the output paths --mloskot
+SET(LIBANN_BUILD_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin/${CMAKE_BUILD_TYPE})
+
+# Output directory in which to build RUNTIME target files.
+SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LIBANN_BUILD_OUTPUT_DIRECTORY})
+
+# Output directory in which to build LIBRARY target files
+SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LIBANN_BUILD_OUTPUT_DIRECTORY})
+
+# Output directory in which to build ARCHIVE target files.
+SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LIBANN_BUILD_OUTPUT_DIRECTORY}) 
+
+###############################################################################
+# Platform and compiler specific settings
+
+IF(WIN32)
+    IF (MSVC)
+        IF(BUILD_PEDANTIC)
+            SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
+        ENDIF()
+
+        IF (MSVC80)
+            ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)
+            ADD_DEFINITIONS(-D_CRT_NONSTDC_NO_WARNING)
+        ENDIF()
+
+        # Generate dot-user file with user-specific settings for Visual Studio project
+        SET(MSVC_ENVIRONMENT_PATH "" CACHE STRING
+            "Custom PATH for Environment property in Visual Studio project configuration")
+        MARK_AS_ADVANCED(MSVC_ENVIRONMENT_PATH)
+        SET(VCPROJ_USER_ENVIRONMENT_PATH_DEBUG "${ENVIRONMENT_PATH}")
+        MARK_AS_ADVANCED(VCPROJ_USER_ENVIRONMENT_PATH_DEBUG)
+
+    ENDIF()
+ELSE()
+    IF(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
+        
+        SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -Wall -Wno-long-long -ansi")
+
+        IF(BUILD_PEDANTIC)
+            SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic")
+        ENDIF()
+        
+        IF (CMAKE_COMPILER_IS_GNUCXX)
+            SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++98")
+        ENDIF()
+    ENDIF()
+ENDIF(WIN32)
+
+###############################################################################
+# Search for dependencies
+
+###############################################################################
+# 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)
+ENDIF()
+
+# Locations are changeable by user to customize layout of libANN installation
+# (default values are platform-specific)
+SET(LIBANN_BIN_SUBDIR ${DEFAULT_BIN_SUBDIR} CACHE STRING
+    "Subdirectory where executables will be installed")
+SET(LIBANN_LIB_SUBDIR ${DEFAULT_LIB_SUBDIR} CACHE STRING
+    "Subdirectory where libraries will be installed")
+SET(LIBANN_INCLUDE_SUBDIR ${DEFAULT_INCLUDE_SUBDIR} CACHE STRING
+    "Subdirectory where header files will be installed")
+SET(LIBANN_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(LIBANN_BIN_SUBDIR LIBANN_LIB_SUBDIR LIBANN_INCLUDE_SUBDIR LIBANN_DATA_SUBDIR)
+
+# Full paths for the installation
+SET(LIBANN_LIB_DIR ${LIBANN_LIB_SUBDIR})
+SET(LIBANN_INCLUDE_DIR ${LIBANN_INCLUDE_SUBDIR})
+
+###############################################################################
+# Installation commands
+
+INSTALL(FILES AUTHORS ChangeLog Copyright.txt License.txt ReadMe.txt
+    DESTINATION ${LIBANN_DATA_DIR}/doc)
+
+###############################################################################
+# Processing of project directories
+
+ADD_SUBDIRECTORY(src)
+
+
+IF(WITH_TESTS)
+    MESSAGE(STATUS "Enable libANN tests to build - done")
+    ENABLE_TESTING()
+
+
+    ADD_SUBDIRECTORY(test)
+ELSE()
+
+ENDIF()
+
+# EOF
diff -r 6a49f8aff68d -r fca88914db55 Makefile
--- a/Makefile	Fri Dec 18 14:58:12 2009 -0600
+++ b/Makefile	Fri Dec 18 15:36:08 2009 -0600
@@ -1,115 +1,181 @@
-#-----------------------------------------------------------------------------
-# Top-level Makefile for ANN.
-#
-# ANN: Approximate Nearest Neighbors
-# Version: 1.1 05/03/05
-#-----------------------------------------------------------------------------
-# Copyright (c) 1997-2005 University of Maryland and Sunil Arya and
-# David Mount.  All Rights Reserved.
-# 
-# This software and related documentation is part of the Approximate
-# Nearest Neighbor Library (ANN).  This software is provided under
-# the provisions of the Lesser GNU Public License (LGPL).  See the
-# file ../ReadMe.txt for further information.
-# 
-# The University of Maryland (U.M.) and the authors make no
-# representations about the suitability or fitness of this software for
-# any purpose.  It is provided "as is" without express or implied
-# warranty.
-#-----------------------------------------------------------------------------
-# Revision 0.1  09/06/97
-#	alpha release
-# Revision 0.2  06/26/98
-#	Minor changes to fix compilation errors on SGI systems.
-# Revision 1.0  04/01/05
-#	Initial release (finally!)
-#	Added linux-g++ target
-# Revision 1.1  05/03/05
-#	Added macosx-g++ target
-#-----------------------------------------------------------------------------
+# CMAKE generated file: DO NOT EDIT!
+# Generated by "Unix Makefiles" Generator, CMake Version 2.6
 
-#-----------------------------------------------------------------------------
-# default: list the options
-# The following legacy targets are also available.
-#	make sunos4		for Sun with SunOS 4.x
-#	make sunos4-g++		for Sun with SunOS 4.x and g++
-#	make alpha-g++		for DEC Alpha and g++
-# The following targets are used for internal development only
-#	make authors-debug	author's debugging
-#	make authors-perf	author's performance evaluations
-#	make distribution	author's generation of distribution file
-#-----------------------------------------------------------------------------
-default:
-	@echo "Enter one of the following:"
-	@echo "  make linux-g++            for Linux and g++"
-	@echo "  make macosx-g++           for Mac OS X and g++"
-	@echo "  make sunos5               for Sun with SunOS 5.x"
-	@echo "  make sunos5-sl            for Sun with SunOS 5.x, make shared libs"
-	@echo "  make sunos5-g++           for Sun with SunOS 5.x and g++"
-	@echo "  make sunos5-g++-sl        for Sun with SunOS 5.x, g++, make shared libs"
-	@echo "  make clean                remove .o files"
-	@echo "  make realclean            remove .o, library and executable files"
-	@echo " "
-	@echo "See file Makefile for other compilation options, such as disabling"
-	@echo "performance measurement code."
+# Default target executed when no arguments are given to make.
+default_target: all
+.PHONY : default_target
 
-#-----------------------------------------------------------------------------
-# main make entry point
-#-----------------------------------------------------------------------------
-alpha-g++ macosx-g++ linux-g++ sgi sunos4 sunos4-g++ sunos5 sunos5-g++ sunos5-g++-sl authors-debug authors-perf:
-	cd src ; $(MAKE) $@
-	cd test ; $(MAKE) $@
-	cd sample ; $(MAKE) $@
-	cd ann2fig ; $(MAKE) $@
+#=============================================================================
+# Special targets provided by cmake.
 
-#-----------------------------------------------------------------------------
-# Remove .o files and core files
-#-----------------------------------------------------------------------------
+# Disable implicit rules so canoncical targets will work.
+.SUFFIXES:
+
+# Remove some rules from gmake that .SUFFIXES does not remove.
+SUFFIXES =
+
+.SUFFIXES: .hpux_make_needs_suffix_list
+
+# Suppress display of executed commands.
+$(VERBOSE).SILENT:
+
+# A target that is always out of date.
+cmake_force:
+.PHONY : cmake_force
+
+#=============================================================================
+# Set environment variables for the build.
+
+# The shell in which to execute make rules.
+SHELL = /bin/sh
+
+# The CMake executable.
+CMAKE_COMMAND = "/Applications/CMake 2.6-3.app/Contents/bin/cmake"
+
+# The command to remove a file.
+RM = "/Applications/CMake 2.6-3.app/Contents/bin/cmake" -E remove -f
+
+# The program to use to edit the cache.
+CMAKE_EDIT_COMMAND = "/Applications/CMake 2.6-3.app/Contents/bin/ccmake"
+
+# The top-level source directory on which CMake was run.
+CMAKE_SOURCE_DIR = /Users/hobu/dev/hg/liblas-ann
+
+# The top-level build directory on which CMake was run.
+CMAKE_BINARY_DIR = /Users/hobu/dev/hg/liblas-ann
+
+#=============================================================================
+# Targets provided globally by CMake.
+
+# Special rule for the target edit_cache
+edit_cache:
+	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..."
+	"/Applications/CMake 2.6-3.app/Contents/bin/ccmake" -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
+.PHONY : edit_cache
+
+# Special rule for the target edit_cache
+edit_cache/fast: edit_cache
+.PHONY : edit_cache/fast
+
+# Special rule for the target install
+install: preinstall
+	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..."
+	"/Applications/CMake 2.6-3.app/Contents/bin/cmake" -P cmake_install.cmake
+.PHONY : install
+
+# Special rule for the target install
+install/fast: preinstall/fast
+	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..."
+	"/Applications/CMake 2.6-3.app/Contents/bin/cmake" -P cmake_install.cmake
+.PHONY : install/fast
+
+# Special rule for the target install/local


More information about the Liblas-commits mailing list