From bd677d0b9541c674700d1610c4dcddf8fa57c328 Mon Sep 17 00:00:00 2001 From: srit Date: Tue, 27 Apr 2010 22:52:34 +0000 Subject: [PATCH] Remove files in old directories. Remove them from your local directory. --- common/old/clitkIOCommon.cxx | 166 ------------------------- common/old/clitkIOCommon.h | 19 --- common/old/clitkIOCommon.txx | 102 ---------------- vv/old/cmake/FindROOT.cmake1 | 229 ----------------------------------- vv/old/cmake/FindROOT.cmake2 | 225 ---------------------------------- vv/old/cmake/common.cmake | 42 ------- 6 files changed, 783 deletions(-) delete mode 100644 common/old/clitkIOCommon.cxx delete mode 100644 common/old/clitkIOCommon.h delete mode 100644 common/old/clitkIOCommon.txx delete mode 100644 vv/old/cmake/FindROOT.cmake1 delete mode 100644 vv/old/cmake/FindROOT.cmake2 delete mode 100644 vv/old/cmake/common.cmake diff --git a/common/old/clitkIOCommon.cxx b/common/old/clitkIOCommon.cxx deleted file mode 100644 index d3e8707..0000000 --- a/common/old/clitkIOCommon.cxx +++ /dev/null @@ -1,166 +0,0 @@ -/*========================================================================= - Program: vv http://www.creatis.insa-lyon.fr/rio/vv - - Authors belong to: - - University of LYON http://www.universite-lyon.fr/ - - Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr - - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the copyright notices for more information. - - It is distributed under dual licence - - - BSD See included LICENSE.txt file - - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html -======================================================================-====*/ -#ifndef CLITKIOCOMMON_CXX -#define CLITKIOCOMMON_CXX -/** - ================================================= - * @file clitkIOCommon.cxx - * @author David Sarrut - * @date 18 May 2006 11:42:37 - * - * @brief - * - * - =================================================*/ - -// clitk include -#include "clitkImageCommon.h" -#include - -//==================================================================== -// Open a file for reading -void clitk::openFileForReading(std::ifstream & is, const std::string & filename) { - is.open(filename.c_str(), std::ios::in); - if ( is.fail() ) { - itkGenericExceptionMacro(<< "Could not open file (for reading): " << filename); - } -} -//==================================================================== - -//==================================================================== -// Open a file for writing -void clitk::openFileForWriting(std::ofstream & os, const std::string & filename) { - os.open(filename.c_str(), std::ios::out); - if ( os.fail() ) { - itkGenericExceptionMacro(<< "Could not open file (for writing): " << filename); - } -} -//==================================================================== - -//==================================================================== -// Read a dicom header -gdcm::File * clitk::readDicomHeader(const std::string & filename, - const bool verbose) { - if (verbose) { - std::cout << "Reading DICOM <" << filename << ">" << std::endl; - } - gdcm::File *header = new gdcm::File(); - header->SetFileName(filename); - header->SetMaxSizeLoadEntry(16384); // required ? - header->Load(); - return header; -} -//==================================================================== - -//==================================================================== -itk::ImageIOBase::Pointer clitk::readImageHeader(const std::string & filename, bool exit_on_error) { - itk::ImageIOBase::Pointer reader = - itk::ImageIOFactory::CreateImageIO(filename.c_str(), itk::ImageIOFactory::ReadMode); - if (!reader) - if (exit_on_error) //default behavior for tools who don't handle the problem - { - std::cerr "Error reading file " << filename << ", exiting immediately" << std::endl; - std::exit(-1); - } - else - return NULL; - reader->SetFileName(filename); - reader->ReadImageInformation(); - return reader; -} -//==================================================================== - -//==================================================================== -void clitk::printImageHeader(itk::ImageIOBase::Pointer header, std::ostream & os, const int level) { - unsigned int dim = header->GetNumberOfDimensions(); - std::string pixelTypeName = header->GetComponentTypeAsString(header->GetComponentType()); - std::vector inputSize; - std::vector inputSpacing; - inputSize.resize(dim); - inputSpacing.resize(dim); - for(unsigned int i=0; iGetSpacing(i); - inputSize[i] = header->GetDimensions(i); - } - int pixelSize = - clitk::GetTypeSizeFromString(header->GetComponentTypeAsString(header->GetComponentType())); - unsigned int nbOfComponents = header->GetNumberOfComponents(); - if (level == 0) { - os << dim << "D "; - if (nbOfComponents !=1) os << nbOfComponents << "x" << pixelTypeName; - else os << pixelTypeName; - os << " "; - for(unsigned int i=0; i< dim-1; i++) - os << inputSize[i] << "x"; - os << inputSize[dim-1] - << " "; - for(unsigned int i=0; i< dim-1; i++) - os << inputSpacing[i] << "x"; - os << inputSpacing[dim-1]; - } - else { - os << "Dim = " << dim << "D" << std::endl; - os << "PixelType = " << pixelTypeName << std::endl; - if (nbOfComponents > 1) - os << "Vector = " << nbOfComponents << std::endl; - os << "Size = "; - for(unsigned int i=0; i< dim; i++) { - os << inputSize[i] << " "; - } - os << std::endl; - os << "Spacing = "; - for(unsigned int i=0; i< dim; i++) { - os << inputSpacing[i] << " "; - } - os << std::endl; - if (level > 1) { - os << "# voxels = " << header->GetImageSizeInPixels() << std::endl; - os << "Size (mm) = "; - for(unsigned int i=0; i< dim; i++) { - os << inputSize[i]*inputSpacing[i] << " "; - } - os << "mm" << std::endl; - os << "Volume = "; - double vol=1.0; - for(unsigned int i=0; i< dim; i++) { - vol *= inputSize[i]*inputSpacing[i]/10.0; - } - os << vol << " cc" << std::endl; - int mem = header->GetImageSizeInPixels()*pixelSize*nbOfComponents; - double memKb = (double)mem/1024.0; - double memMb = (double)mem/1024.0/1024.0; - double memGb = (double)mem/1024.0/1024.0/1024.0; - if (lrint(memKb) <= 0) - os << "Memory = " << mem << " bytes" << std::endl; - else { - if (lrint(memMb) <= 0) - os << "Memory = " << memKb << " Kb (" << mem << " bytes)" << std::endl; - else { - if (lrint(memGb) <= 0) - os << "Memory = " << memMb << " Mb (" << mem << " bytes)" << std::endl; - else - os << "Memory = " << memGb << " Gb (" << mem << " bytes)" << std::endl; - } - } - } - } -} -//==================================================================== - -#endif /* end #define CLITKIO_CXX */ - diff --git a/common/old/clitkIOCommon.h b/common/old/clitkIOCommon.h deleted file mode 100644 index e19465b..0000000 --- a/common/old/clitkIOCommon.h +++ /dev/null @@ -1,19 +0,0 @@ -/*========================================================================= - Program: vv http://www.creatis.insa-lyon.fr/rio/vv - - Authors belong to: - - University of LYON http://www.universite-lyon.fr/ - - Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr - - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the copyright notices for more information. - - It is distributed under dual licence - - - BSD See included LICENSE.txt file - - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html -======================================================================-====*/ -#include "clitkImageCommon.h" - diff --git a/common/old/clitkIOCommon.txx b/common/old/clitkIOCommon.txx deleted file mode 100644 index 273d38c..0000000 --- a/common/old/clitkIOCommon.txx +++ /dev/null @@ -1,102 +0,0 @@ -/*========================================================================= - Program: vv http://www.creatis.insa-lyon.fr/rio/vv - - Authors belong to: - - University of LYON http://www.universite-lyon.fr/ - - Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr - - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the copyright notices for more information. - - It is distributed under dual licence - - - BSD See included LICENSE.txt file - - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html -======================================================================-====*/ -#ifndef CLITKIOCOMMON_TXX -#define CLITKIOCOMMON_TXX -/** - ================================================= - * @file clitkIOCommon.txx - * @author David Sarrut - * @date 04 Jul 2006 08:34:11 - * - * @brief - * - * - =================================================*/ - -//==================================================================== -// To short the code for reading an image -template -typename ImageType::Pointer readImage(const std::string & filename, const bool verbose) { - typedef itk::ImageFileReader ReaderType; - typename ReaderType::Pointer reader = ReaderType::New(); - reader->SetFileName(filename.c_str()); - if (verbose) { - std::cout << "Reading " << filename << " ..." << std::endl; - } - try { - reader->Update(); - } - catch( itk::ExceptionObject & err ) { - std::cerr << "Error while reading " << filename - << " " << err << std::endl; - exit(0); - } - return reader->GetOutput(); -} -//==================================================================== - -//==================================================================== -// To short the code for reading an image from several files -template -typename ImageType::Pointer readImage(const std::vector & filenames, - const bool verbose) { - if (filenames.size() == 1) return readImage(filenames[0], verbose); - typedef itk::ImageSeriesReader ReaderType; - typename ReaderType::Pointer reader = ReaderType::New(); - reader->SetFileNames(filenames); - if (verbose) { - std::cout << "Reading " << filenames[0] << " and others ..." << std::endl; - } - try { - reader->Update(); - } - catch( itk::ExceptionObject & err ) { - std::cerr << "Error while reading " << filenames[0] - << " or other files ..." << err << std::endl; - exit(0); - } - return reader->GetOutput(); -} -//==================================================================== - -//==================================================================== -// To short the code for writing an image -template -void writeImage(const typename ImageType::Pointer image, - const std::string & filename, - const bool verbose) { - typedef itk::ImageFileWriter WriterType; - typename WriterType::Pointer writer = WriterType::New(); - writer->SetFileName(filename.c_str()); - writer->SetInput(image); - if (verbose) { - std::cout << "Writing " << filename << "." << std::endl; - } - try { - writer->Update(); - } - catch( itk::ExceptionObject & err ) { - std::cerr << "Error while writing " << filename - << ", the error is : " << err << std::endl; - exit(0); - } -} -//==================================================================== - -#endif /* end #define CLITKIOCOMMON_TXX */ - diff --git a/vv/old/cmake/FindROOT.cmake1 b/vv/old/cmake/FindROOT.cmake1 deleted file mode 100644 index 4fdc250..0000000 --- a/vv/old/cmake/FindROOT.cmake1 +++ /dev/null @@ -1,229 +0,0 @@ -# - Find ROOT instalation -# This module tries to find the ROOT installation on your system. -# It tries to find the root-config script which gives you all the needed information. -# If the system variable ROOTSYS is set this is straight forward. -# If not the module uses the pathes given in ROOT_CONFIG_SEARCHPATH. -# If you need an other path you should add this path to this varaible. -# The root-config script is then used to detect basically everything else. -# This module defines a number of key variables and macros. - - -MESSAGE("Looking for Root...") -MESSAGE(STATUS "Looking for Root...") - -SET(ROOT_CONFIG_SEARCHPATH - ${SIMPATH}/tools/root/bin - $ENV{ROOTSYS}/bin -) - -SET(ROOT_DEFINITIONS "") - -SET(ROOT_INSTALLED_VERSION_TOO_OLD FALSE) - -SET(ROOT_CONFIG_EXECUTABLE ROOT_CONFIG_EXECUTABLE-NOTFOUND) - -FIND_PROGRAM(ROOT_CONFIG_EXECUTABLE NAMES root-config PATHS - ${ROOT_CONFIG_SEARCHPATH} - NO_SYSTEM_ENVIRONMENT_PATH) - -IF (${ROOT_CONFIG_EXECUTABLE} MATCHES "ROOT_CONFIG_EXECUTABLE-NOTFOUND") - MESSAGE( FATAL_ERROR "ROOT not installed in the searchpath and ROOTSYS is not set. Please - set ROOTSYS or add the path to your ROOT installation in the Macro FindROOT.cmake in the - subdirectory cmake/modules.") -ELSE (${ROOT_CONFIG_EXECUTABLE} MATCHES "ROOT_CONFIG_EXECUTABLE-NOTFOUND") - MESSAGE("root-config found") - STRING(REGEX REPLACE "(^.*)/bin/root-config" "\\1" test ${ROOT_CONFIG_EXECUTABLE}) - SET( ENV{ROOTSYS} ${test}) - set( ROOTSYS ${test}) -ENDIF (${ROOT_CONFIG_EXECUTABLE} MATCHES "ROOT_CONFIG_EXECUTABLE-NOTFOUND") - - -IF (ROOT_CONFIG_EXECUTABLE) - - SET(ROOT_FOUND FALSE) - - EXEC_PROGRAM(${ROOT_CONFIG_EXECUTABLE} ARGS "--version" OUTPUT_VARIABLE ROOTVERSION) - - MESSAGE(STATUS "Looking for Root... - found $ENV{ROOTSYS}/bin/root") - MESSAGE(STATUS "Looking for Root... - version ${ROOTVERSION} ") - - MESSAGE( "Looking for Root... - found $ENV{ROOTSYS}/bin/root") - MESSAGE( "Looking for Root... - version ${ROOTVERSION} ") - - # we need at least version 5.00/00 - IF (NOT ROOT_MIN_VERSION) - SET(ROOT_MIN_VERSION "5.00/00") - ENDIF (NOT ROOT_MIN_VERSION) - - # now parse the parts of the user given version string into variables - STRING(REGEX REPLACE "^([0-9]+)\\.[0-9][0-9]+\\/[0-9][0-9]+" "\\1" req_root_major_vers "${ROOT_MIN_VERSION}") - STRING(REGEX REPLACE "^[0-9]+\\.([0-9][0-9])+\\/[0-9][0-9]+.*" "\\1" req_root_minor_vers "${ROOT_MIN_VERSION}") - STRING(REGEX REPLACE "^[0-9]+\\.[0-9][0-9]+\\/([0-9][0-9]+)" "\\1" req_root_patch_vers "${ROOT_MIN_VERSION}") - - # and now the version string given by qmake - STRING(REGEX REPLACE "^([0-9]+)\\.[0-9][0-9]+\\/[0-9][0-9]+.*" "\\1" found_root_major_vers "${ROOTVERSION}") - STRING(REGEX REPLACE "^[0-9]+\\.([0-9][0-9])+\\/[0-9][0-9]+.*" "\\1" found_root_minor_vers "${ROOTVERSION}") - STRING(REGEX REPLACE "^[0-9]+\\.[0-9][0-9]+\\/([0-9][0-9]+).*" "\\1" found_root_patch_vers "${ROOTVERSION}") - - IF (found_root_major_vers LESS 5) - MESSAGE( FATAL_ERROR "Invalid ROOT version \"${ROOTERSION}\", at least major version 4 is required, e.g. \"5.00/00\"") - ENDIF (found_root_major_vers LESS 5) - - # compute an overall version number which can be compared at once - MATH(EXPR req_vers "${req_root_major_vers}*10000 + ${req_root_minor_vers}*100 + ${req_root_patch_vers}") - MATH(EXPR found_vers "${found_root_major_vers}*10000 + ${found_root_minor_vers}*100 + ${found_root_patch_vers}") - - IF (found_vers LESS req_vers) - SET(ROOT_FOUND FALSE) - SET(ROOT_INSTALLED_VERSION_TOO_OLD TRUE) - ELSE (found_vers LESS req_vers) - SET(ROOT_FOUND TRUE) - ENDIF (found_vers LESS req_vers) - -ENDIF (ROOT_CONFIG_EXECUTABLE) - -MESSAGE("root found = "${ROOT_FOUND}) - -IF (ROOT_FOUND) - - # ask root-config for the library dir - # Set ROOT_LIBRARY_DIR - - EXEC_PROGRAM( ${ROOT_CONFIG_EXECUTABLE} - ARGS "--libdir" - OUTPUT_VARIABLE ROOT_LIBRARY_DIR_TMP ) - - IF(EXISTS "${ROOT_LIBRARY_DIR_TMP}") - SET(ROOT_LIBRARY_DIR ${ROOT_LIBRARY_DIR_TMP} ) - ELSE(EXISTS "${ROOT_LIBRARY_DIR_TMP}") - MESSAGE("Warning: ROOT_CONFIG_EXECUTABLE reported ${ROOT_LIBRARY_DIR_TMP} as library path,") - MESSAGE("Warning: but ${ROOT_LIBRARY_DIR_TMP} does NOT exist, ROOT must NOT be installed correctly.") - ENDIF(EXISTS "${ROOT_LIBRARY_DIR_TMP}") - - # ask root-config for the binary dir - EXEC_PROGRAM(${ROOT_CONFIG_EXECUTABLE} - ARGS "--bindir" - OUTPUT_VARIABLE root_bins ) - SET(ROOT_BINARY_DIR ${root_bins}) - - # ask root-config for the include dir - EXEC_PROGRAM( ${ROOT_CONFIG_EXECUTABLE} - ARGS "--incdir" - OUTPUT_VARIABLE root_headers ) - SET(ROOT_INCLUDE_DIR ${root_headers}) - # CACHE INTERNAL "") - - # ask root-config for the library varaibles - EXEC_PROGRAM( ${ROOT_CONFIG_EXECUTABLE} -# ARGS "--noldflags --noauxlibs --libs" - ARGS "--glibs" - OUTPUT_VARIABLE root_flags ) - -# STRING(REGEX MATCHALL "([^ ])+" root_libs_all ${root_flags}) -# STRING(REGEX MATCHALL "-L([^ ])+" root_library ${root_flags}) -# REMOVE_FROM_LIST(root_flags "${root_libs_all}" "${root_library}") - - SET(ROOT_LIBRARIES ${root_flags}) - - # Make variables changeble to the advanced user - MARK_AS_ADVANCED( ROOT_LIBRARY_DIR ROOT_INCLUDE_DIR ROOT_DEFINITIONS) - - # Set ROOT_INCLUDES - SET( ROOT_INCLUDES ${ROOT_INCLUDE_DIR}) - - SET(LD_LIBRARY_PATH ${LD_LIBRARY_PATH} ${ROOT_LIBRARY_DIR}) - - ####################################### - # - # Check the executables of ROOT - # ( rootcint ) - # - ####################################### - - FIND_PROGRAM(ROOT_CINT_EXECUTABLE - NAMES rootcint - PATHS ${ROOT_BINARY_DIR} - NO_DEFAULT_PATH - ) - -ENDIF (ROOT_FOUND) - - -MESSAGE("icici") - - ########################################### - # - # Macros for building ROOT dictionary - # - ########################################### - -MACRO (ROOT_GENERATE_DICTIONARY_OLD ) - - set(INFILES "") - - foreach (_current_FILE ${ARGN}) - - IF (${_current_FILE} MATCHES "^.*\\.h$") - IF (${_current_FILE} MATCHES "^.*Link.*$") - set(LINKDEF_FILE ${_current_FILE}) - ELSE (${_current_FILE} MATCHES "^.*Link.*$") - set(INFILES ${INFILES} ${_current_FILE}) - ENDIF (${_current_FILE} MATCHES "^.*Link.*$") - ELSE (${_current_FILE} MATCHES "^.*\\.h$") - IF (${_current_FILE} MATCHES "^.*\\.cxx$") - set(OUTFILE ${_current_FILE}) - ELSE (${_current_FILE} MATCHES "^.*\\.cxx$") - set(INCLUDE_DIRS ${INCLUDE_DIRS} -I${_current_FILE}) - ENDIF (${_current_FILE} MATCHES "^.*\\.cxx$") - ENDIF (${_current_FILE} MATCHES "^.*\\.h$") - - endforeach (_current_FILE ${ARGN}) - -# MESSAGE("INFILES: ${INFILES}") -# MESSAGE("OutFILE: ${OUTFILE}") -# MESSAGE("LINKDEF_FILE: ${LINKDEF_FILE}") -# MESSAGE("INCLUDE_DIRS: ${INCLUDE_DIRS}") - - STRING(REGEX REPLACE "(^.*).cxx" "\\1.h" bla "${OUTFILE}") -# MESSAGE("BLA: ${bla}") - SET (OUTFILES ${OUTFILE} ${bla}) - - ADD_CUSTOM_COMMAND(OUTPUT ${OUTFILES} - COMMAND ${ROOT_CINT_EXECUTABLE} - ARGS -f ${OUTFILE} -c -DHAVE_CONFIG_H ${INCLUDE_DIRS} ${INFILES} ${LINKDEF_FILE} DEPENDS ${INFILES}) - -# MESSAGE("ROOT_CINT_EXECUTABLE has created the dictionary ${OUTFILE}") - -ENDMACRO (ROOT_GENERATE_DICTIONARY_OLD) - - ########################################### - # - # Macros for building ROOT dictionary - # - ########################################### - -MACRO (ROOT_GENERATE_DICTIONARY INFILES LINKDEF_FILE OUTFILE INCLUDE_DIRS_IN) - - set(INCLUDE_DIRS) - - foreach (_current_FILE ${INCLUDE_DIRS_IN}) - set(INCLUDE_DIRS ${INCLUDE_DIRS} -I${_current_FILE}) - endforeach (_current_FILE ${INCLUDE_DIRS_IN}) - - -# MESSAGE("INFILES: ${INFILES}") -# MESSAGE("OutFILE: ${OUTFILE}") -# MESSAGE("LINKDEF_FILE: ${LINKDEF_FILE}") -# MESSAGE("INCLUDE_DIRS: ${INCLUDE_DIRS}") - - STRING(REGEX REPLACE "^(.*)\\.(.*)$" "\\1.h" bla "${OUTFILE}") -# MESSAGE("BLA: ${bla}") - SET (OUTFILES ${OUTFILE} ${bla}) - - ADD_CUSTOM_COMMAND(OUTPUT ${OUTFILES} - COMMAND ${ROOT_CINT_EXECUTABLE} - ARGS -f ${OUTFILE} -c -DHAVE_CONFIG_H ${INCLUDE_DIRS} ${INFILES} ${LINKDEF_FILE} DEPENDS ${INFILES}) - -ENDMACRO (ROOT_GENERATE_DICTIONARY) - -MESSAGE("la") \ No newline at end of file diff --git a/vv/old/cmake/FindROOT.cmake2 b/vv/old/cmake/FindROOT.cmake2 deleted file mode 100644 index 02b456a..0000000 --- a/vv/old/cmake/FindROOT.cmake2 +++ /dev/null @@ -1,225 +0,0 @@ -# - Find ROOT instalation # This module tries to find the ROOT installation on your system. -# It tries to find the root-config script which gives you all the needed information. -# If the system variable ROOTSYS is set this is straight forward. -# If not the module uses the pathes given in ROOT_CONFIG_SEARCHPATH. -# If you need an other path you should add this path to this varaible. -# The root-config script is then used to detect basically everything else. -# This module defines a number of key variables and macros. - - -MESSAGE(STATUS "Looking for Root...") - -SET(ROOT_CONFIG_SEARCHPATH - $ENV{ROOTSYS}/bin - ) - -SET(ROOT_DEFINITIONS "") - -SET(ROOT_INSTALLED_VERSION_TOO_OLD FALSE) - -SET(ROOT_CONFIG_EXECUTABLE ROOT_CONFIG_EXECUTABLE-NOTFOUND) - -FIND_PROGRAM(ROOT_CONFIG_EXECUTABLE NAMES root-config PATHS - ${ROOT_CONFIG_SEARCHPATH} - NO_SYSTEM_ENVIRONMENT_PATH) - -FIND_FILE( RVERSION_H NAMES RVersion.h PATHS $ENV{ROOTSYS}/include ) - -IF ( RVERSION_H ) - FILE( READ ${RVERSION_H} RVERS_CONTENT ) - STRING( REGEX MATCH "#define ROOT_RELEASE \"[^\n]+\"\n" _line "${RVERS_CONTENT}" ) - STRING( REGEX REPLACE "#define ROOT_RELEASE \"([^\n]+)\"\n" "\\1" _match "${_line}") - IF(_match) - SET( ROOTVERSION ${_match}) - ENDIF(_match) -ENDIF( RVERSION_H ) - - -IF (ROOTVERSION) - - SET(ROOT_FOUND FALSE) - - MESSAGE(STATUS "Looking for Root... - found $ENV{ROOTSYS}/bin/root") - MESSAGE(STATUS "Looking for Root... - version ${ROOTVERSION} ") - - # we need at least version 5.00/00 - IF (NOT ROOT_MIN_VERSION) - SET(ROOT_MIN_VERSION "5.00/00") - ENDIF (NOT ROOT_MIN_VERSION) - - # now parse the parts of the user given version string into variables - STRING(REGEX REPLACE "^([0-9]+)\\.[0-9][0-9]+\\/[0-9][0-9]+" "\\1" req_root_major_vers "${ROOT_MIN_VERSION}") - STRING(REGEX REPLACE "^[0-9]+\\.([0-9][0-9])+\\/[0-9][0-9]+.*" "\\1" req_root_minor_vers "${ROOT_MIN_VERSION}") - STRING(REGEX REPLACE "^[0-9]+\\.[0-9][0-9]+\\/([0-9][0-9]+)" "\\1" req_root_patch_vers "${ROOT_MIN_VERSION}") - - # and now the version string given by qmake - STRING(REGEX REPLACE "^([0-9]+)\\.[0-9][0-9]+\\/[0-9][0-9]+.*" "\\1" found_root_major_vers "${ROOTVERSION}") - STRING(REGEX REPLACE "^[0-9]+\\.([0-9][0-9])+\\/[0-9][0-9]+.*" "\\1" found_root_minor_vers "${ROOTVERSION}") - STRING(REGEX REPLACE "^[0-9]+\\.[0-9][0-9]+\\/([0-9][0-9]+).*" "\\1" found_root_patch_vers "${ROOTVERSION}") - - IF (found_root_major_vers LESS 5) - MESSAGE( FATAL_ERROR "Invalid ROOT version \"${ROOTERSION}\", at least major version 4 is required, e.g. \"5.00/00\"") - ENDIF (found_root_major_vers LESS 5) - - # compute an overall version number which can be compared at once - MATH(EXPR req_vers "${req_root_major_vers}*10000 + ${req_root_minor_vers}*100 + ${req_root_patch_vers}") - MATH(EXPR found_vers "${found_root_major_vers}*10000 + ${found_root_minor_vers}*100 + ${found_root_patch_vers}") - - IF (found_vers LESS req_vers) - SET(ROOT_FOUND FALSE) - SET(ROOT_INSTALLED_VERSION_TOO_OLD TRUE) - ELSE (found_vers LESS req_vers) - SET(ROOT_FOUND TRUE) - ENDIF (found_vers LESS req_vers) - -ENDIF (ROOTVERSION) - - -IF (ROOT_FOUND) - - # ask root-config for the library dir - # Set ROOT_LIBRARY_DIR - IF( WIN32 ) - SET( ROOT_LIBRARY_DIR $ENV{ROOTSYS}/lib ) - SET( ROOT_INCLUDE_DIR $ENV{ROOTSYS}/include ) - SET( ROOT_BINARY_DIR $ENV{ROOTSYS}/bin ) - - ELSE( WIN32 ) - - EXEC_PROGRAM( ${ROOT_CONFIG_EXECUTABLE} - ARGS "--libdir" - OUTPUT_VARIABLE ROOT_LIBRARY_DIR_TMP ) - - IF(EXISTS "${ROOT_LIBRARY_DIR_TMP}") - SET(ROOT_LIBRARY_DIR ${ROOT_LIBRARY_DIR_TMP} ) - ELSE(EXISTS "${ROOT_LIBRARY_DIR_TMP}") - MESSAGE("Warning: ROOT_CONFIG_EXECUTABLE reported ${ROOT_LIBRARY_DIR_TMP} as library path,") - MESSAGE("Warning: but ${ROOT_LIBRARY_DIR_TMP} does NOT exist, ROOT must NOT be installed correctly.") - ENDIF(EXISTS "${ROOT_LIBRARY_DIR_TMP}") - - # ask root-config for the binary dir - EXEC_PROGRAM(${ROOT_CONFIG_EXECUTABLE} - ARGS "--bindir" - OUTPUT_VARIABLE root_bins ) - SET(ROOT_BINARY_DIR ${root_bins}) - - # ask root-config for the include dir - EXEC_PROGRAM( ${ROOT_CONFIG_EXECUTABLE} - ARGS "--incdir" - OUTPUT_VARIABLE root_headers ) - SET(ROOT_INCLUDE_DIR ${root_headers}) - # CACHE INTERNAL "") - - # ask root-config for the library varaibles - EXEC_PROGRAM( ${ROOT_CONFIG_EXECUTABLE} - ARGS "--noldflags --noauxlibs --libs" - OUTPUT_VARIABLE root_flags ) - - # STRING(REGEX MATCHALL "([^ ])+" root_libs_all ${root_flags}) - # STRING(REGEX MATCHALL "-L([^ ])+" root_library ${root_flags}) - # REMOVE_FROM_LIST(root_flags "${root_libs_all}" "${root_library}") - - SET(ROOT_LIBRARIES ${root_flags}) - - ENDIF( WIN32 ) - - # Make variables changeble to the advanced user - MARK_AS_ADVANCED( ROOT_LIBRARY_DIR ROOT_INCLUDE_DIR ROOT_DEFINITIONS) - - # Set ROOT_INCLUDES - SET( ROOT_INCLUDES ${ROOT_INCLUDE_DIR}) - - SET(LD_LIBRARY_PATH ${LD_LIBRARY_PATH} ${ROOT_LIBRARY_DIR}) - - ####################################### - # - # Check the executables of ROOT - # ( rootcint ) - # - ####################################### - - FIND_PROGRAM(ROOT_CINT_EXECUTABLE - NAMES rootcint - PATHS ${ROOT_BINARY_DIR} - NO_DEFAULT_PATH - ) - -ENDIF (ROOT_FOUND) - - - -########################################### -# -# Macros for building ROOT dictionary -# -########################################### - -MACRO (ROOT_GENERATE_DICTIONARY_OLD ) - - set(INFILES "") - - foreach (_current_FILE ${ARGN}) - - IF (${_current_FILE} MATCHES "^.*\\.h$") - IF (${_current_FILE} MATCHES "^.*Link.*$") - set(LINKDEF_FILE ${_current_FILE}) - ELSE (${_current_FILE} MATCHES "^.*Link.*$") - set(INFILES ${INFILES} ${_current_FILE}) - ENDIF (${_current_FILE} MATCHES "^.*Link.*$") - ELSE (${_current_FILE} MATCHES "^.*\\.h$") - IF (${_current_FILE} MATCHES "^.*\\.cxx$") - set(OUTFILE ${_current_FILE}) - ELSE (${_current_FILE} MATCHES "^.*\\.cxx$") - set(INCLUDE_DIRS ${INCLUDE_DIRS} -I${_current_FILE}) - ENDIF (${_current_FILE} MATCHES "^.*\\.cxx$") - ENDIF (${_current_FILE} MATCHES "^.*\\.h$") - - endforeach (_current_FILE ${ARGN}) - - # MESSAGE("INFILES: ${INFILES}") - # MESSAGE("OutFILE: ${OUTFILE}") - # MESSAGE("LINKDEF_FILE: ${LINKDEF_FILE}") - # MESSAGE("INCLUDE_DIRS: ${INCLUDE_DIRS}") - - STRING(REGEX REPLACE "(^.*).cxx" "\\1.h" bla "${OUTFILE}") - # MESSAGE("BLA: ${bla}") - SET (OUTFILES ${OUTFILE} ${bla}) - - ADD_CUSTOM_COMMAND(OUTPUT ${OUTFILES} - COMMAND ${ROOT_CINT_EXECUTABLE} - ARGS -f ${OUTFILE} -c -DHAVE_CONFIG_H ${INCLUDE_DIRS} ${INFILES} ${LINKDEF_FILE} DEPENDS ${INFILES}) - - # MESSAGE("ROOT_CINT_EXECUTABLE has created the dictionary ${OUTFILE}") - -ENDMACRO (ROOT_GENERATE_DICTIONARY_OLD) - -########################################### -# -# Macros for building ROOT dictionary -# -########################################### - -MACRO (ROOT_GENERATE_DICTIONARY INFILES LINKDEF_FILE OUTFILE INCLUDE_DIRS_IN) - - set(INCLUDE_DIRS) - - foreach (_current_FILE ${INCLUDE_DIRS_IN}) - set(INCLUDE_DIRS ${INCLUDE_DIRS} -I${_current_FILE}) - endforeach (_current_FILE ${INCLUDE_DIRS_IN}) - - - # MESSAGE("INFILES: ${INFILES}") - # MESSAGE("OutFILE: ${OUTFILE}") - # MESSAGE("LINKDEF_FILE: ${LINKDEF_FILE}") - # MESSAGE("INCLUDE_DIRS: ${INCLUDE_DIRS}") - - STRING(REGEX REPLACE "^(.*)\\.(.*)$" "\\1.h" bla "${OUTFILE}") - # MESSAGE("BLA: ${bla}") - SET (OUTFILES ${OUTFILE} ${bla}) - - ADD_CUSTOM_COMMAND(OUTPUT ${OUTFILES} - COMMAND ${ROOT_CINT_EXECUTABLE} - ARGS -f ${OUTFILE} -c -DHAVE_CONFIG_H ${INCLUDE_DIRS} ${INFILES} ${LINKDEF_FILE} DEPENDS ${INFILES}) - -ENDMACRO (ROOT_GENERATE_DICTIONARY) - diff --git a/vv/old/cmake/common.cmake b/vv/old/cmake/common.cmake deleted file mode 100644 index cb11655..0000000 --- a/vv/old/cmake/common.cmake +++ /dev/null @@ -1,42 +0,0 @@ -#========================================================= -# Find ggo (gengetopt) files (http://www.gnu.org/software/gengetopt/) -FILE(GLOB ALL_GGO_FILES *.ggo) -#MESSAGE(${ALL_GGO_FILES}) - -FOREACH(GGO_FILE ${ALL_GGO_FILES}) - # MESSAGE(input=${GGO_FILE}) - STRING(REGEX REPLACE "(.*).ggo" - "\\1" GGO_BASENAME - "${GGO_FILE}") - #MESSAGE( base= ${GGO_BASENAME}) - SET(GGO_H ${GGO_BASENAME}_ggo.h) - #MESSAGE(${GGO_H}) - SET(GGO_C ${GGO_BASENAME}_ggo.c) - #MESSAGE(${GGO_C}) - SET(GGO_OUTPUT ${GGO_H} ${GGO_C}) - ADD_CUSTOM_COMMAND(OUTPUT ${GGO_OUTPUT} - COMMAND gengetopt - ARGS < ${GGO_FILE} --file-name=${GGO_BASENAME}_ggo -u --conf-parser - DEPENDS ${GGO_FILE} - ) - ENDFOREACH(GGO_FILE) - -#========================================================= -SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin/) -SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib) -LINK_DIRECTORIES(${PROJECT_BINARY_DIR}/lib) -INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/ilr/base) -INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/ilr/grid) -INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/ilr/gridtools) -INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/ilr/signal) -INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/ilr/pose) -INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/ilr/shearwarp) -INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/ilr/synergy) -INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/ilr/reconstruction) -INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/ilr/register) -INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/ilr/deformableregistration) -INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/ilr/optim) -INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/common) -INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/tests) -INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/tools) -#========================================================= -- 2.47.1