Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Matthew Johnson-Roberson
committed
Feb 7, 2008
1 parent
aa515f6
commit 2deea00
Showing
4 changed files
with
377 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,273 @@ | ||
# | ||
# libpolyp | ||
# | ||
# Dependencies: | ||
# * boost | ||
# * lapack | ||
# * OpenCV | ||
# * OpenGL | ||
# * ulapack | ||
# * libplankton | ||
# * libsnapper | ||
# * libpolyp | ||
# * gts | ||
PROJECT(libpolyp) | ||
|
||
INCLUDE( ${CMAKE_ROOT}/Modules/CheckIncludeFileCXX.cmake ) | ||
INCLUDE( ${CMAKE_ROOT}/Modules/CheckLibraryExists.cmake ) | ||
INCLUDE( ${CMAKE_ROOT}/Modules/UsePkgConfig.cmake ) | ||
INCLUDE( FindOSG.cmake ) | ||
|
||
#--------------------------------# | ||
# Enforce an out-of-source build # | ||
#--------------------------------# | ||
|
||
STRING(COMPARE EQUAL "${PROJECT_SOURCE_DIR}" "${PROJECT_BINARY_DIR}" INSOURCE) | ||
IF(INSOURCE) | ||
MESSAGE(FATAL_ERROR "This project requires an out of source build. This is handled by the Makefile. Please type 'make'.") | ||
ENDIF(INSOURCE) | ||
|
||
|
||
#--------------------------------# | ||
# Build Options # | ||
#--------------------------------# | ||
|
||
# Options can be set from the command line when running cmake. | ||
# eg. cmake . -DCMAKE_BUILD_TYPE=Release -DDEBUG_PROFILING=on | ||
|
||
|
||
# Build types are: Release, Debug, RelWithDebInfo, MinSizeRel | ||
IF( NOT CMAKE_BUILD_TYPE ) | ||
SET( CMAKE_BUILD_TYPE Release ) | ||
ENDIF( NOT CMAKE_BUILD_TYPE ) | ||
|
||
OPTION( USE_LIBKEYPOINT | ||
"Use the libkeypoint feature extraction library." | ||
ON ) | ||
|
||
IF( NOT LIBADT_PREFIX ) | ||
SET( LIBADT_PREFIX /usr/local ) | ||
ENDIF( NOT LIBADT_PREFIX ) | ||
|
||
IF( NOT LIBPOLYP_PREFIX ) | ||
SET( LIBPOLYP_PREFIX /usr/local ) | ||
ENDIF( NOT LIBPOLYP_PREFIX ) | ||
|
||
IF( NOT ULAPACK_PREFIX ) | ||
SET( ULAPACK_PREFIX /usr/local/ ) | ||
ENDIF( NOT ULAPACK_PREFIX ) | ||
|
||
IF( NOT LIBPLANKTON_PREFIX ) | ||
SET( LIBPLANKTON_PREFIX /usr/local/ ) | ||
ENDIF( NOT LIBPLANKTON_PREFIX ) | ||
|
||
IF( NOT LIBSNAPPER_PREFIX ) | ||
SET( LIBSNAPPER_PREFIX /usr/local/ ) | ||
ENDIF( NOT LIBSNAPPER_PREFIX ) | ||
|
||
IF( NOT LIBKEYPOINT_PREFIX ) | ||
SET( LIBKEYPOINT_PREFIX /usr/local/ ) | ||
ENDIF( NOT LIBKEYPOINT_PREFIX ) | ||
#-----------------------# | ||
# Installation Options # | ||
#-----------------------# | ||
|
||
IF( NOT CMAKE_INSTALL_PREFIX ) | ||
SET( CMAKE_INSTALL_PREFIX "/usr/local" ) | ||
ENDIF( NOT CMAKE_INSTALL_PREFIX ) | ||
|
||
|
||
#-----------------------# | ||
# Dependencies # | ||
#-----------------------# | ||
|
||
# Boost | ||
FIND_PACKAGE(Boost) | ||
IF( NOT Boost_FOUND ) | ||
MESSAGE( FATAL_ERROR "ERROR - Can't find boost" ) | ||
ENDIF( NOT Boost_FOUND ) | ||
|
||
# boost threads | ||
CHECK_INCLUDE_FILE_CXX( "boost/thread.hpp" HAVE_BOOST_THREAD ) | ||
IF( NOT HAVE_BOOST_THREAD ) | ||
MESSAGE( FATAL_ERROR "ERROR - Can't find boost threads" ) | ||
ENDIF( NOT HAVE_BOOST_THREAD ) | ||
SET( BOOST_THREAD_LIBRARY boost_thread ) | ||
|
||
# OpenGL and GLU | ||
FIND_PACKAGE( OpenGL ) | ||
IF( NOT OPENGL_FOUND ) | ||
MESSAGE( FATAL_ERROR "ERROR - Can't find OpenGL" ) | ||
ENDIF( NOT OPENGL_FOUND ) | ||
IF( NOT OPENGL_GLU_FOUND ) | ||
MESSAGE( FATAL_ERROR "ERROR - Can't find GLU" ) | ||
ENDIF( NOT OPENGL_GLU_FOUND ) | ||
|
||
|
||
IF( NOT OSG_FOUND ) | ||
MESSAGE( FATAL_ERROR "ERROR - Can't find OSG" ) | ||
ENDIF( NOT OSG_FOUND ) | ||
|
||
# lapack | ||
SET( LAPACK_LIB lapack ) | ||
|
||
# This check seems to fail when using ccache? | ||
#CHECK_LIBRARY_EXISTS( lapack dpotrf_ " " HAVE_LAPACK ) | ||
#IF( NOT HAVE_LAPACK ) | ||
# MESSAGE( FATAL_ERROR "ERROR - Can't find lapack" ) | ||
#ENDIF( NOT HAVE_LAPACK ) | ||
|
||
|
||
# OpenCV | ||
PKGCONFIG("opencv" OPENCV_INCLUDE_DIR OPENCV_LINK_DIR OPENCV_LINK_FLAGS OPENCV_CFLAGS ) | ||
IF( NOT OPENCV_INCLUDE_DIR ) | ||
MESSAGE( FATAL_ERROR "ERROR - Can't find OpenCV" ) | ||
ENDIF( NOT OPENCV_INCLUDE_DIR ) | ||
# Strict aliasing causes lots of warnings with OpenCV and g++-4.1 | ||
ADD_DEFINITIONS( "-fno-strict-aliasing" ) | ||
|
||
# Gts | ||
PKGCONFIG("gts" GTS_INCLUDE_DIR GTS_LINK_DIR GTS_LINK_FLAGS GTS_CFLAGS ) | ||
IF( NOT GTS_INCLUDE_DIR ) | ||
MESSAGE( FATAL_ERROR "ERROR - Can't find Gts" ) | ||
ENDIF( NOT GTS_INCLUDE_DIR ) | ||
MESSAGE( ${GTS_INCLUDE_DIR} ) | ||
# ulapack | ||
SET( ULAPACK_INCLUDE_DIR ${ULAPACK_PREFIX}/include/ulapack ) | ||
CHECK_INCLUDE_FILE_CXX( "${ULAPACK_INCLUDE_DIR}/matrix_types.hpp" HAVE_ULAPACK ) | ||
IF( NOT HAVE_ULAPACK ) | ||
MESSAGE( FATAL_ERROR "ERROR - Can't find ulapack" ) | ||
ENDIF( NOT HAVE_ULAPACK ) | ||
|
||
|
||
# libplankton | ||
SET( LIBPLANKTON_INCLUDE_DIR ${LIBPLANKTON_PREFIX}/include/libplankton ) | ||
SET( LIBPLANKTON_LIB plankton ) | ||
CHECK_INCLUDE_FILE_CXX( "auv_matrix.hpp" HAVE_LIBPLANKTON "-I ${LIBPLANKTON_INCLUDE_DIR}" ) | ||
IF( NOT HAVE_LIBPLANKTON ) | ||
MESSAGE( FATAL_ERROR "ERROR - Can't find libplankton" ) | ||
ENDIF( NOT HAVE_LIBPLANKTON ) | ||
|
||
|
||
# libkeypoint | ||
IF( USE_LIBKEYPOINT ) | ||
SET( LIBKEYPOINT_INCLUDE_DIR ${LIBKEYPOINT_PREFIX}/include/libkeypoint ) | ||
SET( LIBKEYPOINT_LIB keypoint surf ) | ||
ADD_DEFINITIONS( "-DHAVE_LIBKEYPOINT" ) | ||
|
||
SET( CMAKE_REQUIRED_FLAGS "-I ${OPENCV_INCLUDE_DIR} ${OPENCV_LINK_FLAGS}" ) | ||
CHECK_INCLUDE_FILE_CXX( "keypoint.hpp" HAVE_LIBKEYPOINT "-I ${LIBKEYPOINT_INCLUDE_DIR}" ) | ||
IF( NOT HAVE_LIBKEYPOINT ) | ||
MESSAGE( FATAL_ERROR "ERROR - Can't find libkeypoint" ) | ||
ENDIF( NOT HAVE_LIBKEYPOINT ) | ||
ENDIF( USE_LIBKEYPOINT ) | ||
# libsnapper | ||
SET( LIBSNAPPER_INC ${LIBSNAPPER_PREFIX}/include/libsnapper ) | ||
SET( LIBSNAPPER_LIBRARY snapper ) | ||
|
||
# libpolyp | ||
SET( LIBPOLYP_INC ${LIBPOLYP_PREFIX}/include/libpolyp ) | ||
SET( LIBPOLYP_LIBRARY polyp ) | ||
|
||
# AUV data library | ||
SET( LIBADT_INCLUDE_DIR ${LIBADT_PREFIX}/include/libadt ) | ||
SET( LIBADT_LIBRARY adt ) | ||
|
||
#-----------------------# | ||
# Compiler setup # | ||
#-----------------------# | ||
ADD_DEFINITIONS( ${GTS_CFLAGS} ) | ||
ADD_DEFINITIONS( "-Wall" ) | ||
|
||
INCLUDE_DIRECTORIES( ${PROJECT_SOURCE_DIR}/include | ||
${OPENCV_INCLUDE_DIR} | ||
${OPENGL_INCLUDE_DIR} | ||
${GTS_INCLUDE_DIR} | ||
${ULAPACK_INCLUDE_DIR} | ||
${LIBADT_INCLUDE_DIR} | ||
${LIBSNAPPER_INC} | ||
${LIBPOLYP_INC} | ||
${LIBPLANKTON_INCLUDE_DIR} | ||
${LIBKEYPOINT_INCLUDE_DIR} | ||
${OSG_INCLUDE_DIR}) | ||
|
||
LINK_DIRECTORIES( ${OPENCV_LINK_DIR} ${GTS_LINK_DIR}) | ||
|
||
LINK_LIBRARIES( ${OPENCV_LINK_FLAGS} | ||
${LAPACK_LIB} | ||
${OPENGL_LIBRARIES} | ||
${ULAPACK_LIB} | ||
${BOOST_THREAD_LIBRARY} | ||
${GTS_LINK_FLAGS} | ||
${LIBADT_LIBRARY} | ||
${LIBSNAPPER_LIBRARY} | ||
${LIBPOLYP_LIBRARY} | ||
${LIBPLANKTON_LIB} | ||
${LIBKEYPOINT_LIB} | ||
${OSG_LIBRARY} | ||
${OSGUTIL_LIBRARY} | ||
${OSGDB_LIBRARY} -l3ds) | ||
|
||
|
||
#-----------------------# | ||
# Print Some Info # | ||
#-----------------------# | ||
|
||
MESSAGE( "" ) | ||
MESSAGE( "CONFIGURATION SUMMARY" ) | ||
MESSAGE( "---------------------" ) | ||
MESSAGE( "" ) | ||
MESSAGE( "CMAKE_BUILD_TYPE = '${CMAKE_BUILD_TYPE}'" ) | ||
MESSAGE( "" ) | ||
MESSAGE( "CMAKE_INSTALL_PREFIX = '${CMAKE_INSTALL_PREFIX}'" ) | ||
MESSAGE( "" ) | ||
MESSAGE( "USE_LIBKEYPOINT = '${USE_LIBKEYPOINT}'" ) | ||
MESSAGE( "" ) | ||
MESSAGE( "ULAPACK_PREFIX = '${ULAPACK_PREFIX}'" ) | ||
MESSAGE( "LIBPLANKTON_PREFIX = '${LIBPLANKTON_PREFIX}'" ) | ||
MESSAGE( "LIBKEYPOINT_PREFIX = '${LIBKEYPOINT_PREFIX}'" ) | ||
|
||
IF( CMAKE_BUILD_TYPE STREQUAL Debug ) | ||
MESSAGE( "CMAKE_CXX_FLAGS_DEBUG = '${CMAKE_CXX_FLAGS_DEBUG}'" ) | ||
ENDIF( CMAKE_BUILD_TYPE STREQUAL Debug ) | ||
|
||
IF( CMAKE_BUILD_TYPE STREQUAL RelWithDebInfo ) | ||
MESSAGE( "CMAKE_CXX_FLAGS_RELWITHDEBINFO = '${CMAKE_CXX_FLAGS_RELWITHDEBINFO}'" ) | ||
ENDIF( CMAKE_BUILD_TYPE STREQUAL RelWithDebInfo ) | ||
|
||
IF( CMAKE_BUILD_TYPE STREQUAL Release ) | ||
MESSAGE( "CMAKE_CXX_FLAGS_RELEASE = '${CMAKE_CXX_FLAGS_RELEASE}'" ) | ||
ENDIF( CMAKE_BUILD_TYPE STREQUAL Release ) | ||
|
||
IF( CMAKE_BUILD_TYPE STREQUAL MinSizeRel ) | ||
MESSAGE( "CMAKE_CXX_FLAGS_MINSIZEREL = '${CMAKE_CXX_FLAGS_MINSIZEREL}'" ) | ||
ENDIF( CMAKE_BUILD_TYPE STREQUAL MinSizeRel ) | ||
|
||
MESSAGE( "" ) | ||
|
||
#-----------------------# | ||
# Build Instructions # | ||
#-----------------------# | ||
|
||
# Locations for the library and binary files | ||
SET( LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib ) | ||
SET( EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin ) | ||
|
||
#SUBDIRS(src include tools ) | ||
|
||
SET( SRCS OSGExport.cpp | ||
PixelBufferCarbon.cpp | ||
GraphicsWindowCarbon.cpp | ||
auv_clipped_texture_atlas.cpp | ||
Depth.cpp | ||
auv_3ds.cpp | ||
) | ||
|
||
|
||
ADD_LIBRARY( ts STATIC ${SRCS} ) | ||
ADD_EXECUTABLE( threadedStereo threadedStereo.cpp ) | ||
ADD_EXECUTABLE( genTex genTex.cpp ) | ||
ADD_EXECUTABLE( lodgen lodgen.cpp ) | ||
TARGET_LINK_LIBRARIES( threadedStereo ts ) | ||
TARGET_LINK_LIBRARIES( genTex ts ) | ||
TARGET_LINK_LIBRARIES( lodgen ts ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# Locate gdal | ||
# This module defines | ||
# OSG_LIBRARY | ||
# OSG_FOUND, if false, do not try to link to gdal | ||
# OSG_INCLUDE_DIR, where to find the headers | ||
# | ||
# $OSG_DIR is an environment variable that would | ||
# correspond to the ./configure --prefix=$OSG_DIR | ||
# | ||
# Created by Robert Osfield. | ||
|
||
FIND_PATH(OSG_INCLUDE_DIR osg/Node | ||
$ENV{OSG_DIR}/include | ||
$ENV{OSG_DIR} | ||
$ENV{OSGDIR}/include | ||
$ENV{OSGDIR} | ||
$ENV{OSG_ROOT}/include | ||
~/Library/Frameworks | ||
/Library/Frameworks | ||
/usr/local/include | ||
/usr/include | ||
/sw/include # Fink | ||
/opt/local/include # DarwinPorts | ||
/opt/csw/include # Blastwave | ||
/opt/include | ||
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/include | ||
/usr/freeware/include | ||
) | ||
|
||
MACRO(FIND_OSG_LIBRARY MYLIBRARY MYLIBRARYNAME) | ||
|
||
FIND_LIBRARY(${MYLIBRARY} | ||
NAMES ${MYLIBRARYNAME} | ||
PATHS | ||
$ENV{OSG_DIR}/lib | ||
$ENV{OSG_DIR} | ||
$ENV{OSGDIR}/lib | ||
$ENV{OSGDIR} | ||
$ENV{OSG_ROOT}/lib | ||
~/Library/Frameworks | ||
/Library/Frameworks | ||
/usr/local/lib | ||
/usr/lib | ||
/sw/lib | ||
/opt/local/lib | ||
/opt/csw/lib | ||
/opt/lib | ||
[HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;OSG_ROOT]/lib | ||
/usr/freeware/lib64 | ||
) | ||
|
||
ENDMACRO(FIND_OSG_LIBRARY LIBRARY LIBRARYNAME) | ||
|
||
FIND_OSG_LIBRARY(OSG_LIBRARY osg) | ||
FIND_OSG_LIBRARY(OSGUTIL_LIBRARY osgUtil) | ||
FIND_OSG_LIBRARY(OSGDB_LIBRARY osgDB) | ||
FIND_OSG_LIBRARY(OSGTEXT_LIBRARY osgText) | ||
FIND_OSG_LIBRARY(OSGTERRAIN_LIBRARY osgTerrain) | ||
FIND_OSG_LIBRARY(OSGFX_LIBRARY osgFX) | ||
FIND_OSG_LIBRARY(OSGVIEWER_LIBRARY osgViewer) | ||
|
||
SET(OSG_FOUND "NO") | ||
IF(OSG_LIBRARY AND OSG_INCLUDE_DIR) | ||
SET(OSG_FOUND "YES") | ||
ENDIF(OSG_LIBRARY AND OSG_INCLUDE_DIR) |
Oops, something went wrong.