Commit b302936c authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum
Browse files

[CHANGE] tools directory in TransferCalc was an old copy and is deprectaed....

[CHANGE] tools directory in TransferCalc was an old copy and is deprectaed. Replaced by link that ensures use of the latest module specific tools.
parent fa86b77c
../MyOpenWalnutToolbox/tools
\ No newline at end of file
# - Find CxxTest
# Find the CxxTest suite and declare a helper macro for creating unit tests
# and integrating them with CTest.
# For more details on CxxTest see http://cxxtest.tigris.org
#
# INPUT Variables
#
# CXXTEST_USE_PYTHON
# If true, the CXXTEST_ADD_TEST macro will use
# the Python test generator instead of Perl.
#
# OUTPUT Variables
#
# CXXTEST_FOUND
# True if the CxxTest framework was found
# CXXTEST_INCLUDE_DIR
# Where to find the CxxTest include directory
# CXXTEST_PERL_TESTGEN_EXECUTABLE
# The perl-based test generator.
# CXXTEST_PYTHON_TESTGEN_EXECUTABLE
# The python-based test generator.
#
# MACROS for optional use by CMake users:
#
# CXXTEST_ADD_TEST(<test_name> <gen_source_file> <input_files_to_testgen...>)
# Creates a CxxTest runner and adds it to the CTest testing suite
# Parameters:
# test_name The name of the test
# gen_source_file The generated source filename to be generated by CxxTest
# input_files_to_testgen The list of header files containing the
# CxxTest::TestSuite's to be included in this runner
#
# #==============
# Example Usage:
#
# find_package(CxxTest)
# if(CXXTEST_FOUND)
# include_directories(${CXXTEST_INCLUDE_DIR})
# enable_testing()
#
# CXXTEST_ADD_TEST(unittest_foo foo_test.cc
# ${CMAKE_CURRENT_SOURCE_DIR}/foo_test.h other.cpp)
# target_link_libraries(unittest_foo foo) # as needed
# endif()
#
# This will (if CxxTest is found):
# 1. Invoke the testgen executable to autogenerate foo_test.cc in the
# binary tree from "foo_test.h" in the current source directory.
# 2. Create an executable and test called unittest_foo.
# 3. Link additionally against other.cpp
#
# #=============
# Example foo_test.h:
#
# #include <cxxtest/TestSuite.h>
#
# class MyTestSuite : public CxxTest::TestSuite
# {
# public:
# void testAddition( void )
# {
# TS_ASSERT( 1 + 1 > 1 );
# TS_ASSERT_EQUALS( 1 + 1, 2 );
# }
# };
#
#
# Version 1.2 (3/2/08)
# Included patch from Tyler Roscoe to have the perl & python binaries
# detected based on CXXTEST_INCLUDE_DIR
# Version 1.1 (2/9/08)
# Clarified example to illustrate need to call target_link_libraries()
# Changed commands to lowercase
# Added licensing info
# Version 1.0 (1/8/08)
# Fixed CXXTEST_INCLUDE_DIRS so it will work properly
# Eliminated superfluous CXXTEST_FOUND assignment
# Cleaned up and added more documentation
#
# FindCxxTest.cmake
# Copyright (c) 2008-2009
# Philip Lowman <philip@yhbt.com>
#
# Redistribution AND use is allowed according to the terms of the New
# BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
#=============================================================
# CXXTEST_ADD_TEST (public macro)
#=============================================================
macro( CXXTEST_ADD_TEST _cxxtest_testname _cxxtest_outfname _cxxtest_testsuite )
set(_cxxtest_real_outfname ${CMAKE_CURRENT_BINARY_DIR}/${_cxxtest_outfname})
if(CXXTEST_USE_PYTHON)
set(_cxxtest_executable ${CXXTEST_PYTHON_TESTGEN_EXECUTABLE})
else()
set(_cxxtest_executable ${CXXTEST_PERL_TESTGEN_EXECUTABLE})
endif()
add_custom_command(
OUTPUT ${_cxxtest_real_outfname}
DEPENDS ${_cxxtest_testsuite} ${ARGN}
COMMAND ${_cxxtest_executable}
--error-printer -o ${_cxxtest_real_outfname} ${_cxxtest_testsuite}
)
set_source_files_properties(${_cxxtest_real_outfname} PROPERTIES GENERATED true)
add_executable(${_cxxtest_testname} ${_cxxtest_real_outfname} ${ARGN})
if(CMAKE_RUNTIME_OUTPUT_DIRECTORY)
add_test(${_cxxtest_testname} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${_cxxtest_testname})
elseif(EXECUTABLE_OUTPUT_PATH)
add_test(${_cxxtest_testname} ${EXECUTABLE_OUTPUT_PATH}/${_cxxtest_testname})
else()
add_test(${_cxxtest_testname} ${CMAKE_CURRENT_BINARY_DIR}/${_cxxtest_testname})
endif()
endmacro(CXXTEST_ADD_TEST)
#=============================================================
# CXXTEST_ADD_TEST_FROM_LIST (public macro)
#=============================================================
#
# Usage:
# CXXTEST_ADD_TESTS_FROM_LIST( A, B, ... )
#
# 1. A is a list of cpp and/or h files where the class name is stripped of
# 2. then out of the class name the test targets and testsuite names are generated
# 3. finally they are linked with all libs present in parameter B
# 4. If there are more arguments (ARGN) then they are exclude from A before 1-3 starts)
#
FUNCTION( CXXTEST_ADD_TESTS_FROM_LIST _SourceList _TestLibs )
# remove unwanted tests
IF( ${ARGC} GREATER 2 )
FOREACH( fname ${ARGN} )
LIST( REMOVE_ITEM _SourceList ${CMAKE_CURRENT_SOURCE_DIR}/${fname} )
ENDFOREACH( fname )
ENDIF()
# extract class names from source files
FOREACH( _File ${_SourceList} )
STRING( REGEX REPLACE "^.*/" "" _StrippedPath "${_File}" )
STRING( REGEX REPLACE "\\..*$" "" _StrippedExtension "${_StrippedPath}" )
STRING( REGEX MATCH ".*\\.h" _IsHeader "${_File}" ) #Match Header Files
IF( NOT _IsHeader ) # Do not generate test for header files
LIST( APPEND _TestList ${_StrippedExtension} )
ENDIF()
ENDFOREACH( _File )
# generate for each class a unit test if there is a testsiute for it
FOREACH( _ClassName ${_TestList} )
SET( _TestName ${_ClassName}_test )
SET( _TestTarget unittest_${_ClassName} )
SET( _TestSuitePath "${CMAKE_CURRENT_SOURCE_DIR}/test/${_TestName}.h" )
# check if testsuite is present and generate code if true
IF( EXISTS ${_TestSuitePath} )
CXXTEST_ADD_TEST( ${_TestTarget}
${_TestName}.cc
${_TestSuitePath}
)
TARGET_LINK_LIBRARIES( ${_TestTarget} ${_TestLibs} )
ELSE()
MESSAGE( STATUS "WARNING: Skipping ${_ClassName}, no unit test available." )
ENDIF()
ENDFOREACH( _ClassName )
ENDFUNCTION( CXXTEST_ADD_TESTS_FROM_LIST )
#=============================================================
# main()
#=============================================================
find_path(CXXTEST_INCLUDE_DIR cxxtest/TestSuite.h)
find_program(CXXTEST_PERL_TESTGEN_EXECUTABLE cxxtestgen.pl
PATHS ${CXXTEST_INCLUDE_DIR})
find_program(CXXTEST_PYTHON_TESTGEN_EXECUTABLE cxxtestgen.py
PATHS ${CXXTEST_INCLUDE_DIR})
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(CxxTest DEFAULT_MSG CXXTEST_INCLUDE_DIR)
set(CXXTEST_INCLUDE_DIRS ${CXXTEST_INCLUDE_DIR})
# This script searches cl.h and cl.hpp (the C++ binding header). Grab these headers form http://www.khronos.org/registry/cl.
#
# The following variables will be filled:
# * OPENCL_FOUND - if cl.h, cl.hpp and OpenCL lib was found
# * OPENCL_INCLUDE_DIR - the path of cl.h if found
# * OPENCL_CPP_INCLUDE_DIR - the path of cl.hpp if found
# * OPENCL_LIBRARY - the path to the OpenCL library
#
FIND_PATH( OPENCL_INCLUDE_DIR CL/cl.h /usr/include /usr/local/include )
FIND_PATH( OPENCL_CPP_INCLUDE_DIR CL/cl.hpp /usr/include /usr/local/include )
FIND_LIBRARY( OPENCL_LIBRARY NAMES OpenCL PATH /usr/lib /usr/local/lib /usr/local/cuda/lib64 /usr/local/cuda/lib )
message( STATUS ${OPENCL_CPP_INCLUDE_DIR} )
SET( OPENCL_FOUND FALSE )
IF ( OPENCL_INCLUDE_DIR AND OPENCL_CPP_INCLUDE_DIR AND OPENCL_LIBRARY )
SET( OPENCL_FOUND TRUE )
ENDIF ( OPENCL_INCLUDE_DIR AND OPENCL_CPP_INCLUDE_DIR AND OPENCL_LIBRARY )
IF ( OPENCL_FOUND )
IF ( NOT OpenCL_FIND_QUIETLY )
MESSAGE( STATUS "Found OpenCL: ${OPENCL_LIBRARY} and include in ${OPENCL_INCLUDE_DIR}" )
ENDIF()
ELSE ( OPENCL_FOUND )
IF (OpenCL_FIND_REQUIRED)
MESSAGE( FATAL_ERROR "Could not find OpenCL. Install an up-to-date graphics driver and grab the OpenCL headers from http://www.khronos.org/registry/cl." )
ENDIF()
ENDIF ( OPENCL_FOUND )
# This script searches biosig. See http://biosig.sourceforge.net
#
# The following variables will be filled:
# * BIOSIG_FOUND - if header and lib was found
# * BIOSIG_INCLUDE_DIR - the path of header if found
# * BIOSIG_LIBRARY - the path to the library
#
FIND_PATH( BIOSIG_INCLUDE_DIR biosig.h /usr/include /usr/local/include )
# This hack is inspired by FindBoost.cmake. It ensures that only shared objects are found. Linking a SO with a static lib is not possible
# in Linux. On other systems, this should be no problem.
SET( _ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
IF( CMAKE_HOST_SYSTEM MATCHES "Linux" )
SET( CMAKE_FIND_LIBRARY_SUFFIXES .so )
ENDIF()
FIND_LIBRARY( BIOSIG_LIBRARY NAMES biosig PATH /usr/lib /usr/local/lib )
SET( CMAKE_FIND_LIBRARY_SUFFIXES ${_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES} )
SET( BIOSIG_FOUND FALSE )
IF( BIOSIG_INCLUDE_DIR AND BIOSIG_LIBRARY )
SET( BIOSIG_FOUND TRUE )
ENDIF()
IF( BIOSIG_FOUND )
IF( NOT biosig_FIND_QUIETLY )
MESSAGE( STATUS "Found biosig: ${BIOSIG_LIBRARY} and include in ${BIOSIG_INCLUDE_DIR}" )
ENDIF()
ELSE()
IF( biosig_FIND_REQUIRED )
MESSAGE( FATAL_ERROR "Could not find biosig." )
ENDIF()
ENDIF()
# This script searches eigen3. See http://eigen.tuxfamily.org
#
# The following variables will be filled:
# * EIGEN3_FOUND - if Eigen (header) was found
# * EIGEN3_INCLUDE_DIR - the path of Eigne header if found
#
# You can set the environment variable "EIGEN3_INCLUDE_DIR" to help this script finding it if
# you placed it in some unusual location.
FIND_PATH( EIGEN3_INCLUDE_DIR Eigen/Core $ENV{EIGEN3_INCLUDE_DIR}
$ENV{HOME}/.local/include/eigen3
/usr/include/eigen3
/usr/local/include/eigen3
/opt/local/include/eigen3
/sw/include/eigen3 )
SET( EIGEN3_FOUND FALSE )
IF( EIGEN3_INCLUDE_DIR )
SET( EIGEN3_FOUND TRUE )
ENDIF()
IF( EIGEN3_FOUND )
IF( NOT eigen3_FIND_QUIETLY )
MESSAGE( STATUS "Found eigen3: ${EIGEN3_INCLUDE_DIR}" )
ENDIF()
ELSE()
IF( eigen3_FIND_REQUIRED )
MESSAGE( FATAL_ERROR "Could not find eigen3. Check your distribution or download from http://eigen.tuxfamily.org" )
ENDIF()
ENDIF()
# This script searches niftilib. See http://niftilib.sourceforge.net
#
# The following variables will be filled:
# * NIFTILIB_FOUND - if nifti1.h and lib was found
# * NIFTILIB_INCLUDE_DIR - the path of nifti1.h if found
# * NIFTILIB_LIBRARY - the path to the library
#
FIND_PATH( NIFTILIB_INCLUDE_DIR nifti1.h /usr/include/nifti /usr/local/include/nifti )
# This hack is inspired by FindBoost.cmake. It ensures that only shared objects are found. Linking a SO with a static lib is not possible
# in Linux. On other systems, this should be no problem.
SET( _ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
IF( CMAKE_HOST_SYSTEM MATCHES "Linux" )
SET( CMAKE_FIND_LIBRARY_SUFFIXES .so )
ENDIF()
FIND_LIBRARY( NIFTILIB_LIBRARY NAMES niftiio PATH /usr/lib /usr/local/lib )
SET( CMAKE_FIND_LIBRARY_SUFFIXES ${_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES} )
SET( NIFTILIB_FOUND FALSE )
IF( NIFTILIB_INCLUDE_DIR AND NIFTILIB_LIBRARY )
SET( NIFTILIB_FOUND TRUE )
ENDIF()
IF( NIFTILIB_FOUND )
IF( NOT niftilib_FIND_QUIETLY )
MESSAGE( STATUS "Found niftilib: ${NIFTILIB_LIBRARY} and include in ${NIFTILIB_INCLUDE_DIR}" )
ENDIF()
ELSE()
IF( niftilib_FIND_REQUIRED )
MESSAGE( FATAL_ERROR "Could not find niftilib." )
ENDIF()
ENDIF()
#---------------------------------------------------------------------------
#
# Project: OpenWalnut ( http://www.openwalnut.org )
#
# Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
# For more information see http://www.openwalnut.org/copying
#
# This file is part of OpenWalnut.
#
# OpenWalnut is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# OpenWalnut is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
#
#---------------------------------------------------------------------------
INCLUDE( OpenWalnutUtils )
# name of the core lib. Used when linking modules or other GUI
SET( OW_LIB_OPENWALNUT "openwalnut" )
# ---------------------------------------------------------------------------------------------------------------------------------------------------
#
# This is executed on inclusion. It sets up everything needed. Beginning with compiler and OpenWalnut options and the third-party dependencies.
#
# ---------------------------------------------------------------------------------------------------------------------------------------------------
# guard against in-source builds
IF( ${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR} )
MESSAGE( FATAL_ERROR "In-source builds not allowed. Please make a new directory (called a build directory) and run CMake from there. (you may need to remove CMakeCache.txt" )
ENDIF()
# the build types
IF( NOT CMAKE_BUILD_TYPE )
SET( CMAKE_BUILD_TYPE Release
CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo"
FORCE
)
ENDIF( NOT CMAKE_BUILD_TYPE )
# guard against typos in build-type strings
STRING( TOLOWER "${CMAKE_BUILD_TYPE}" cmake_build_type_tolower)
IF( NOT cmake_build_type_tolower STREQUAL "debug" AND
NOT cmake_build_type_tolower STREQUAL "release" AND
NOT cmake_build_type_tolower STREQUAL "relwithdebinfo" AND
NOT cmake_build_type_tolower STREQUAL "")
MESSAGE( SEND_ERROR "Unknown build type \"${CMAKE_BUILD_TYPE}\". Allowed values are Debug, Release, RelWithDebInfo and \"\" (case-insensitive).")
ENDIF()
# ---------------------------------------------------------------------------------------------------------------------------------------------------
#
# External Building Support (find OpenWalnut if needed)
#
# ---------------------------------------------------------------------------------------------------------------------------------------------------
# if this is included for external module building, find OpenWalnut.
IF( NOT ${OW_EXTERNAL_MODULE} )
# to allow non-core code to access core and ext absolutely
MESSAGE( STATUS "This is OpenWalnut Build System." )
INCLUDE_DIRECTORIES( ${PROJECT_SOURCE_DIR} )
ELSE()
MESSAGE( STATUS "This is OpenWalnut Build System configured for external use." )
FIND_PATH( OPENWALNUT_INCLUDE_DIR core/kernel/WKernel.h ${OPENWALNUT_INCLUDEDIR} $ENV{OPENWALNUT_INCLUDEDIR} /usr/include/openwalnut /usr/local/include/openwalnut )
FIND_LIBRARY( OPENWALNUT_LIBRARIES NAMES ${OW_LIB_OPENWALNUT} lib${OW_LIB_OPENWALNUT} HINTS
${OPENWALNUT_LIBDIR}
$ENV{OPENWALNUT_LIBDIR}
/usr/lib
/usr/local/lib
/usr
/usr/local
/usr/local/openwalnut
/usr/local/OpenWalnut
$ENV{PROGRAMFILES}/OpenWalnut )
SET( OPENWALNUT_FOUND FALSE )
# do not confuse the user with this
MARK_AS_ADVANCED( FORCE OPENWALNUT_INCLUDE_DIR )
MARK_AS_ADVANCED( FORCE OPENWALNUT_LIBRARIES )
MARK_AS_ADVANCED( FORCE OPENWALNUT_FOUND )
# provide some output
IF( OPENWALNUT_INCLUDE_DIR )
MESSAGE( STATUS "Found OpenWalnut include files in ${OPENWALNUT_INCLUDE_DIR}." )
ENDIF()
IF( OPENWALNUT_LIBRARIES )
MESSAGE( STATUS "Found OpenWalnut libs in ${OPENWALNUT_LIBRARIES}." )
ENDIF()
# really found?
IF( OPENWALNUT_INCLUDE_DIR AND OPENWALNUT_LIBRARIES )
SET( OPENWALNUT_FOUND TRUE )
MESSAGE( STATUS "Found OpenWalnut." )
ELSE()
MESSAGE( FATAL_ERROR "Could not find OpenWalnut." )
ENDIF()
# include
INCLUDE_DIRECTORIES( ${OPENWALNUT_INCLUDE_DIR} )
SET( OW_LIB_OPENWALNUT ${OPENWALNUT_LIBRARIES} )
ENDIF()
# ---------------------------------------------------------------------------------------------------------------------------------------------------
#
# This is mandatory. Defines the target paths for building all elements in OpenWalnut
#
# ---------------------------------------------------------------------------------------------------------------------------------------------------
# mimic layout of install dir for build:
# these dirs are the same for all parts of OW
SET( OW_RUNTIME_DIR_RELATIVE "bin" )
SET( OW_RUNTIME_DIR ${PROJECT_BINARY_DIR}/${OW_RUNTIME_DIR_RELATIVE} )
SET( OW_LIBRARY_DIR_RELATIVE "lib" )
SET( OW_LIBRARY_DIR ${PROJECT_BINARY_DIR}/${OW_LIBRARY_DIR_RELATIVE} )
SET( OW_ARCHIVE_DIR_RELATIVE "lib" )
SET( OW_ARCHIVE_DIR ${PROJECT_BINARY_DIR}/${OW_ARCHIVE_DIR_RELATIVE} )
SET( OW_MODULE_DIR_RELATIVE "lib/openwalnut" )
SET( OW_MODULE_DIR ${PROJECT_BINARY_DIR}/${OW_MODULE_DIR_RELATIVE} )
SET( OW_MAN_DIR_RELATIVE "share/man" )
SET( OW_MAN_DIR "${PROJECT_BINARY_DIR}/share/man" )
# One could also define this for every part of OW, but it does not make sense. It is "share" because it is shared among the different parts
SET( OW_SHARE_DIR_RELATIVE "share/openwalnut" )
SET( OW_SHARE_DIR ${PROJECT_BINARY_DIR}/${OW_SHARE_DIR_RELATIVE} )
# where to find the doxygen config
SET( OW_DOXYGEN_DIR ${PROJECT_SOURCE_DIR}/../doc/developer )
# set our paths for install targets
SET( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${OW_RUNTIME_DIR} )
SET( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${OW_LIBRARY_DIR} )
SET( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${OW_ARCHIVE_DIR} )
# ---------------------------------------------------------------------------------------------------------------------------------------------------
#
# Basic Build Setup Helpers
#
# ---------------------------------------------------------------------------------------------------------------------------------------------------
# This method configures the needed compiler flags and system specific options. You probably do not need to call this explciitly. It is done in
# BUILD_SYSTEM_SETUP
FUNCTION( BUILD_SYSTEM_COMPILER )
# Unfortunately libstdc++'s header files don't work with mingw in ansi mode (basically libstdc++'s fault)
IF( CMAKE_HOST_SYSTEM MATCHES "Windows" )
SET( CMAKE_CXX_FLAGS "-frtti -pedantic -Wall -Wno-long-long -Wextra " CACHE STRING "" FORCE )
ELSE()
SET( CMAKE_CXX_FLAGS "-frtti -pedantic -ansi -Wall -Wno-long-long -Wextra " CACHE STRING "" FORCE )
ENDIF()
# Darwin's ld isn't GNU and doesn't like the following
IF( NOT CMAKE_SYSTEM_NAME MATCHES "Darwin" )
## The following allows us to prevent cyclic dependencies even on linux
SET( CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined -Wl,--allow-shlib-undefined,--as-needed" CACHE STRING "" FORCE )
SET( CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed" CACHE STRING "" FORCE )
ENDIF()
SET( CMAKE_CXX_FLAGS_RELEASE "-O3" CACHE STRING "" FORCE )
SET( CMAKE_CXX_FLAGS_DEBUG "-g -DDEBUG -O0" CACHE STRING "" FORCE )
SET( CMAKE_CXX_FLAGS_RELWITHDEBINFO "-g -DDEBUG -O2" CACHE STRING "" FORCE )
ENDFUNCTION( BUILD_SYSTEM_COMPILER )
# ---------------------------------------------------------------------------------------------------------------------------------------------------
# Compiler setup
# ---------------------------------------------------------------------------------------------------------------------------------------------------
BUILD_SYSTEM_COMPILER()
# ---------------------------------------------------------------------------------------------------------------------------------------------------
# OpenWalnut specific options
# ---------------------------------------------------------------------------------------------------------------------------------------------------
# OpenWalnut specific options
# other options
OPTION( OW_HANDLE_SHADERS "This ensures that shaders are available in build directory after build." ON )
# sorry, linking not available properly on windows, Cygwin supports this but we do not want special rules for thousands of environments.
# ==> keep it clean
IF( NOT CMAKE_HOST_SYSTEM MATCHES "Windows" )
OPTION( OW_LINK_SHADERS "If turned on, shaders do not get copied. They get linked. This is a nice option for developers." OFF )
ENDIF()
# Provide several options to control some aspects of resource copy.
OPTION( OW_PACKAGE_BUILD "Enable this to get fine-grained control over several resources and files getting installed. This is very handy for package building." OFF )
IF( OW_PACKAGE_BUILD )
SET( OW_PACKAGE_PACKAGER "cpack" CACHE STRING "Package builder. Set this to enable packager-specific options during install." )
OPTION( OW_PACKAGE_NOCOPY_LICENSE "Disable to copy our licensing information. Enabling this can be useful for package maintainer since several packaging systems have their own licence mechanism (i.e. Debian)." OFF )
OPTION( OW_PACKAGE_NOCOPY_COREFONTS "Enable this if you have liberation fonts installed on your system. They will be linked. If disabled, our fonts are copied." OFF )
ENDIF()
# ---------------------------------------------------------------------------------------------------------------------------------------------------
# The openwalnut executable should print the revision/tag
# ---------------------------------------------------------------------------------------------------------------------------------------------------
# Generate needed headers
# NOTE: add a line ADD_DEPENDENCIES( XYZ OW_generate_version_header ) to your target XYZ if you need the header!
SET( OW_VERSION_HEADER_DIRECTORY ${PROJECT_BINARY_DIR}/versionHeader )
SET( OW_VERSION_HEADER ${OW_VERSION_HEADER_DIRECTORY}/WVersion.h )
# to allow all those targets to find the header:
INCLUDE_DIRECTORIES( ${OW_VERSION_HEADER_DIRECTORY} )
# Setup the target
SETUP_VERSION_HEADER( ${OW_VERSION_HEADER} )
# Set the OW version string. This can be used by others for setting target versions during compilation.
GET_VERSION_STRING( OW_VERSION OW_LIB_VERSION )
MESSAGE( STATUS "OW Version: \"${OW_VERSION}\"; OW Lib Version: \"${OW_LIB_VERSION}\"." )
# We need a SOVERSION too. This somehow describes the API compatibility. We use the major number here.
SPLIT_VERSION_STRING( ${OW_LIB_VERSION} OW_VERSION_MAJOR OW_VERSION_MINOR OW_VERSION_PATCH )
SET( OW_SOVERSION ${OW_VERSION_MAJOR} )
# ---------------------------------------------------------------------------------------------------------------------------------------------------
#
# REQUIRED third party libs
#
# ---------------------------------------------------------------------------------------------------------------------------------------------------
# -----------------------------------------------------------------------------------------------------------------------------------------------
# Boost, at least 1.39
# See http://www.boost.org/
#
# To see, which boost libs we currently use, you may run the following command # in the src directory on a linux box to make some investigations:
# grep -i include `find . -type f` | grep boost | awk '{print $2}' | sort | uniq
# Setup boost options
SET( Boost_USE_MULTITHREAD ON )
# find the boost packages
FIND_PACKAGE( Boost 1.39.0 REQUIRED program_options thread filesystem date_time system signals regex )
# include the boost headers
INCLUDE_DIRECTORIES( ${Boost_INCLUDE_DIR} )
# avoid filesystem 2 stuff
ADD_DEFINITIONS( "-DBOOST_FILESYSTEM_VERSION=3" )
# -----------------------------------------------------------------------------------------------------------------------------------------------
# OpenGL, at least 1.2
# See http://www.opengl.org
#
FIND_PACKAGE( OpenGL REQUIRED )
# include the OpenGL header paths
INCLUDE_DIRECTORIES( ${OPENGL_INCLUDE_DIR} )
# -----------------------------------------------------------------------------------------------------------------------------------------------
# OpenSceneGraph, at least 2.8.0
# See http://www.openscenegraph.org
# find the needed packages
SET( MIN_OSG_VERSION 2.8.0 )
FIND_PACKAGE( OpenSceneGraph ${MIN_OSG_VERSION} REQUIRED osgDB osgUtil osgGA osgViewer osgSim osgWidget osgText )
IF( OPENSCENEGRAPH_FOUND )
INCLUDE_DIRECTORIES( ${OPENSCENEGRAPH_INCLUDE_DIRS} )
ENDIF()
# NOTE: sorry but this is needed since those vars spam the ccmake. The user should find the important options fast!
# Remove all of them
MARK_AS_ADVANCED( FORCE OSG_INCLUDE_DIR )
MARK_AS_ADVANCED( FORCE OSG_LIBRARY )
MARK_AS_ADVANCED( FORCE OSG_LIBRARY_DEBUG )
MARK_AS_ADVANCED( FORCE OSGDB_INCLUDE_DIR )
MARK_AS_ADVANCED( FORCE OSGDB_LIBRARY )
MARK_AS_ADVANCED( FORCE OSGDB_LIBRARY_DEBUG )
MARK_AS_ADVANCED( FORCE OSGGA_INCLUDE_DIR )
MARK_AS_ADVANCED( FORCE OSGGA_LIBRARY )
MARK_AS_ADVANCED( FORCE OSGGA_LIBRARY_DEBUG )
MARK_AS_ADVANCED( FORCE OSGSIM_INCLUDE_DIR )
MARK_AS_ADVANCED( FORCE OSGSIM_LIBRARY )
MARK_AS_ADVANCED( FORCE OSGSIM_LIBRARY_DEBUG )
MARK_AS_ADVANCED( FORCE OSGUTIL_INCLUDE_DIR )
MARK_AS_ADVANCED( FORCE OSGUTIL_LIBRARY )
MARK_AS_ADVANCED( FORCE OSGUTIL_LIBRARY_DEBUG )
MARK_AS_ADVANCED( FORCE OSGTEXT_INCLUDE_DIR )
MARK_AS_ADVANCED( FORCE OSGTEXT_LIBRARY )
MARK_AS_ADVANCED( FORCE OSGTEXT_LIBRARY_DEBUG )