Commit b302936c authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum

[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()
This diff is collapsed.
This diff is collapsed.
#---------------------------------------------------------------------------
#
# 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/>.
#
#---------------------------------------------------------------------------
# This is a script executed during build time to genertae the WVersion.h headers. This is needed since CMake does not allow us to define the
# commands directly inside an ADD_CUSTOM_COMMAND call. An alternative to this would be SET_SOURCE_FILE_PROPERTIES which should be able to set the
# version as define for some files. But this caused the whole source to rebuild although it was only set for one file (bug? feature? we do not
# know.)
INCLUDE( OpenWalnutUtils.cmake )
GET_VERSION_STRING( OW_VERSION OW_API_VERSION )
FILE( WRITE ${HEADER_FILENAME} "// generated by CMake. Do not modify.\n#define W_VERSION \"${OW_VERSION}\"\n#define W_LIB_VERSION \"${OW_API_VERSION}\"\n" )
#!/bin/sh
if [ ! -n "$1" ]; then
echo "Syntax is: owclean dirname filesuffix"
echo "Syntax is: owclean filename"
echo "Example: owclean src cpp"
exit 1
fi
if [ -d "$1" ]; then
#echo "Dir ${1} exists"
if [ -n "$2" ]; then
filesuffix=$2
else
filesuffix="*"
fi
#echo "Filtering files using suffix ${filesuffix}"
file_list=`find ${1} -name "*.${filesuffix}" -type f`
for file2indent in $file_list
do
echo "Indenting file $file2indent"
#!/bin/bash
uncrustify -f "$file2indent" -c "uncrustify.cfg" -o indentoutput.tmp
mv indentoutput.tmp "$file2indent"
done
else
if [ -f "$1" ]; then
echo "Indenting one file $1"
#!/bin/bash
uncrustify -f "$1" -c "uncrustify.cfg" -o indentoutput.tmp
mv indentoutput.tmp "$1"
else
echo "ERROR: As parameter given directory or file does not exist!"
echo "Syntax is: owclean dirname filesuffix"
echo "Syntax is: owclean filename"
echo "Example: owclean temp cpp"
exit 1
fi
fi
indent_align_string=true
indent_braces=false
indent_braces_no_func=false
indent_brace_parent=false
indent_namespace=true
indent_extern=false
indent_class=true
indent_class_colon=true
indent_else_if=false
indent_func_call_param=false
indent_func_def_param=false
indent_func_proto_param=false
indent_func_class_param=false
indent_func_ctor_var_param=false
indent_template_param=false
indent_func_param_double=false
indent_relative_single_line_comments=false
indent_col1_comment=true
indent_access_spec_body=false
indent_paren_nl=false
indent_comma_paren=false
indent_bool_paren=false
indent_square_nl=false
indent_preserve_sql=false
indent_align_assign=true
sp_balance_nested_parens=false
align_keep_tabs=false
align_with_tabs=false
align_on_tabstop=false
align_number_left=false
align_func_params=false
align_same_func_call_params=false
align_var_def_colon=false
align_var_def_attribute=false
align_var_def_inline=false
align_right_cmt_mix=false
align_on_operator=false
align_mix_var_proto=false
align_single_line_func=false
align_single_line_brace=false
align_nl_cont=false
align_left_shift=true
nl_collapse_empty_body=false
nl_assign_leave_one_liners=false
nl_class_leave_one_liners=false
nl_enum_leave_one_liners=false
nl_getset_leave_one_liners=false
nl_func_leave_one_liners=false
nl_if_leave_one_liners=false
nl_multi_line_cond=false
nl_multi_line_define=false
nl_before_case=false
nl_after_case=true
nl_after_return=false
nl_after_semicolon=true
nl_after_brace_open=true
nl_after_brace_open_cmt=true
nl_after_vbrace_open=false
nl_after_brace_close=false
nl_define_macro=false
nl_squeeze_ifdef=false
nl_ds_struct_enum_cmt=false
nl_ds_struct_enum_close_brace=false
nl_create_if_one_liner=false
nl_create_for_one_liner=false
nl_create_while_one_liner=false
ls_for_split_full=true
ls_func_split_full=true
nl_after_multiline_comment=false
eat_blanks_after_open_brace=true
eat_blanks_before_close_brace=true
mod_pawn_semicolon=false
mod_full_paren_if_bool=false
mod_remove_extra_semicolon=true
mod_sort_import=false
mod_sort_using=true
mod_sort_include=true
mod_move_case_break=true
mod_remove_empty_return=true
cmt_indent_multi=true
cmt_c_group=false
cmt_c_nl_start=false
cmt_c_nl_end=false
cmt_cpp_group=false
cmt_cpp_nl_start=false
cmt_cpp_nl_end=false
cmt_cpp_to_c=false
cmt_star_cont=true
cmt_multi_check_last=true
cmt_insert_before_preproc=false
pp_indent_at_level=false
pp_region_indent_code=false
pp_if_indent_code=false
pp_define_at_level=false
input_tab_size=4
output_tab_size=4
indent_columns=4
nl_func_var_def_blk=1
code_width=145
nl_max=2
nl_after_func_proto=2
nl_after_func_body=2
nl_before_access_spec=2
nl_after_access_spec=2
nl_after_try_catch_finally=2
newlines=auto
indent_with_tabs=0
sp_arith=force
sp_assign=force
sp_enum_assign=force
sp_pp_concat=force
sp_pp_stringify=force
sp_bool=force
sp_compare=force
sp_inside_paren=force
sp_paren_paren=force
sp_before_ptr_star=force
sp_before_unnamed_ptr_star=remove
sp_after_ptr_star=remove
sp_after_ptr_star_func=force
sp_before_ptr_star_func=remove
sp_before_byref=force
sp_before_unnamed_byref=remove
sp_after_byref=remove
sp_after_byref_func=force
sp_before_byref_func=remove
sp_template_angle=remove
sp_before_angle=remove
sp_inside_angle=force
sp_after_angle=remove
sp_angle_paren=remove
sp_angle_word=force
sp_before_sparen=remove
sp_inside_sparen=force
sp_before_semi_for_empty=remove
sp_after_semi_for_empty=remove
sp_inside_square=force
sp_after_comma=force
sp_before_comma=remove
sp_after_class_colon=force
sp_before_class_colon=remove
sp_before_case_colon=remove
sp_after_operator=force
sp_after_operator_sym=remove
sp_after_cast=remove
sp_inside_paren_cast=force
sp_cpp_cast_paren=remove
sp_sizeof_paren=remove
sp_inside_braces_empty=remove
sp_type_func=force
sp_func_proto_paren=remove
sp_func_def_paren=remove
sp_inside_fparens=remove
sp_inside_fparen=force
sp_func_call_paren=remove
sp_func_class_paren=remove
sp_return_paren=force
sp_defined_paren=remove
sp_throw_paren=remove
sp_brace_typedef=force
sp_before_dc=remove
sp_after_dc=remove
sp_not=remove
sp_inv=remove
sp_addr=remove
sp_member=remove
sp_deref=remove
sp_sign=remove
sp_incdec=remove
sp_cond_colon=force
sp_cond_question=force
sp_case_label=force
sp_cmt_cpp_start=force
nl_start_of_file=remove
nl_end_of_file=remove
nl_fcall_brace=force
nl_enum_brace=force
nl_struct_brace=force
nl_union_brace=force
nl_if_brace=force
nl_brace_else=force
nl_else_brace=force
nl_else_if=remove
nl_brace_finally=force
nl_finally_brace=force
nl_try_brace=force
nl_for_brace=force
nl_catch_brace=force
nl_brace_catch=force
nl_while_brace=force
nl_do_brace=force
nl_brace_while=remove
nl_switch_brace=force
nl_before_throw=ignore
nl_namespace_brace=force
nl_template_class=force
nl_class_brace=force
nl_class_init_args=force
nl_func_type_name=remove
nl_func_scope_name=remove
nl_func_proto_type_name=remove
nl_func_paren=remove
nl_fdef_brace=force
nl_return_expr=remove
nl_before_if=ignore
nl_class_colon=ignore
pos_arith=trail
pos_assign=trail
pos_bool=trail
pos_comma=trail
pos_class_comma=trail
pos_class_colon=trail
mod_full_brace_do=force
mod_full_brace_for=force
mod_full_brace_if=force
mod_full_brace_while=force
mod_paren_on_return=remove
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment