Permalink
Browse files

Added CMake build system

Mostly working, still don't have tests there yet.
  • Loading branch information...
1 parent f307939 commit 829a8767958cd1ee20227e8f7106b2d251b83aad Zack Moratto committed Jun 2, 2011
View
56 CMakeLists.txt
@@ -0,0 +1,56 @@
+project(PHOTK)
+cmake_minimum_required(VERSION 2.8)
+
+# Add path for custom modules
+set(CMAKE_MODULE_PATH
+ ${CMAKE_MODULE_PATH}
+ "${CMAKE_CURRENT_SOURCE_DIR}/cmake"
+ )
+
+set(PACKAGE_VERSION "0.1")
+set(PACKAGE_NAME photk)
+set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
+set(PACKAGE_BUGREPORT "z.m.moratto@nasa.gov")
+
+# Custom PhoTK options
+option(PHOTK_BUILD_TOOLS
+ "Build the PhotometryTK tools." ON)
+
+# Find Dependencies
+include(AddPHOTK)
+set(Boost_USE_STATIC_LIBS OFF)
+set(Boost_USE_MULTITHREADED ON )
+set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} -DBOOST_FILESYSTEM_VERSION=2)
+find_package(Boost 1.36.0
+ COMPONENTS
+ program_options
+ system
+ filesystem
+ thread
+ )
+find_package(VisionWorkbench REQUIRED
+ COMPONENTS
+ core
+ math
+ image
+ fileio
+ plate
+ cartography
+ )
+find_package(Protobuf REQUIRED)
+include_directories(${PROTOBUF_INCLUDE_DIRS})
+#photk_enable_testing() # Not working at the moment as I need to
+#figure out a way in which the user should have to install gtest
+#themselves.
+
+# Produce photk/config.h
+configure_file(
+ ${PHOTK_SOURCE_DIR}/src/photk/config.h.in
+ ${PHOTK_BINARY_DIR}/src/photk/config.h
+ )
+
+# Add common search locations
+include_directories(${PHOTK_SOURCE_DIR}/src)
+
+add_subdirectory(src/photk)
+add_subdirectory(src/tools)
View
22 cmake/AddPHOTK.cmake
@@ -0,0 +1,22 @@
+macro(add_photk_executable name)
+ add_executable(${name} ${ARGN})
+ foreach(lib ${PHOTK_USED_LIBS})
+ target_link_libraries( ${name} ${lib} )
+ endforeach(lib)
+endmacro(add_photk_executable name)
+
+macro(add_photk_tool name)
+ add_photk_executable(${name} ${ARGN})
+ if( PHOTK_BUILD_TOOLS )
+ message( "Installing: " ${name} )
+ install(TARGETS ${name} RUNTIME DESTINATION bin)
+ endif()
+ set_target_properties(${name} PROPERTIES FOLDER "tools")
+endmacro(add_photk_tool name)
+
+function(photk_enable_testing)
+ enable_testing()
+ set(GTEST_ROOT ${PHOTK_SOURCE_DIR}/thirdparty/gtest)
+ message( "GTEST ROOT: " ${GTEST_ROOT} )
+ find_package(GTest REQUIRED)
+endfunction(photk_enable_testing)
View
158 cmake/FindGTest.cmake
@@ -0,0 +1,158 @@
+# Locate the Google C++ Testing Framework.
+#
+# Defines the following variables:
+#
+# GTEST_FOUND - Found the Google Testing framework
+# GTEST_INCLUDE_DIRS - Include directories
+#
+# Also defines the library variables below as normal
+# variables. These contain debug/optimized keywords when
+# a debugging library is found.
+#
+# GTEST_BOTH_LIBRARIES - Both libgtest & libgtest-main
+# GTEST_LIBRARIES - libgtest
+# GTEST_MAIN_LIBRARIES - libgtest-main
+#
+# Accepts the following variables as input:
+#
+# GTEST_ROOT - (as a CMake or environment variable)
+# The root directory of the gtest install prefix
+#
+# GTEST_MSVC_SEARCH - If compiling with MSVC, this variable can be set to
+# "MD" or "MT" to enable searching a GTest build tree
+# (defaults: "MD")
+#
+#-----------------------
+# Example Usage:
+#
+# enable_testing()
+# find_package(GTest REQUIRED)
+# include_directories(${GTEST_INCLUDE_DIRS})
+#
+# add_executable(foo foo.cc)
+# target_link_libraries(foo ${GTEST_BOTH_LIBRARIES})
+#
+# add_test(AllTestsInFoo foo)
+#
+#-----------------------
+#
+# If you would like each Google test to show up in CTest as
+# a test you may use the following macro.
+# NOTE: It will slow down your tests by running an executable
+# for each test and test fixture. You will also have to rerun
+# CMake after adding or removing tests or test fixtures.
+#
+# GTEST_ADD_TESTS(executable extra_args ARGN)
+# executable = The path to the test executable
+# extra_args = Pass a list of extra arguments to be passed to
+# executable enclosed in quotes (or "" for none)
+# ARGN = A list of source files to search for tests & test
+# fixtures.
+#
+# Example:
+# set(FooTestArgs --foo 1 --bar 2)
+# add_executable(FooTest FooUnitTest.cc)
+# GTEST_ADD_TESTS(FooTest "${FooTestArgs}" FooUnitTest.cc)
+
+#=============================================================================
+# Copyright 2009 Kitware, Inc.
+# Copyright 2009 Philip Lowman <philip@yhbt.com>
+# Copyright 2009 Daniel Blezek <blezek@gmail.com>
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+# License text for the above reference.)
+#
+# Thanks to Daniel Blezek <blezek@gmail.com> for the GTEST_ADD_TESTS code
+
+function(GTEST_ADD_TESTS executable extra_args)
+ if(NOT ARGN)
+ message(FATAL_ERROR "Missing ARGN: Read the documentation for GTEST_ADD_TESTS")
+ endif()
+ foreach(source ${ARGN})
+ file(READ "${source}" contents)
+ string(REGEX MATCHALL "TEST_?F?\\(([A-Za-z_0-9 ,]+)\\)" found_tests ${contents})
+ foreach(hit ${found_tests})
+ string(REGEX REPLACE ".*\\( *([A-Za-z_0-9]+), *([A-Za-z_0-9]+) *\\).*" "\\1.\\2" test_name ${hit})
+ add_test(${test_name} ${executable} --gtest_filter=${test_name} ${extra_args})
+ endforeach()
+ endforeach()
+endfunction()
+
+function(_gtest_append_debugs _endvar _library)
+ if(${_library} AND ${_library}_DEBUG)
+ set(_output optimized ${${_library}} debug ${${_library}_DEBUG})
+ else()
+ set(_output ${${_library}})
+ endif()
+ set(${_endvar} ${_output} PARENT_SCOPE)
+endfunction()
+
+function(_gtest_find_library _name)
+ find_library(${_name}
+ NAMES ${ARGN}
+ HINTS
+ $ENV{GTEST_ROOT}
+ ${GTEST_ROOT}
+ PATH_SUFFIXES ${_gtest_libpath_suffixes}
+ )
+ mark_as_advanced(${_name})
+endfunction()
+
+#
+
+if(NOT DEFINED GTEST_MSVC_SEARCH)
+ set(GTEST_MSVC_SEARCH MD)
+endif()
+
+set(_gtest_libpath_suffixes lib)
+if(MSVC)
+ if(GTEST_MSVC_SEARCH STREQUAL "MD")
+ list(APPEND _gtest_libpath_suffixes
+ msvc/gtest-md/Debug
+ msvc/gtest-md/Release)
+ elseif(GTEST_MSVC_SEARCH STREQUAL "MT")
+ list(APPEND _gtest_libpath_suffixes
+ msvc/gtest/Debug
+ msvc/gtest/Release)
+ endif()
+endif()
+
+
+find_path(GTEST_INCLUDE_DIR gtest/gtest.h
+ HINTS
+ $ENV{GTEST_ROOT}/include
+ ${GTEST_ROOT}/include
+)
+mark_as_advanced(GTEST_INCLUDE_DIR)
+
+if(MSVC AND GTEST_MSVC_SEARCH STREQUAL "MD")
+ # The provided /MD project files for Google Test add -md suffixes to the
+ # library names.
+ _gtest_find_library(GTEST_LIBRARY gtest-md gtest)
+ _gtest_find_library(GTEST_LIBRARY_DEBUG gtest-mdd gtestd)
+ _gtest_find_library(GTEST_MAIN_LIBRARY gtest_main-md gtest_main)
+ _gtest_find_library(GTEST_MAIN_LIBRARY_DEBUG gtest_main-mdd gtest_maind)
+else()
+ _gtest_find_library(GTEST_LIBRARY gtest)
+ _gtest_find_library(GTEST_LIBRARY_DEBUG gtestd)
+ _gtest_find_library(GTEST_MAIN_LIBRARY gtest_main)
+ _gtest_find_library(GTEST_MAIN_LIBRARY_DEBUG gtest_maind)
+endif()
+
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(GTest DEFAULT_MSG GTEST_LIBRARY GTEST_INCLUDE_DIR GTEST_MAIN_LIBRARY)
+
+if(GTEST_FOUND)
+ set(GTEST_INCLUDE_DIRS ${GTEST_INCLUDE_DIR})
+ _gtest_append_debugs(GTEST_LIBRARIES GTEST_LIBRARY)
+ _gtest_append_debugs(GTEST_MAIN_LIBRARIES GTEST_MAIN_LIBRARY)
+ set(GTEST_BOTH_LIBRARIES ${GTEST_LIBRARIES} ${GTEST_MAIN_LIBRARIES})
+endif()
+
View
260 cmake/FindPackageHandleStandardArgs.cmake
@@ -0,0 +1,260 @@
+# FIND_PACKAGE_HANDLE_STANDARD_ARGS(<name> ... )
+#
+# This function is intended to be used in FindXXX.cmake modules files.
+# It handles the REQUIRED, QUIET and version-related arguments to FIND_PACKAGE().
+# It also sets the <UPPERCASED_NAME>_FOUND variable.
+# The package is considered found if all variables <var1>... listed contain
+# valid results, e.g. valid filepaths.
+#
+# There are two modes of this function. The first argument in both modes is
+# the name of the Find-module where it is called (in original casing).
+#
+# The first simple mode looks like this:
+# FIND_PACKAGE_HANDLE_STANDARD_ARGS(<name> (DEFAULT_MSG|"Custom failure message") <var1>...<varN> )
+# If the variables <var1> to <varN> are all valid, then <UPPERCASED_NAME>_FOUND
+# will be set to TRUE.
+# If DEFAULT_MSG is given as second argument, then the function will generate
+# itself useful success and error messages. You can also supply a custom error message
+# for the failure case. This is not recommended.
+#
+# The second mode is more powerful and also supports version checking:
+# FIND_PACKAGE_HANDLE_STANDARD_ARGS(NAME [REQUIRED_VARS <var1>...<varN>]
+# [VERSION_VAR <versionvar>
+# [CONFIG_MODE]
+# [FAIL_MESSAGE "Custom failure message"] )
+#
+# As above, if <var1> through <varN> are all valid, <UPPERCASED_NAME>_FOUND
+# will be set to TRUE.
+# After REQUIRED_VARS the variables which are required for this package are listed.
+# Following VERSION_VAR the name of the variable can be specified which holds
+# the version of the package which has been found. If this is done, this version
+# will be checked against the (potentially) specified required version used
+# in the find_package() call. The EXACT keyword is also handled. The default
+# messages include information about the required version and the version
+# which has been actually found, both if the version is ok or not.
+# Use the option CONFIG_MODE if your FindXXX.cmake module is a wrapper for
+# a find_package(... NO_MODULE) call, in this case all the information
+# provided by the config-mode of find_package() will be evaluated
+# automatically.
+# Via FAIL_MESSAGE a custom failure message can be specified, if this is not
+# used, the default message will be displayed.
+#
+# Example for mode 1:
+#
+# FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXml2 DEFAULT_MSG LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR)
+#
+# LibXml2 is considered to be found, if both LIBXML2_LIBRARY and
+# LIBXML2_INCLUDE_DIR are valid. Then also LIBXML2_FOUND is set to TRUE.
+# If it is not found and REQUIRED was used, it fails with FATAL_ERROR,
+# independent whether QUIET was used or not.
+# If it is found, success will be reported, including the content of <var1>.
+# On repeated Cmake runs, the same message won't be printed again.
+#
+# Example for mode 2:
+#
+# FIND_PACKAGE_HANDLE_STANDARD_ARGS(BISON REQUIRED_VARS BISON_EXECUTABLE
+# VERSION_VAR BISON_VERSION)
+# In this case, BISON is considered to be found if the variable(s) listed
+# after REQUIRED_VAR are all valid, i.e. BISON_EXECUTABLE in this case.
+# Also the version of BISON will be checked by using the version contained
+# in BISON_VERSION.
+# Since no FAIL_MESSAGE is given, the default messages will be printed.
+#
+# Another example for mode 2:
+#
+# FIND_PACKAGE(Automoc4 QUIET NO_MODULE HINTS /opt/automoc4)
+# FIND_PACKAGE_HANDLE_STANDARD_ARGS(Automoc4 CONFIG_MODE)
+# In this case, FindAutmoc4.cmake wraps a call to FIND_PACKAGE(Automoc4 NO_MODULE)
+# and adds an additional search directory for automoc4.
+# The following FIND_PACKAGE_HANDLE_STANDARD_ARGS() call produces a proper
+# success/error message.
+
+#=============================================================================
+# Copyright 2007-2009 Kitware, Inc.
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+INCLUDE(FindPackageMessage)
+INCLUDE(CMakeParseArguments)
+
+# internal helper macro
+MACRO(_FPHSA_FAILURE_MESSAGE _msg)
+ IF (${_NAME}_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "${_msg}")
+ ELSE (${_NAME}_FIND_REQUIRED)
+ IF (NOT ${_NAME}_FIND_QUIETLY)
+ MESSAGE(STATUS "${_msg}")
+ ENDIF (NOT ${_NAME}_FIND_QUIETLY)
+ ENDIF (${_NAME}_FIND_REQUIRED)
+ENDMACRO(_FPHSA_FAILURE_MESSAGE _msg)
+
+
+# internal helper macro to generate the failure message when used in CONFIG_MODE:
+MACRO(_FPHSA_HANDLE_FAILURE_CONFIG_MODE)
+ # <name>_CONFIG is set, but FOUND is false, this means that some other of the REQUIRED_VARS was not found:
+ IF(${_NAME}_CONFIG)
+ _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: missing: ${MISSING_VARS} (found ${${_NAME}_CONFIG} ${VERSION_MSG})")
+ ELSE(${_NAME}_CONFIG)
+ # If _CONSIDERED_CONFIGS is set, the config-file has been found, but no suitable version.
+ # List them all in the error message:
+ IF(${_NAME}_CONSIDERED_CONFIGS)
+ SET(configsText "")
+ LIST(LENGTH ${_NAME}_CONSIDERED_CONFIGS configsCount)
+ MATH(EXPR configsCount "${configsCount} - 1")
+ FOREACH(currentConfigIndex RANGE ${configsCount})
+ LIST(GET ${_NAME}_CONSIDERED_CONFIGS ${currentConfigIndex} filename)
+ LIST(GET ${_NAME}_CONSIDERED_VERSIONS ${currentConfigIndex} version)
+ SET(configsText "${configsText} ${filename} (version ${version})\n")
+ ENDFOREACH(currentConfigIndex)
+ _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE} ${VERSION_MSG}, checked the following files:\n${configsText}")
+
+ ELSE(${_NAME}_CONSIDERED_CONFIGS)
+ # Simple case: No Config-file was found at all:
+ _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: found neither ${_NAME}Config.cmake nor ${_NAME_LOWER}-config.cmake ${VERSION_MSG}")
+ ENDIF(${_NAME}_CONSIDERED_CONFIGS)
+ ENDIF(${_NAME}_CONFIG)
+ENDMACRO(_FPHSA_HANDLE_FAILURE_CONFIG_MODE)
+
+
+FUNCTION(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG)
+
+# set up the arguments for CMAKE_PARSE_ARGUMENTS and check whether we are in
+# new extended or in the "old" mode:
+ SET(options CONFIG_MODE)
+ SET(oneValueArgs FAIL_MESSAGE VERSION_VAR)
+ SET(multiValueArgs REQUIRED_VARS)
+ SET(_KEYWORDS_FOR_EXTENDED_MODE ${options} ${oneValueArgs} ${multiValueArgs} )
+ LIST(FIND _KEYWORDS_FOR_EXTENDED_MODE "${_FIRST_ARG}" INDEX)
+
+ IF(${INDEX} EQUAL -1)
+ SET(FPHSA_FAIL_MESSAGE ${_FIRST_ARG})
+ SET(FPHSA_REQUIRED_VARS ${ARGN})
+ SET(FPHSA_VERSION_VAR)
+ ELSE(${INDEX} EQUAL -1)
+
+ CMAKE_PARSE_ARGUMENTS(FPHSA "${options}" "${oneValueArgs}" "${multiValueArgs}" ${_FIRST_ARG} ${ARGN})
+
+ IF(FPHSA_UNPARSED_ARGUMENTS)
+ MESSAGE(FATAL_ERROR "Unknown keywords given to FIND_PACKAGE_HANDLE_STANDARD_ARGS(): \"${FPHSA_UNPARSED_ARGUMENTS}\"")
+ ENDIF(FPHSA_UNPARSED_ARGUMENTS)
+
+ IF(NOT FPHSA_FAIL_MESSAGE)
+ SET(FPHSA_FAIL_MESSAGE "DEFAULT_MSG")
+ ENDIF(NOT FPHSA_FAIL_MESSAGE)
+ ENDIF(${INDEX} EQUAL -1)
+
+# now that we collected all arguments, process them
+
+ IF("${FPHSA_FAIL_MESSAGE}" STREQUAL "DEFAULT_MSG")
+ SET(FPHSA_FAIL_MESSAGE "Could NOT find ${_NAME}")
+ ENDIF("${FPHSA_FAIL_MESSAGE}" STREQUAL "DEFAULT_MSG")
+
+ # In config-mode, we rely on the variable <package>_CONFIG, which is set by find_package()
+ # when it successfully found the config-file, including version checking:
+ IF(FPHSA_CONFIG_MODE)
+ LIST(INSERT FPHSA_REQUIRED_VARS 0 ${_NAME}_CONFIG)
+ LIST(REMOVE_DUPLICATES FPHSA_REQUIRED_VARS)
+ SET(FPHSA_VERSION_VAR ${_NAME}_VERSION)
+ ENDIF(FPHSA_CONFIG_MODE)
+
+ IF(NOT FPHSA_REQUIRED_VARS)
+ MESSAGE(FATAL_ERROR "No REQUIRED_VARS specified for FIND_PACKAGE_HANDLE_STANDARD_ARGS()")
+ ENDIF(NOT FPHSA_REQUIRED_VARS)
+
+ LIST(GET FPHSA_REQUIRED_VARS 0 _FIRST_REQUIRED_VAR)
+
+ STRING(TOUPPER ${_NAME} _NAME_UPPER)
+ STRING(TOLOWER ${_NAME} _NAME_LOWER)
+
+ # collect all variables which were not found, so they can be printed, so the
+ # user knows better what went wrong (#6375)
+ SET(MISSING_VARS "")
+ SET(DETAILS "")
+ SET(${_NAME_UPPER}_FOUND TRUE)
+ # check if all passed variables are valid
+ FOREACH(_CURRENT_VAR ${FPHSA_REQUIRED_VARS})
+ IF(NOT ${_CURRENT_VAR})
+ SET(${_NAME_UPPER}_FOUND FALSE)
+ SET(MISSING_VARS "${MISSING_VARS} ${_CURRENT_VAR}")
+ ELSE(NOT ${_CURRENT_VAR})
+ SET(DETAILS "${DETAILS}[${${_CURRENT_VAR}}]")
+ ENDIF(NOT ${_CURRENT_VAR})
+ ENDFOREACH(_CURRENT_VAR)
+
+
+ # version handling:
+ SET(VERSION_MSG "")
+ SET(VERSION_OK TRUE)
+ SET(VERSION ${${FPHSA_VERSION_VAR}} )
+ IF (${_NAME}_FIND_VERSION)
+
+ IF(VERSION)
+
+ IF(${_NAME}_FIND_VERSION_EXACT) # exact version required
+ IF (NOT "${${_NAME}_FIND_VERSION}" VERSION_EQUAL "${VERSION}")
+ SET(VERSION_MSG "Found unsuitable version \"${VERSION}\", but required is exact version \"${${_NAME}_FIND_VERSION}\"")
+ SET(VERSION_OK FALSE)
+ ELSE (NOT "${${_NAME}_FIND_VERSION}" VERSION_EQUAL "${VERSION}")
+ SET(VERSION_MSG "(found suitable exact version \"${VERSION}\")")
+ ENDIF (NOT "${${_NAME}_FIND_VERSION}" VERSION_EQUAL "${VERSION}")
+
+ ELSE(${_NAME}_FIND_VERSION_EXACT) # minimum version specified:
+ IF ("${${_NAME}_FIND_VERSION}" VERSION_GREATER "${VERSION}")
+ SET(VERSION_MSG "Found unsuitable version \"${VERSION}\", but required is at least \"${${_NAME}_FIND_VERSION}\"")
+ SET(VERSION_OK FALSE)
+ ELSE ("${${_NAME}_FIND_VERSION}" VERSION_GREATER "${VERSION}")
+ SET(VERSION_MSG "(found suitable version \"${VERSION}\", required is \"${${_NAME}_FIND_VERSION}\")")
+ ENDIF ("${${_NAME}_FIND_VERSION}" VERSION_GREATER "${VERSION}")
+ ENDIF(${_NAME}_FIND_VERSION_EXACT)
+
+ ELSE(VERSION)
+
+ # if the package was not found, but a version was given, add that to the output:
+ IF(${_NAME}_FIND_VERSION_EXACT)
+ SET(VERSION_MSG "(Required is exact version \"${${_NAME}_FIND_VERSION}\")")
+ ELSE(${_NAME}_FIND_VERSION_EXACT)
+ SET(VERSION_MSG "(Required is at least version \"${${_NAME}_FIND_VERSION}\")")
+ ENDIF(${_NAME}_FIND_VERSION_EXACT)
+
+ ENDIF(VERSION)
+ ELSE (${_NAME}_FIND_VERSION)
+ IF(VERSION)
+ SET(VERSION_MSG "(found version \"${VERSION}\")")
+ ENDIF(VERSION)
+ ENDIF (${_NAME}_FIND_VERSION)
+
+ IF(VERSION_OK)
+ SET(DETAILS "${DETAILS}[v${VERSION}(${${_NAME}_FIND_VERSION})]")
+ ELSE(VERSION_OK)
+ SET(${_NAME_UPPER}_FOUND FALSE)
+ ENDIF(VERSION_OK)
+
+
+ # print the result:
+ IF (${_NAME_UPPER}_FOUND)
+ FIND_PACKAGE_MESSAGE(${_NAME} "Found ${_NAME}: ${${_FIRST_REQUIRED_VAR}} ${VERSION_MSG}" "${DETAILS}")
+ ELSE (${_NAME_UPPER}_FOUND)
+
+ IF(FPHSA_CONFIG_MODE)
+ _FPHSA_HANDLE_FAILURE_CONFIG_MODE()
+ ELSE(FPHSA_CONFIG_MODE)
+ IF(NOT VERSION_OK)
+ _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: ${VERSION_MSG} (found ${${_FIRST_REQUIRED_VAR}})")
+ ELSE(NOT VERSION_OK)
+ _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE} (missing: ${MISSING_VARS}) ${VERSION_MSG}")
+ ENDIF(NOT VERSION_OK)
+ ENDIF(FPHSA_CONFIG_MODE)
+
+ ENDIF (${_NAME_UPPER}_FOUND)
+
+ SET(${_NAME_UPPER}_FOUND ${${_NAME_UPPER}_FOUND} PARENT_SCOPE)
+
+ENDFUNCTION(FIND_PACKAGE_HANDLE_STANDARD_ARGS _FIRST_ARG)
View
100 cmake/FindStereoPipeline.cmake
@@ -0,0 +1,100 @@
+# Find Stereo Pipeline
+#
+# == Using Header-Only libraries from within Stereo Pipeline: ==
+#
+# find_package( StereoPipeline 2.0 )
+# if(StereoPipeline_FOUND)
+# include_directories(${StereoPipeline_INCLUDE_DIRS})
+# add_executable(foo foo.cc)
+# endif()
+#
+# == Using actual libraries from within StereoPipeline: ==
+#
+# find_package( StereoPipeline 2.0 COMPONENTS core isisio ... )
+#
+# if(StereoPipeline_FOUND)
+# include_directories(${StereoPipeline_INCLUDE_DIRS})
+# add_executable(foo foo.cc)
+# target_link_libraries(foo ${StereoPipeline_LIBRARIES})
+# endif()
+#
+# ===========================================================
+#
+# Copyright (c) 2010 Zachary Moratto
+#
+# Redistribution AND use is allowed according to the terms
+# of the NEW BSD license.
+#
+
+# This macro must define:
+# StereoPipeline_FOUND < Conditional
+# StereoPipeline_INCLUDE_DIR < Paths
+# StereoPipeline_LIBRARIES < Paths as well
+
+# Find Path
+
+
+
+find_path(StereoPipeline_DIR
+ NAMES include/asp/Core.h
+ lib/libaspCore.dylib
+ HINTS ${StereoPipeline_INCLUDE_DIR}
+)
+
+find_path(StereoPipeline_INCLUDE_DIR
+ NAMES asp/Core.h
+ HINTS ${StereoPipeline_DIR}
+ PATH_SUFFIXES include
+)
+
+# Searching for each library that makes up a component
+foreach(COMPONENT ${StereoPipeline_FIND_COMPONENTS})
+ string(TOUPPER ${COMPONENT} UPPERCOMPONENT)
+ set( StereoPipeline_${UPPERCOMPONENT}_LIBRARY "StereoPipeline_${UPPERCOMPONENT}_LIBRARY-NOTFOUND")
+
+ string(REGEX REPLACE "^(.)(.+)$" "\\1" first_half "${UPPERCOMPONENT}")
+ string(REGEX REPLACE "^(.)(.+)$" "\\2" second_half "${COMPONENT}")
+
+ set(LIBRARY_NAME "${first_half}${second_half}")
+ if ( ${UPPERCOMPONENT} STREQUAL "ISISIO" )
+ set(LIBRARY_NAME "IsisIO")
+ elseif( ${UPPERCOMPONENT} STREQUAL "PHOTOMETRYTK" )
+ set(LIBRARY_NAME "PhotometryTK")
+ endif()
+
+ find_library( StereoPipeline_${UPPERCOMPONENT}_LIBRARY
+ NAMES asp${LIBRARY_NAME}
+ HINTS ${StereoPipeline_DIR}
+ PATH_SUFFIXES lib lib64
+ )
+
+ if(StereoPipeline_${UPPERCOMPONENT}_LIBRARY)
+ set(StereoPipeline_${UPPERCOMPONENT}_FOUND TRUE CACHE INTERNAL "If the ASP ${UPPERCOMPONENT} library was found")
+ endif()
+
+endforeach(COMPONENT)
+
+# Deciding if ASP was found
+set(StereoPipeline_INCLUDE_DIRS ${StereoPipeline_INCLUDE_DIR})
+
+if(StereoPipeline_INCLUDE_DIR)
+ set(StereoPipeline_FOUND TRUE)
+else(StereoPipeline_INCLUDE_DIR)
+ set(StereoPipeline_FOUND FALSE)
+endif(StereoPipeline_INCLUDE_DIR)
+
+# Closing Messages
+if(StereoPipeline_FOUND)
+ message(STATUS "Found the following StereoPipeline libraries:")
+ foreach( COMPONENT ${StereoPipeline_FIND_COMPONENTS})
+ string(TOUPPER ${COMPONENT} UPPERCOMPONENT )
+ if ( StereoPipeline_${UPPERCOMPONENT}_FOUND )
+ message(STATUS " ${COMPONENT}")
+ set(StereoPipeline_LIBRARIES ${StereoPipeline_LIBRARIES} ${StereoPipeline_${UPPERCOMPONENT}_LIBRARY})
+ endif()
+ endforeach()
+else(StereoPipeline_FOUND)
+ message(WARNING "Unable to find requested StereoPipeline libraries")
+endif(StereoPipeline_FOUND)
+
+
View
135 cmake/FindVisionWorkbench.cmake
@@ -0,0 +1,135 @@
+# Find Vision Workbench
+#
+# Copyright (c) 2009-2011 Zachary Moratto
+# Large parts of this work we're inspired by FindBoost
+#
+# Redistribution AND use is allowed according to the terms
+# of the NEW BSD license.
+#
+# == Using Header-Only libraries from within Vision Workbench: ==
+#
+# find_package( VisionWorkbench )
+# if(VISIONWORKBENCH_FOUND)
+# include_directories(${VISIONWORKBENCH_INCLUDE_DIRS})
+# add_executable(foo foo.cc)
+# endif()
+#
+# == Using actual libraries from within Vision Workbench: ==
+#
+# find_package( VisionWorkbench COMPONENTS core image fileio camera ... )
+#
+# if(VISIONWORKBENCH_FOUND)
+# include_directories(${VISIONWORKBENCH_INCLUDE_DIRS})
+# add_executable(foo foo.cc)
+# target_link_libraries(foo ${VISIONWORKBENCH_LIBRARIES})
+# endif()
+#
+# ===========================================================
+#
+# Variables used by this module, they can change the default behaviour and
+# need to be set before calling find_package:
+#
+# VISIONWORKBENCH_USE_STATIC_LIBS Can be set to ON to force the use of the
+# static libraries. Default is OFF.
+#
+# VISIONWORKBENCH_ROOT The preferred installation prefix for searching
+# for Vision Workbench.
+#
+# ===========================================================
+#
+# Variables defined by this module:
+#
+# VISIONWORKBENCH_FOUND System has Vision Workbench with options requested
+#
+# VISIONWORKBENCH_INCLUDE_DIRS Vision Workbench include directories
+#
+# VISIONWORKBENCH_LIBRARIES Link to these to use the Vision Workbench libraries
+#
+# VISIONWORKBENCH_LIBRARY_DIRS The path to where the Vison Workbench library files are.
+#
+# For each component you specify in find_package(), the folloing (UPPER-CASE)
+# variables are set. You can use these variables if you would like to pick and
+# choose components for your targets instead of just using VISIONWORKBENCH_LIBRARIES
+#
+# VISIONWORKBENCH_${COMPONENT}_FOUND True if the Vision Workbench "component" was found
+#
+# VISIONWORKBENCH_${COMPONENT}_LIBRARY Contains the libraries for the specified
+# VisionWorkbench "component".
+
+find_path(VISIONWORKBENCH_INCLUDE_DIR
+ NAMES vw/vw.h
+ HINTS $ENV{VISIONWORKBENCH_ROOT}
+ ${VISIONWORKBENCH_ROOT}
+ $ENV{HOME}/projects/VisionWorkbench
+ PATH_SUFFIXES include
+)
+
+# Check if we are only looking for static
+if(VISIONWORKBENCH_USE_STATIC_LIBS)
+ if(WIN32)
+ set(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
+ else(WIN32)
+ set(CMAKE_FIND_LIBRARY_SUFFIXES .a)
+ endif(WIN32)
+endif(VISIONWORKBENCH_USE_STATIC_LIBS)
+
+# Searching for each library that makes up a component
+foreach(COMPONENT ${VisionWorkbench_FIND_COMPONENTS})
+ string(TOUPPER ${COMPONENT} UPPERCOMPONENT)
+ set( VISIONWORKBENCH_${UPPERCOMPONENT}_LIBRARY "VISIONWORKBENCH_${UPPERCOMPONENT}_LIBRARY-NOTFOUND"
+ CACHE FILEPATH "The VisionWorkbench ${COMPONENT} library")
+
+ string(REGEX REPLACE "^(.)(.+)$" "\\1" first_half "${UPPERCOMPONENT}")
+ string(REGEX REPLACE "^(.)(.+)$" "\\2" second_half "${COMPONENT}")
+
+ set(LIBRARY_NAME "${first_half}${second_half}")
+ if ( ${UPPERCOMPONENT} STREQUAL "VW" )
+ set(LIBRARY_NAME "")
+ elseif( ${UPPERCOMPONENT} STREQUAL "INTERESTPOINT" )
+ set(LIBRARY_NAME "InterestPoint")
+ elseif( ${UPPERCOMPONENT} STREQUAL "HDR" )
+ set(LIBRARY_NAME "HDR")
+ elseif( ${UPPERCOMPONENT} STREQUAL "FILEIO")
+ set(LIBRARY_NAME "FileIO")
+ elseif( ${UPPERCOMPONENT} STREQUAL "BUNDLEADJUSTMENT")
+ set(LIBRARY_NAME "BundleAdjustment")
+ endif()
+
+ find_library( VISIONWORKBENCH_${UPPERCOMPONENT}_LIBRARY
+ NAMES vw${LIBRARY_NAME}
+ HINTS ${VISIONWORKBENCH_INCLUDE_DIR}/..
+ ${VISIONWORKBENCH_ROOT}
+ $ENV{VISIONWORKBENCH_ROOT}
+ $ENV{HOME}/projects/VisionWorkbench
+ PATH_SUFFIXES lib lib64
+ )
+ mark_as_advanced( VISIONWORKBENCH_${UPPERCOMPONENT}_LIBRARY )
+
+ if(VISIONWORKBENCH_${UPPERCOMPONENT}_LIBRARY)
+ set(VISIONWORKBENCH_${UPPERCOMPONENT}_FOUND TRUE CACHE INTERNAL "If the VW ${UPPERCOMPONENT} library was found")
+ endif()
+
+endforeach(COMPONENT)
+
+# Deciding if VW was found
+set(VISIONWORKBENCH_INCLUDE_DIRS ${VISIONWORKBENCH_INCLUDE_DIR})
+
+if(VISIONWORKBENCH_INCLUDE_DIR)
+ set(VISIONWORKBENCH_FOUND TRUE)
+else(VISIONWORKBENCH_INCLUDE_DIR)
+ set(VISIONWORKBENCH_FOUND FALSE)
+endif(VISIONWORKBENCH_INCLUDE_DIR)
+
+# Closing Messages
+if(VISIONWORKBENCH_FOUND)
+ message(STATUS "Found the following VisionWorkbench libraries:")
+ foreach( COMPONENT ${VisionWorkbench_FIND_COMPONENTS})
+ string(TOUPPER ${COMPONENT} UPPERCOMPONENT )
+ if ( VISIONWORKBENCH_${UPPERCOMPONENT}_FOUND )
+ message(STATUS " ${COMPONENT}")
+ set(VISIONWORKBENCH_LIBRARIES ${VISIONWORKBENCH_LIBRARIES} ${VISIONWORKBENCH_${UPPERCOMPONENT}_LIBRARY})
+ endif()
+ endforeach()
+else(VISIONWORKBENCH_FOUND)
+ message(SEND_ERROR "Unable to find requested VisionWorkbench libraries")
+endif(VISIONWORKBENCH_FOUND)
View
30 src/photk/CMakeLists.txt
@@ -0,0 +1,30 @@
+include_directories(${VISIONWORKBENCH_INCLUDE_DIRS})
+include_directories(${Boost_INCLUDE_DIRS})
+
+include_directories(${CMAKE_CURRENT_BINARY_DIR}/..)
+PROTOBUF_GENERATE_CPP(
+ PROTO_SRCS
+ PROTO_HDRS
+ ProjectFile.proto
+ )
+
+add_library(PhotometryTK
+ ProjectService.cc
+ RemoteProjectFile.cc
+ ${PROTO_SRCS}
+ )
+
+install(FILES
+ ${PROTO_HDRS}
+ AlbedoAccumulators.h
+ Common.h
+ ErrorAccumulators.h
+ ImageAccumulators.h
+ Macros.h
+ ProjectFileIO.h
+ ProjectService.h
+ RecursiveBBoxAccumulator.h
+ RemoteProjectFile.h
+ TimeAccumulators.h
+ DESTINATION include/photk
+ )
View
94 src/photk/Makefile.am
@@ -1,94 +0,0 @@
-# __BEGIN_LICENSE__
-# Copyright (C) 2006-2011 United States Government as represented by
-# the Administrator of the National Aeronautics and Space Administration.
-# All Rights Reserved.
-# __END_LICENSE__
-
-
-#########################################################################
-# sources
-#########################################################################
-
-if MAKE_MODULE_PHOTOMETRYTK
-
-protocol_headers = ProjectFile.pb.h
-protocol_sources = ProjectFile.pb.cc
-
-BUILT_SOURCES = $(protocol_sources)
-nodist_include_HEADERS = $(protocol_headers)
-
-include_HEADERS = ProjectFileIO.h ProjectService.h RemoteProjectFile.h \
- AlbedoAccumulators.h ImageAccumulators.h \
- ErrorAccumulators.h TimeAccumulators.h \
- RecursiveBBoxAccumulator.h
-libaspPhotometryTK_la_SOURCES = $(protocol_sources) ProjectService.cc \
- RemoteProjectFile.cc
-
-libaspPhotometryTK_la_LIBADD = @MODULE_PHOTOMETRYTK_LIBS@
-lib_LTLIBRARIES = libaspPhotometryTK.la
-
-if ENABLE_EXCEPTIONS
-
-PTK_LOCAL_LIBS = @MODULE_PHOTOMETRYTK_LIBS@ libaspPhotometryTK.la
-
-phodrg2plate_SOURCES = phodrg2plate.cc
-phodrg2plate_LDADD = $(PTK_LOCAL_LIBS)
-
-phoinitfile_SOURCES = phoinitfile.cc
-phoinitfile_LDADD = $(PTK_LOCAL_LIBS)
-
-phoinitet_SOURCES = phoinitet.cc
-phoinitet_LDADD = $(PTK_LOCAL_LIBS)
-
-phoitalbedo_SOURCES = phoitalbedo.cc
-phoitalbedo_LDADD = $(PTK_LOCAL_LIBS)
-
-phoitdem_SOURCES = phoitdem.cc
-phoitdem_LDADD = $(PTK_LOCAL_LIBS)
-
-phoiterror_SOURCES = phoiterror.cc
-phoiterror_LDADD = $(PTK_LOCAL_LIBS)
-
-phoitreflect_SOURCES = phoitreflect.cc
-phoitreflect_LDADD = $(PTK_LOCAL_LIBS)
-
-phoittime_SOURCES = phoittime.cc
-phoittime_LDADD = $(PTK_LOCAL_LIBS)
-
-ptk_server_SOURCES = ptk_server.cc
-ptk_server_LDADD = $(PTK_LOCAL_LIBS)
-
-mipmap_SOURCES = mipmap.cc
-mipmap_LDADD = $(PTK_LOCAL_LIBS)
-
-shadow_mask_SOURCES = shadow_mask.cc
-shadow_mask_LDADD = $(PTK_LOCAL_LIBS)
-
-phoitnorm_SOURCES = phoitnorm.cc
-phoitnorm_LDADD = $(PTK_LOCAL_LIBS)
-
-bin_PROGRAMS = phodrg2plate phoinitfile phoitalbedo \
- phoitdem phoiterror phoitreflect phoittime \
- ptk_server phoinitet mipmap shadow_mask phoitnorm
-
-endif
-
-
-endif
-
-#########################################################################
-# general
-#########################################################################
-
-AM_CPPFLAGS = @ASP_CPPFLAGS@
-AM_LDFLAGS = @ASP_LDFLAGS@
-
-bin_SCRIPTS = phoinit.py phosolve.py pmipmap.py
-
-SUBDIRS = . tests
-CLEANFILES = $(protocol_headers) $(protocol_sources)
-
-includedir = $(prefix)/include/asp/PhotometryTK
-
-include $(top_srcdir)/config/rules.mak
-include $(top_srcdir)/thirdparty/protobuf.mak
View
5 src/photk/config.h.in
@@ -0,0 +1,5 @@
+// the configure options for PhotometryTK
+#define PHOTK_VERSION "@PACKAGE_VERSION@"
+#define PHOTK_PACKAGE_NAME "@PACKAGE_NAME@"
+#define PHOTK_PACKAGE_STRING "@PACKAGE_STRING@"
+#define PHOTK_PACKAGE_BUGREPORT "@PACKAGE_BUGREPORT@"
View
55 src/tools/CMakeLists.txt
@@ -0,0 +1,55 @@
+include_directories(${VISIONWORKBENCH_INCLUDE_DIRS})
+include_directories(${Boost_INCLUDE_DIRS})
+
+# Getting generated files
+include_directories(${CMAKE_CURRENT_BINARY_DIR}/..)
+
+# Reusable Vision Workbench Patterns
+set(VISIONWORKBENCH_BASE_LIBRARIES
+ ${VISIONWORKBENCH_CORE_LIBRARY}
+ ${VISIONWORKBENCH_MATH_LIBRARY}
+ ${VISIONWORKBENCH_IMAGE_LIBRARY}
+ ${VISIONWORKBENCH_FILEIO_LIBRARY}
+ )
+set(VISIONWORKBENCH_BASE_PLATE_LIBRARIES
+ ${VISIONWORKBENCH_BASE_LIBRARIES}
+ ${VISIONWORKBENCH_PLATE_LIBRARY}
+ )
+
+# Executables
+set(PHOTK_USED_LIBS ${VISIONWORKBENCH_BASE_PLATE_LIBRARIES} ${Boost_PROGRAM_OPTIONS_LIBRARY})
+add_photk_tool(mipmap
+ mipmap.cc)
+
+set(PHOTK_USED_LIBS PhotometryTK ${VISIONWORKBENCH_BASE_PLATE_LIBRARIES} ${VISIONWORKBENCH_CARTOGRAPHY_LIBRARY} ${PROTOBUF_LIBRARIES} ${Boost_LIBRARIES})
+add_photk_tool(phodrg2plate
+ phodrg2plate.cc)
+add_photk_tool(phoinitet
+ phoinitet.cc)
+add_photk_tool(phoinitfile
+ phoinitfile.cc)
+add_photk_tool(phoitalbedo
+ phoitalbedo.cc)
+add_photk_tool(phoitdem
+ phoitdem.cc)
+add_photk_tool(phoiterror
+ phoiterror.cc)
+add_photk_tool(phoitnorm
+ phoitnorm.cc)
+add_photk_tool(phoitreflect
+ phoitreflect.cc)
+add_photk_tool(phoittime
+ phoittime.cc)
+
+set(PHOTK_USED_LIBS PhotometryTK ${PROTOBUF_LIBRARIES} ${VISIONWORKBENCH_BASE_PLATE_LIBRARIES} ${Boost_LIBRARIES})
+add_photk_tool(ptk_server
+ ptk_server.cc)
+
+set(PHOTK_USED_LIBS ${VISIONWORKBENCH_BASE_LIBRARIES} ${VISIONWORKBENCH_CARTOGRAPHY_LIBRARY} ${Boost_LIBRARIES} )
+add_photk_tool(shadow_mask
+ shadow_mask.cc)
+
+# Scripts
+install( FILES phoinit.py phosolve.py pmipmap.py
+ PERMISSIONS GROUP_EXECUTE OWNER_EXECUTE OWNER_READ GROUP_READ
+ DESTINATION bin )
View
98 thirdparty/gtest/CHANGES
@@ -0,0 +1,98 @@
+Changes for 1.5.0:
+
+ * New feature: assertions can be safely called in multiple threads
+ where the pthreads library is available.
+ * New feature: predicates used inside EXPECT_TRUE() and friends
+ can now generate custom failure messages.
+ * New feature: Google Test can now be compiled as a DLL.
+ * New feature: fused source files are included.
+ * New feature: prints help when encountering unrecognized Google Test flags.
+ * Experimental feature: CMake build script (requires CMake 2.6.4+).
+ * Experimental feature: the Pump script for meta programming.
+ * double values streamed to an assertion are printed with enough precision
+ to differentiate any two different values.
+ * Google Test now works on Solaris and AIX.
+ * Build and test script improvements.
+ * Bug fixes and implementation clean-ups.
+
+ Potentially breaking changes:
+
+ * Stopped supporting VC++ 7.1 with exceptions disabled.
+ * Dropped support for 'make install'.
+
+Changes for 1.4.0:
+
+ * New feature: the event listener API
+ * New feature: test shuffling
+ * New feature: the XML report format is closer to junitreport and can
+ be parsed by Hudson now.
+ * New feature: when a test runs under Visual Studio, its failures are
+ integrated in the IDE.
+ * New feature: /MD(d) versions of VC++ projects.
+ * New feature: elapsed time for the tests is printed by default.
+ * New feature: comes with a TR1 tuple implementation such that Boost
+ is no longer needed for Combine().
+ * New feature: EXPECT_DEATH_IF_SUPPORTED macro and friends.
+ * New feature: the Xcode project can now produce static gtest
+ libraries in addition to a framework.
+ * Compatibility fixes for Solaris, Cygwin, minGW, Windows Mobile,
+ Symbian, gcc, and C++Builder.
+ * Bug fixes and implementation clean-ups.
+
+Changes for 1.3.0:
+
+ * New feature: death tests on Windows, Cygwin, and Mac.
+ * New feature: ability to use Google Test assertions in other testing
+ frameworks.
+ * New feature: ability to run disabled test via
+ --gtest_also_run_disabled_tests.
+ * New feature: the --help flag for printing the usage.
+ * New feature: access to Google Test flag values in user code.
+ * New feature: a script that packs Google Test into one .h and one
+ .cc file for easy deployment.
+ * New feature: support for distributing test functions to multiple
+ machines (requires support from the test runner).
+ * Bug fixes and implementation clean-ups.
+
+Changes for 1.2.1:
+
+ * Compatibility fixes for Linux IA-64 and IBM z/OS.
+ * Added support for using Boost and other TR1 implementations.
+ * Changes to the build scripts to support upcoming release of Google C++
+ Mocking Framework.
+ * Added Makefile to the distribution package.
+ * Improved build instructions in README.
+
+Changes for 1.2.0:
+
+ * New feature: value-parameterized tests.
+ * New feature: the ASSERT/EXPECT_(NON)FATAL_FAILURE(_ON_ALL_THREADS)
+ macros.
+ * Changed the XML report format to match JUnit/Ant's.
+ * Added tests to the Xcode project.
+ * Added scons/SConscript for building with SCons.
+ * Added src/gtest-all.cc for building Google Test from a single file.
+ * Fixed compatibility with Solaris and z/OS.
+ * Enabled running Python tests on systems with python 2.3 installed,
+ e.g. Mac OS X 10.4.
+ * Bug fixes.
+
+Changes for 1.1.0:
+
+ * New feature: type-parameterized tests.
+ * New feature: exception assertions.
+ * New feature: printing elapsed time of tests.
+ * Improved the robustness of death tests.
+ * Added an Xcode project and samples.
+ * Adjusted the output format on Windows to be understandable by Visual Studio.
+ * Minor bug fixes.
+
+Changes for 1.0.1:
+
+ * Added project files for Visual Studio 7.1.
+ * Fixed issues with compiling on Mac OS X.
+ * Fixed issues with compiling on Cygwin.
+
+Changes for 1.0.0:
+
+ * Initial Open Source release of Google Test
View
36 thirdparty/gtest/CONTRIBUTORS
@@ -0,0 +1,36 @@
+# This file contains a list of people who've made non-trivial
+# contribution to the Google C++ Testing Framework project. People
+# who commit code to the project are encouraged to add their names
+# here. Please keep the list sorted by first names.
+
+Ajay Joshi <jaj@google.com>
+Balázs Dán <balazs.dan@gmail.com>
+Bharat Mediratta <bharat@menalto.com>
+Chandler Carruth <chandlerc@google.com>
+Chris Prince <cprince@google.com>
+Chris Taylor <taylorc@google.com>
+Dan Egnor <egnor@google.com>
+Eric Roman <eroman@chromium.org>
+Hady Zalek <hady.zalek@gmail.com>
+Jeffrey Yasskin <jyasskin@google.com>
+Jói Sigurðsson <joi@google.com>
+Keir Mierle <mierle@gmail.com>
+Keith Ray <keith.ray@gmail.com>
+Kenton Varda <kenton@google.com>
+Manuel Klimek <klimek@google.com>
+Markus Heule <markus.heule@gmail.com>
+Mika Raento <mikie@iki.fi>
+Miklós Fazekas <mfazekas@szemafor.com>
+Patrick Hanna <phanna@google.com>
+Patrick Riley <pfr@google.com>
+Peter Kaminski <piotrk@google.com>
+Preston Jackson <preston.a.jackson@gmail.com>
+Rainer Klaffenboeck <rainer.klaffenboeck@dynatrace.com>
+Russ Cox <rsc@google.com>
+Russ Rufer <russ@pentad.com>
+Sean Mcafee <eefacm@gmail.com>
+Sigurður Ásgeirsson <siggi@google.com>
+Tracy Bialik <tracy@pentad.com>
+Vadim Berman <vadimb@google.com>
+Vlad Losev <vladl@google.com>
+Zhanyong Wan <wan@google.com>
View
28 thirdparty/gtest/COPYING
@@ -0,0 +1,28 @@
+Copyright 2008, Google Inc.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+ * Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+copyright notice, this list of conditions and the following disclaimer
+in the documentation and/or other materials provided with the
+distribution.
+ * Neither the name of Google Inc. nor the names of its
+contributors may be used to endorse or promote products derived from
+this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
View
417 thirdparty/gtest/README
@@ -0,0 +1,417 @@
+Google C++ Testing Framework
+============================
+
+http://code.google.com/p/googletest/
+
+Overview
+--------
+
+Google's framework for writing C++ tests on a variety of platforms
+(Linux, Mac OS X, Windows, Windows CE, Symbian, etc). Based on the
+xUnit architecture. Supports automatic test discovery, a rich set of
+assertions, user-defined assertions, death tests, fatal and non-fatal
+failures, various options for running the tests, and XML test report
+generation.
+
+Please see the project page above for more information as well as the
+mailing list for questions, discussions, and development. There is
+also an IRC channel on OFTC (irc.oftc.net) #gtest available. Please
+join us!
+
+Requirements for End Users
+--------------------------
+
+Google Test is designed to have fairly minimal requirements to build
+and use with your projects, but there are some. Currently, we support
+Linux, Windows, Mac OS X, and Cygwin. We will also make our best
+effort to support other platforms (e.g. Solaris, AIX, and z/OS).
+However, since core members of the Google Test project have no access
+to these platforms, Google Test may have outstanding issues there. If
+you notice any problems on your platform, please notify
+googletestframework@googlegroups.com. Patches for fixing them are
+even more welcome!
+
+### Linux Requirements ###
+
+These are the base requirements to build and use Google Test from a source
+package (as described below):
+ * GNU-compatible Make or gmake
+ * POSIX-standard shell
+ * POSIX(-2) Regular Expressions (regex.h)
+ * A C++98-standard-compliant compiler
+
+### Windows Requirements ###
+
+ * Microsoft Visual C++ 7.1 or newer
+
+### Cygwin Requirements ###
+
+ * Cygwin 1.5.25-14 or newer
+
+### Mac OS X Requirements ###
+
+ * Mac OS X 10.4 Tiger or newer
+ * Developer Tools Installed
+
+Also, you'll need CMake 2.6.4 or higher if you want to build the
+samples using the provided CMake script, regardless of the platform.
+
+Requirements for Contributors
+-----------------------------
+
+We welcome patches. If you plan to contribute a patch, you need to
+build Google Test and its own tests from an SVN checkout (described
+below), which has further requirements:
+
+ * Python version 2.3 or newer (for running some of the tests and
+ re-generating certain source files from templates)
+ * CMake 2.6.4 or newer
+
+Getting the Source
+------------------
+
+There are two primary ways of getting Google Test's source code: you
+can download a stable source release in your preferred archive format,
+or directly check out the source from our Subversion (SVN) repositary.
+The SVN checkout requires a few extra steps and some extra software
+packages on your system, but lets you track the latest development and
+make patches much more easily, so we highly encourage it.
+
+### Source Package ###
+
+Google Test is released in versioned source packages which can be
+downloaded from the download page [1]. Several different archive
+formats are provided, but the only difference is the tools used to
+manipulate them, and the size of the resulting file. Download
+whichever you are most comfortable with.
+
+ [1] http://code.google.com/p/googletest/downloads/list
+
+Once the package is downloaded, expand it using whichever tools you
+prefer for that type. This will result in a new directory with the
+name "gtest-X.Y.Z" which contains all of the source code. Here are
+some examples on Linux:
+
+ tar -xvzf gtest-X.Y.Z.tar.gz
+ tar -xvjf gtest-X.Y.Z.tar.bz2
+ unzip gtest-X.Y.Z.zip
+
+### SVN Checkout ###
+
+To check out the main branch (also known as the "trunk") of Google
+Test, run the following Subversion command:
+
+ svn checkout http://googletest.googlecode.com/svn/trunk/ gtest-svn
+
+Setting up the Build
+--------------------
+
+To build Google Test and your tests that use it, you need to tell your
+build system where to find its headers and source files. The exact
+way to do it depends on which build system you use, and is usually
+straightforward.
+
+### Generic Build Instructions ###
+
+Suppose you put Google Test in directory ${GTEST_DIR}. To build it,
+create a library build target (or a project as called by Visual Studio
+and Xcode) to compile
+
+ ${GTEST_DIR}/src/gtest-all.cc
+
+with
+
+ ${GTEST_DIR}/include and ${GTEST_DIR}
+
+in the header search path. Assuming a Linux-like system and gcc,
+something like the following will do:
+
+ g++ -I${GTEST_DIR}/include -I${GTEST_DIR} -c ${GTEST_DIR}/src/gtest-all.cc
+ ar -rv libgtest.a gtest-all.o
+
+Next, you should compile your test source file with
+${GTEST_DIR}/include in the header search path, and link it with gtest
+and any other necessary libraries:
+
+ g++ -I${GTEST_DIR}/include path/to/your_test.cc libgtest.a -o your_test
+
+As an example, the make/ directory contains a Makefile that you can
+use to build Google Test on systems where GNU make is available
+(e.g. Linux, Mac OS X, and Cygwin). It doesn't try to build Google
+Test's own tests. Instead, it just builds the Google Test library and
+a sample test. You can use it as a starting point for your own build
+script.
+
+If the default settings are correct for your environment, the
+following commands should succeed:
+
+ cd ${GTEST_DIR}/make
+ make
+ ./sample1_unittest
+
+If you see errors, try to tweak the contents of make/Makefile to make
+them go away. There are instructions in make/Makefile on how to do
+it.
+
+### Using CMake ###
+
+Google Test comes with a CMake build script (CMakeLists.txt) that can
+be used on a wide range of platforms ("C" stands for cross-platofrm.).
+If you don't have CMake installed already, you can download it for
+free from http://www.cmake.org/.
+
+CMake works by generating native makefiles or build projects that can
+be used in the compiler environment of your choice. The typical
+workflow starts with:
+
+ mkdir mybuild # Create a directory to hold the build output.
+ cd mybuild
+ cmake ${GTEST_DIR} # Generate native build scripts.
+
+If you want to build Google Test's samples, you should replace the
+last command with
+
+ cmake -Dbuild_gtest_samples=ON ${GTEST_DIR}
+
+If you are on a *nix system, you should now see a Makefile in the
+current directory. Just type 'make' to build gtest.
+
+If you use Windows and have Vistual Studio installed, a gtest.sln file
+and several .vcproj files will be created. You can then build them
+using Visual Studio.
+
+On Mac OS X with Xcode installed, a .xcodeproj file will be generated.
+
+### Legacy Build Scripts ###
+
+Before settling on CMake, we have been providing hand-maintained build
+projects/scripts for Visual Studio, Xcode, and Autotools. While we
+continue to provide them for convenience, they are not actively
+maintained any more. We highly recommend that you follow the
+instructions in the previous two sections to integrate Google Test
+with your existing build system.
+
+If you still need to use the legacy build scripts, here's how:
+
+The msvc\ folder contains two solutions with Visual C++ projects.
+Open the gtest.sln or gtest-md.sln file using Visual Studio, and you
+are ready to build Google Test the same way you build any Visual
+Studio project. Files that have names ending with -md use DLL
+versions of Microsoft runtime libraries (the /MD or the /MDd compiler
+option). Files without that suffix use static versions of the runtime
+libraries (the /MT or the /MTd option). Please note that one must use
+the same option to compile both gtest and the test code. If you use
+Visual Studio 2005 or above, we recommend the -md version as /MD is
+the default for new projects in these versions of Visual Studio.
+
+On Mac OS X, open the gtest.xcodeproj in the xcode/ folder using
+Xcode. Build the "gtest" target. The universal binary framework will
+end up in your selected build directory (selected in the Xcode
+"Preferences..." -> "Building" pane and defaults to xcode/build).
+Alternatively, at the command line, enter:
+
+ xcodebuild
+
+This will build the "Release" configuration of gtest.framework in your
+default build location. See the "xcodebuild" man page for more
+information about building different configurations and building in
+different locations.
+
+Tweaking Google Test
+--------------------
+
+Google Test can be used in diverse environments. The default
+configuration may not work (or may not work well) out of the box in
+some environments. However, you can easily tweak Google Test by
+defining control macros on the compiler command line. Generally,
+these macros are named like GTEST_XYZ and you define them to either 1
+or 0 to enable or disable a certain feature.
+
+We list the most frequently used macros below. For a complete list,
+see file include/gtest/internal/gtest-port.h.
+
+### Choosing a TR1 Tuple Library ###
+
+Some Google Test features require the C++ Technical Report 1 (TR1)
+tuple library, which is not yet available with all compilers. The
+good news is that Google Test implements a subset of TR1 tuple that's
+enough for its own need, and will automatically use this when the
+compiler doesn't provide TR1 tuple.
+
+Usually you don't need to care about which tuple library Google Test
+uses. However, if your project already uses TR1 tuple, you need to
+tell Google Test to use the same TR1 tuple library the rest of your
+project uses, or the two tuple implementations will clash. To do
+that, add
+
+ -DGTEST_USE_OWN_TR1_TUPLE=0
+
+to the compiler flags while compiling Google Test and your tests. If
+you want to force Google Test to use its own tuple library, just add
+
+ -DGTEST_USE_OWN_TR1_TUPLE=1
+
+to the compiler flags instead.
+
+If you don't want Google Test to use tuple at all, add
+
+ -DGTEST_HAS_TR1_TUPLE=0
+
+and all features using tuple will be disabled.
+
+### Multi-threaded Tests ###
+
+Google Test is thread-safe where the pthread library is available.
+After #include <gtest/gtest.h>, you can check the GTEST_IS_THREADSAFE
+macro to see whether this is the case (yes if the macro is #defined to
+1, no if it's undefined.).
+
+If Google Test doesn't correctly detect whether pthread is available
+in your environment, you can force it with
+
+ -DGTEST_HAS_PTHREAD=1
+
+or
+
+ -DGTEST_HAS_PTHREAD=0
+
+When Google Test uses pthread, you may need to add flags to your
+compiler and/or linker to select the pthread library, or you'll get
+link errors. If you use the CMake script or the deprecated Autotools
+script, this is taken care of for you. If you use your own build
+script, you'll need to read your compiler and linker's manual to
+figure out what flags to add.
+
+### As a Shared Library (DLL) ###
+
+Google Test is compact, so most users can build and link it as a
+static library for the simplicity. You can choose to use Google Test
+as a shared library (known as a DLL on Windows) if you prefer.
+
+To compile gtest as a shared library, add
+
+ -DGTEST_CREATE_SHARED_LIBRARY=1
+
+to the compiler flags. You'll also need to tell the linker to produce
+a shared library instead - consult your linker's manual for how to do
+it.
+
+To compile your tests that use the gtest shared library, add
+
+ -DGTEST_LINKED_AS_SHARED_LIBRARY=1
+
+to the compiler flags.
+
+### Avoiding Macro Name Clashes ###
+
+In C++, macros don't obey namespaces. Therefore two libraries that
+both define a macro of the same name will clash if you #include both
+definitions. In case a Google Test macro clashes with another
+library, you can force Google Test to rename its macro to avoid the
+conflict.
+
+Specifically, if both Google Test and some other code define macro
+FOO, you can add
+
+ -DGTEST_DONT_DEFINE_FOO=1
+
+to the compiler flags to tell Google Test to change the macro's name
+from FOO to GTEST_FOO. Currently FOO can be FAIL, SUCCEED, or TEST.
+For example, with -DGTEST_DONT_DEFINE_TEST=1, you'll need to write
+
+ GTEST_TEST(SomeTest, DoesThis) { ... }
+
+instead of
+
+ TEST(SomeTest, DoesThis) { ... }
+
+in order to define a test.
+
+Upgrating from an Earlier Version
+---------------------------------
+
+We strive to keep Google Test releases backward compatible.
+Sometimes, though, we have to make some breaking changes for the
+users' long-term benefits. This section describes what you'll need to
+do if you are upgrading from an earlier version of Google Test.
+
+### Upgrading from 1.3.0 or Earlier ###
+
+You may need to explicitly enable or disable Google Test's own TR1
+tuple library. See the instructions in section "Choosing a TR1 Tuple
+Library".
+
+### Upgrading from 1.4.0 or Earlier ###
+
+The Autotools build script (configure + make) is no longer officially
+supportted. You are encouraged to migrate to your own build system or
+use CMake. If you still need to use Autotools, you can find
+instructions in the README file from Google Test 1.4.0.
+
+On platforms where the pthread library is available, Google Test uses
+it in order to be thread-safe. See the "Multi-threaded Tests" section
+for what this means to your build script.
+
+If you use Microsoft Visual C++ 7.1 with exceptions disabled, Google
+Test will no longer compile. This should affect very few people, as a
+large portion of STL (including <string>) doesn't compile in this mode
+anyway. We decided to stop supporting it in order to greatly simplify
+Google Test's implementation.
+
+Developing Google Test
+----------------------
+
+This section discusses how to make your own changes to Google Test.
+
+### Testing Google Test Itself ###
+
+To make sure your changes work as intended and don't break existing
+functionality, you'll want to compile and run Google Test's own tests.
+For that you can use CMake:
+
+ mkdir mybuild
+ cd mybuild
+ cmake -Dbuild_all_gtest_tests=ON ${GTEST_DIR}
+
+Make sure you have Python installed, as some of Google Test's tests
+are written in Python. If the cmake command complains about not being
+able to find Python ("Could NOT find PythonInterp (missing:
+PYTHON_EXECUTABLE)"), try telling it explicitly where your Python
+executable can be found:
+
+ cmake -DPYTHON_EXECUTABLE=path/to/python -Dbuild_all_gtest_tests=ON \
+ ${GTEST_DIR}
+
+Next, you can build Google Test and all of its own tests. On *nix,
+this is usually done by 'make'. To run the tests, do
+
+ make test
+
+All tests should pass.
+
+### Regenerating Source Files ###
+
+Some of Google Test's source files are generated from templates (not
+in the C++ sense) using a script. A template file is named FOO.pump,
+where FOO is the name of the file it will generate. For example, the
+file include/gtest/internal/gtest-type-util.h.pump is used to generate
+gtest-type-util.h in the same directory.
+
+Normally you don't need to worry about regenerating the source files,
+unless you need to modify them. In that case, you should modify the
+corresponding .pump files instead and run the pump.py Python script to
+regenerate them. You can find pump.py in the scripts/ directory.
+Read the Pump manual [2] for how to use it.
+
+ [2] http://code.google.com/p/googletest/wiki/PumpManual
+
+### Contributing a Patch ###
+
+We welcome patches. Please read the Google Test developer's guide [3]
+for how you can contribute. In particular, make sure you have signed
+the Contributor License Agreement, or we won't be able to accept the
+patch.
+
+ [3] http://code.google.com/p/googletest/wiki/GoogleTestDevGuide
+
+Happy testing!
View
18,014 thirdparty/gtest/include/gtest/gtest.h
18,014 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
8,517 thirdparty/gtest/src/gtest-all.cc
8,517 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
46 thirdparty/gtest/src/gtest_main.cc
@@ -0,0 +1,46 @@
+// __BEGIN_LICENSE__
+// Copyright (C) 2006-2011 United States Government as represented by
+// the Administrator of the National Aeronautics and Space Administration.
+// All Rights Reserved.
+// __END_LICENSE__
+
+
+// Copyright 2006, Google Inc.
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the
+// distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived from
+// this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#include <iostream>
+
+#include <gtest/gtest.h>
+
+int main(int argc, char **argv) {
+ std::cout << "Running main() from gtest_main.cc\n";
+
+ testing::InitGoogleTest(&argc, argv);
+ return RUN_ALL_TESTS();
+}

0 comments on commit 829a876

Please sign in to comment.