| /trunk/test/CMakeLists.txt |
|---|
| New file |
| 0,0 → 1,34 |
| include(HepMCBuildTest) |
| set( HepMC_tests |
| testHepMCIteration |
| testMass |
| testFlow |
| testPrintBug |
| testPolarization ) |
| set( HepMC_simple_tests testSimpleVector |
| testUnits |
| testMultipleCopies |
| testWeights ) |
| # automake/autoconf variables for *.cc.in |
| set(srcdir ${CMAKE_CURRENT_SOURCE_DIR} ) |
| FILE( GLOB process_source *.cc.in ) |
| foreach( sfile ${process_source} ) |
| get_filename_component(basename ${sfile} NAME_WE ) |
| configure_file( ${sfile} |
| ${CMAKE_CURRENT_BINARY_DIR}/${basename}.cc @ONLY ) |
| endforeach( sfile ${process_source} ) |
| hepmc_test( testHepMC testHepMCMethods.cc ) |
| hepmc_test( testStreamIO testHepMCMethods.cc ) |
| foreach ( test ${HepMC_tests} ) |
| hepmc_test( ${test} ) |
| endforeach ( test ${HepMC_tests} ) |
| foreach ( test ${HepMC_simple_tests} ) |
| hepmc_simple_test( ${test} ) |
| endforeach ( test ${HepMC_simple_tests} ) |
| /trunk/cmake/INSTALL |
|---|
| New file |
| 0,0 → 1,63 |
| #------------------------------------------------------------- |
| # building HepMC with cmake |
| #------------------------------------------------------------- |
| This package requires cmake 2.6 or later. |
| #------------------------------------------------------------- |
| # installing from a source code tar ball |
| #------------------------------------------------------------- |
| Unwind the source code tar ball in some relevant directory. |
| Determine where the files will be installed. |
| Create a build directory that is NOT in the source code directory tree. |
| Make sure cmake is in your path. |
| cd <build_directory> |
| cmake -DCMAKE_INSTALL_PREFIX=<install_dir> <source_code_dir> |
| (Note that files will be installed under /usr/local if you do not |
| specify a prefix.) |
| make |
| (Build temporary copies of libraries and executables.) |
| make test |
| (Run the tests.) |
| make install |
| (Copy libraries, headers, executables, etc. to relevant |
| subdirectories under <install_dir>.) |
| #------------------------------------------------------------- |
| # cmake options |
| #------------------------------------------------------------- |
| -DCMAKE_INSTALL_PREFIX=/install/path |
| -DCMAKE_BUILD_TYPE=Debug|Release|RelWithDebInfo|MinSizeRel |
| -Dbuild_docs:BOOL=ON |
| #------------------------------------------------------------- |
| # building documents |
| #------------------------------------------------------------- |
| Documents are not built or installed automatically. |
| If you wish to build and install the documents, |
| add -Dbuild_docs:BOOL=ON to your cmake command. |
| Documents will then be built during the normal build. |
| You will need to have latex in your path. |
| #------------------------------------------------------------- |
| # building from svn |
| #------------------------------------------------------------- |
| To work with a tagged branch: |
| svn co svn+ssh://svn.cern.ch/reps/hepmc/tags/HEPMC_02_06_01 |
| To work with the head: |
| svn co svn+ssh://svn.cern.ch/reps/hepmc/trunk HepMC |
| You may also download directly from the online browser |
| http://svnweb.cern.ch/world/wsvn/hepmc/ |
| Now continue with directions as if you unpacked a source code tarball. |
| #------------------------------------------------------------- |
| /trunk/cmake/Modules/HepMCVariables.cmake |
|---|
| New file |
| 0,0 → 1,126 |
| # |
| # hepmc_set_compiler_flags() |
| # sets the default compiler flags |
| # calls hepmc_autoconf_variables |
| # |
| # hepmc_autoconf_variables() defines global variables |
| # |
| # some of the examples use fortran, |
| # so we need this for the example makefile |
| macro( _hepmc_fortran_compiler ) |
| EXEC_PROGRAM(${CMAKE_CXX_COMPILER} |
| ARGS ${CMAKE_CXX_COMPILER_ARG1} -dumpversion |
| OUTPUT_VARIABLE _my_COMPILER_VERSION |
| ) |
| STRING(REGEX REPLACE "([0-9])\\.([0-9])(\\.[0-9])?" "\\1" |
| _my_COMPILER_BASE_VERSION ${_my_COMPILER_VERSION}) |
| message(STATUS "compiler version: ${_my_COMPILER_VERSION}") |
| #message(STATUS "compiler base version: ${_my_COMPILER_BASE_VERSION}") |
| set(F77 "f77") |
| if(CMAKE_COMPILER_IS_GNUCXX) |
| if( ${_my_COMPILER_BASE_VERSION} MATCHES "3" ) |
| set(F77 "g77") |
| else() |
| set(F77 "gfortan") |
| endif() |
| endif(CMAKE_COMPILER_IS_GNUCXX) |
| #message(STATUS "F77: ${F77}") |
| endmacro( _hepmc_fortran_compiler ) |
| macro( hepmc_autoconf_variables ) |
| # these variables are used by <package>-config.in |
| # typical values from autoconf: |
| # AM_CXXFLAGS = -O -ansi -pedantic -Wall -D_GNU_SOURCE |
| # CXXFLAGS = -g -O2 |
| # CXX = g++ |
| # CXXCPP = g++ -E |
| # CPPFLAGS = |
| # CXXLD = $(CXX) |
| # AM_LDFLAGS = |
| # LDFLAGS = |
| # LIBS = |
| # automake/autoconf variables |
| set( prefix ${CMAKE_INSTALL_PREFIX} ) |
| set( exec_prefix "\${prefix}" ) |
| set( includedir "\${prefix}/include" ) |
| set( configure_input "Generated by cmake" ) |
| ### autoconf variables typically do not have the path |
| ##get_filename_component( CXX ${CMAKE_CXX_COMPILER} NAME ) |
| ##if( ${CXX} MATCHES "c\\+\\+" ) |
| ## set( CXX g++ ) |
| ##endif() |
| set( CXX ${CMAKE_BASE_NAME} ) |
| ##get_filename_component( AR ${CMAKE_AR} NAME ) |
| ##get_filename_component( RANLIB ${CMAKE_RANLIB} NAME ) |
| set( CXXCPP "${CXX} -E" ) |
| if( ${CMAKE_BUILD_TYPE} MATCHES "Debug" ) |
| set( CXXFLAGS ${CMAKE_CXX_FLAGS_DEBUG} ) |
| elseif( ${CMAKE_BUILD_TYPE} MATCHES "Release" ) |
| set( CXXFLAGS ${CMAKE_CXX_FLAGS_RELEASE} ) |
| elseif( ${CMAKE_BUILD_TYPE} MATCHES "RelWithDebInfo" ) |
| set( CXXFLAGS ${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ) |
| elseif( ${CMAKE_BUILD_TYPE} MATCHES "MinSizeRel" ) |
| set( CXXFLAGS ${CMAKE_CXX_FLAGS_MINSIZEREL} ) |
| endif() |
| ##message( STATUS "build type ${CMAKE_BUILD_TYPE} has ${CXXFLAGS}") |
| set( AM_CXXFLAGS ${CMAKE_CXX_FLAGS} ) |
| set( LDFLAGS ${CMAKE_MODULE_LINKER_FLAGS} ) |
| set( LIBS "" ) |
| set( DIFF_Q "diff -q -b" ) |
| _hepmc_fortran_compiler() |
| ### useful if you need to check a variable |
| ##message( STATUS "CMAKE_SYSTEM_NAME is ${CMAKE_SYSTEM_NAME}" ) |
| ##message( STATUS "CMAKE_BASE_NAME is ${CMAKE_BASE_NAME}" ) |
| ##message( STATUS "CMAKE_CXX_COMPILER_ID is ${CMAKE_CXX_COMPILER_ID}" ) |
| ##message( STATUS "CMAKE_COMPILER_IS_GNUCXX is ${CMAKE_COMPILER_IS_GNUCXX}" ) |
| ##message( STATUS "CMAKE_COMPILER_IS_MINGW is ${CMAKE_COMPILER_IS_MINGW}" ) |
| ##message( STATUS "CMAKE_COMPILER_IS_CYGWIN is ${CMAKE_COMPILER_IS_CYGWIN}" ) |
| ##message( STATUS "CMAKE_AR is ${CMAKE_AR}" ) |
| ##message( STATUS "CMAKE_RANLIB is ${CMAKE_RANLIB}" ) |
| ##message( STATUS "CMAKE_CXX_OUTPUT_EXTENSION is ${CMAKE_CXX_OUTPUT_EXTENSION}" ) |
| ##message( STATUS "CMAKE_SHARED_LIBRARY_CXX_FLAGS is ${CMAKE_SHARED_LIBRARY_CXX_FLAGS}" ) |
| ##message( STATUS "CMAKE_SHARED_MODULE_CXX_FLAGS is ${CMAKE_SHARED_MODULE_CXX_FLAGS}" ) |
| ##message( STATUS "CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS is ${CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS}" ) |
| ##message( STATUS "CMAKE_CXX_FLAGS is ${CMAKE_CXX_FLAGS}" ) |
| ##message( STATUS "CMAKE_CXX_FLAGS_DEBUG is ${CMAKE_CXX_FLAGS_DEBUG}" ) |
| ##message( STATUS "CMAKE_CXX_FLAGS_RELEASE is ${CMAKE_CXX_FLAGS_RELEASE}" ) |
| ##message( STATUS "CMAKE_CXX_FLAGS_RELWITHDEBINFO is ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}" ) |
| ##message( STATUS "CMAKE_CXX_STANDARD_LIBRARIES is ${CMAKE_CXX_STANDARD_LIBRARIES}" ) |
| ##message( STATUS "CMAKE_CXX_LINK_FLAGS is ${CMAKE_CXX_LINK_FLAGS}" ) |
| endmacro( hepmc_autoconf_variables ) |
| macro( hepmc_set_compiler_flags ) |
| ##message(STATUS "incoming cmake build type is ${CMAKE_BUILD_TYPE}") |
| if(NOT CMAKE_BUILD_TYPE) |
| set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "" FORCE) |
| endif() |
| message(STATUS "cmake build type is ${CMAKE_BUILD_TYPE}") |
| if( CMAKE_COMPILER_IS_GNUCC ) |
| set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O -ansi -pedantic -Wall -D_GNU_SOURCE") |
| endif(CMAKE_COMPILER_IS_GNUCC) |
| if(CMAKE_COMPILER_IS_GNUCXX) |
| set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O -ansi -pedantic -Wall -D_GNU_SOURCE") |
| endif(CMAKE_COMPILER_IS_GNUCXX) |
| if( ${CMAKE_SYSTEM_NAME} MATCHES "Windows" ) |
| ##message( STATUS "system is Windows" ) |
| ##message( STATUS "CMAKE_BASE_NAME is ${CMAKE_BASE_NAME}" ) |
| if( ${CMAKE_BASE_NAME} MATCHES "cl" ) |
| ##message( STATUS "compiler is MSVC" ) |
| ##message( STATUS "incoming basic compiler flags are ${CMAKE_CXX_FLAGS}") |
| set(CMAKE_C_FLAGS "/EHsc /nologo /GR /MD") |
| set(CMAKE_CXX_FLAGS "/EHsc /nologo /GR /MD") |
| endif() |
| endif() |
| hepmc_autoconf_variables() |
| #message(STATUS "F77: ${F77}") |
| message( STATUS "compiling with ${CMAKE_BASE_NAME} ${CMAKE_CXX_FLAGS} ${CXXFLAGS}") |
| endmacro( hepmc_set_compiler_flags ) |
| /trunk/cmake/Modules/HepMCFindCompiler.cmake |
|---|
| New file |
| 0,0 → 1,84 |
| # determine the compiler and version |
| # this code is more or less lifted from FindBoost |
| #------------------------------------------------------------------------------- |
| # |
| # Runs compiler with "-dumpversion" and parses major/minor |
| # version with a regex. |
| # |
| FUNCTION(_My_COMPILER_DUMPVERSION _OUTPUT_VERSION) |
| EXEC_PROGRAM(${CMAKE_CXX_COMPILER} |
| ARGS ${CMAKE_CXX_COMPILER_ARG1} -dumpversion |
| OUTPUT_VARIABLE _my_COMPILER_VERSION |
| ) |
| set( COMPILER_VERSION ${_my_COMPILER_VERSION} PARENT_SCOPE) |
| STRING(REGEX REPLACE "([0-9])\\.([0-9])(\\.[0-9])?" "\\1\\2" |
| _my_COMPILER_VERSION ${_my_COMPILER_VERSION}) |
| SET(${_OUTPUT_VERSION} ${_my_COMPILER_VERSION} PARENT_SCOPE) |
| ENDFUNCTION() |
| # |
| # End functions/macros |
| # |
| #------------------------------------------------------------------------------- |
| macro( hepmc_find_compiler ) |
| if (My_COMPILER) |
| SET (CPack_COMPILER_STRING ${My_COMPILER}) |
| message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " |
| "using user-specified My_COMPILER = ${CPack_COMPILER_STRING}") |
| else(My_COMPILER) |
| # Attempt to guess the compiler suffix |
| # NOTE: this is not perfect yet, if you experience any issues |
| # please report them and use the My_COMPILER variable |
| # to work around the problems. |
| if (MSVC90) |
| SET (CPack_COMPILER_STRING "-vc90") |
| elseif (MSVC80) |
| SET (CPack_COMPILER_STRING "-vc80") |
| elseif (MSVC71) |
| SET (CPack_COMPILER_STRING "-vc71") |
| elseif (MSVC70) # Good luck! |
| SET (CPack_COMPILER_STRING "-vc7") # yes, this is correct |
| elseif (MSVC60) # Good luck! |
| SET (CPack_COMPILER_STRING "-vc6") # yes, this is correct |
| elseif (BORLAND) |
| SET (CPack_COMPILER_STRING "-bcb") |
| elseif("${CMAKE_CXX_COMPILER}" MATCHES "icl" |
| OR "${CMAKE_CXX_COMPILER}" MATCHES "icpc") |
| if(WIN32) |
| set (CPack_COMPILER_STRING "-iw") |
| else() |
| set (CPack_COMPILER_STRING "-il") |
| endif() |
| elseif (MINGW) |
| _My_COMPILER_DUMPVERSION(CPack_COMPILER_STRING_VERSION) |
| SET (CPack_COMPILER_STRING "-mgw${CPack_COMPILER_STRING_VERSION}") |
| elseif (UNIX) |
| if (CMAKE_COMPILER_IS_GNUCXX) |
| _My_COMPILER_DUMPVERSION(CPack_COMPILER_STRING_VERSION) |
| # Determine which version of GCC we have. |
| if(APPLE) |
| SET (CPack_COMPILER_STRING "-xgcc${CPack_COMPILER_STRING_VERSION}") |
| else() |
| SET (CPack_COMPILER_STRING "-gcc${CPack_COMPILER_STRING_VERSION}") |
| endif() |
| endif (CMAKE_COMPILER_IS_GNUCXX) |
| endif() |
| message(STATUS "Using compiler ${CPack_COMPILER_STRING}") |
| endif(My_COMPILER) |
| endmacro( hepmc_find_compiler ) |
| macro( compiler_status ) |
| hepmc_find_compiler() |
| message(STATUS " ") |
| message(STATUS "C++ compiler: ${CMAKE_CXX_COMPILER}") |
| message(STATUS "Compiler version: ${COMPILER_VERSION}") |
| message(STATUS "Compiler string for cpack: ${CPack_COMPILER_STRING}") |
| message(STATUS " ") |
| endmacro( compiler_status ) |
| /trunk/cmake/Modules/HepMCOutOfSourceBuild.cmake |
|---|
| New file |
| 0,0 → 1,20 |
| # Throw a fatal error if cmake is invoked from within the source code directory tree |
| # hepmc_ensure_out_of_source_build() |
| # |
| macro (hepmc_ensure_out_of_source_build) |
| string(COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" in_source) |
| string( REGEX MATCH "${CMAKE_SOURCE_DIR}/" in_source_subdir "${CMAKE_BINARY_DIR}") |
| if (in_source OR in_source_subdir) |
| message(FATAL_ERROR " |
| ERROR: In source builds of this project are not allowed. |
| A separate build directory is required. |
| Please create one and run cmake from the build directory. |
| Also note that cmake has just added files to your source code directory. |
| We suggest getting a new copy of the source code. |
| Otherwise, delete `CMakeCache.txt' and the directory `CMakeFiles'. |
| ") |
| endif () |
| endmacro (hepmc_ensure_out_of_source_build) |
| /trunk/cmake/Modules/HepMCUseCpack.cmake |
|---|
| New file |
| 0,0 → 1,45 |
| # define the environment for cpack |
| # |
| include(HepMCFindCompiler) |
| # note that hepmc_parse_version is used to define VERSION_MAJOR, etc. |
| set( CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR} ) |
| set( CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR} ) |
| set( CPACK_PACKAGE_VERSION_PATCH ${VERSION_PATCH} ) |
| set( CPACK_INCLUDE_TOPLEVEL_DIRECTORY 0 ) |
| set( CPACK_GENERATOR TGZ ) |
| hepmc_find_compiler() |
| if ( ${SLTYPE} MATCHES "noarch" ) |
| set( PACKAGE_BASENAME ${SLTYPE} ) |
| else () |
| if ( NOT CPack_COMPILER_STRING ) |
| set( PACKAGE_BASENAME ${SLTYPE}-${CMAKE_SYSTEM_PROCESSOR} ) |
| else () |
| set( PACKAGE_BASENAME ${SLTYPE}-${CMAKE_SYSTEM_PROCESSOR}${CPack_COMPILER_STRING} ) |
| endif () |
| endif () |
| if ( NOT qualifier ) |
| set( CPACK_SYSTEM_NAME ${PACKAGE_BASENAME} ) |
| else () |
| set( CPACK_SYSTEM_NAME ${PACKAGE_BASENAME}-${qualifier} ) |
| endif () |
| # check for extra qualifiers |
| if( NOT CMAKE_BUILD_TYPE ) |
| SET( CMAKE_BUILD_TYPE_TOLOWER default ) |
| else() |
| STRING(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_TOLOWER) |
| if( ${CMAKE_BUILD_TYPE_TOLOWER} MATCHES "debug") |
| set(CPACK_SYSTEM_NAME ${CPACK_SYSTEM_NAME}-debug ) |
| elseif( ${CMAKE_BUILD_TYPE_TOLOWER} MATCHES "release") |
| set(CPACK_SYSTEM_NAME ${CPACK_SYSTEM_NAME}-opt ) |
| elseif( ${CMAKE_BUILD_TYPE_TOLOWER} MATCHES "minsizerel") |
| set(CPACK_SYSTEM_NAME ${CPACK_SYSTEM_NAME}-prof ) |
| endif() |
| endif() |
| message(STATUS "CPACK_SYSTEM_NAME = ${CPACK_SYSTEM_NAME}" ) |
| include(CPack) |
| /trunk/cmake/Modules/HepMCBuildTest.cmake |
|---|
| New file |
| 0,0 → 1,45 |
| # Create the tests |
| # |
| # if using a shell script: |
| # hepmc_test( testname ) |
| # where testname is the base name of the .cc and .sh.in file |
| # hepmc_simple_test( testname ) |
| # where there is no .sh - just an executable |
| # |
| macro( hepmc_test testname ) |
| message( STATUS "building ${testname} for ${testname}.sh" ) |
| link_libraries( HepMC ) |
| find_file( ${testname}_source ${testname}.cc ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ) |
| ADD_EXECUTABLE(${testname} ${${testname}_source} ${ARGN} ) |
| if( ${CMAKE_SYSTEM_NAME} MATCHES "Windows" ) |
| message( STATUS "skipping ${testname}.sh on ${CMAKE_SYSTEM_NAME}") |
| else() |
| # automake/autoconf variables for ${testname}.sh.in |
| set(srcdir ${CMAKE_CURRENT_SOURCE_DIR} ) |
| set(builddir ${CMAKE_CURRENT_BINARY_DIR} ) |
| configure_file( ${testname}.sh.in |
| ${CMAKE_CURRENT_BINARY_DIR}/${testname}.sh @ONLY ) |
| add_test( ${testname}.sh ${CMAKE_CURRENT_BINARY_DIR}/${testname}.sh ) |
| endif() |
| endmacro( hepmc_test ) |
| macro( hepmc_simple_test testname ) |
| message( STATUS "building simple test ${testname} " ) |
| # include test in search path |
| include_directories ("${CMAKE_CURRENT_SOURCE_DIR}") |
| link_libraries( HepMC ) |
| find_file( ${testname}_source ${testname}.cc ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ) |
| #message(STATUS "building simple test ${testname} from ${${testname}_source}") |
| ADD_EXECUTABLE(${testname} ${${testname}_source} ${ARGN} ) |
| add_test( ${testname} ${testname} ) |
| endmacro( hepmc_simple_test ) |
| /trunk/cmake/Modules/HepMCParseVersion.cmake |
|---|
| New file |
| 0,0 → 1,12 |
| # parse a version string and set the cmake project subversions |
| # |
| # hepmc_parse_version( ) |
| macro( hepmc_parse_version ) |
| STRING( REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+\\.[0-9]+.*" "\\1" VERSION_MAJOR "${version}" ) |
| STRING( REGEX REPLACE "^[0-9]+\\.([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" VERSION_MINOR "${version}" ) |
| STRING( REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+)\\.[0-9]+.*" "\\1" VERSION_PATCH "${version}" ) |
| message(STATUS "${project} version ${version} parses to ${VERSION_MAJOR} ${VERSION_MINOR} ${VERSION_PATCH}" ) |
| endmacro( hepmc_parse_version ) |
| /trunk/src/CMakeLists.txt |
|---|
| New file |
| 0,0 → 1,39 |
| set ( hepmc_source_list |
| CompareGenEvent.cc |
| Flow.cc |
| GenEvent.cc |
| GenEventStreamIO.cc |
| GenParticle.cc |
| GenCrossSection.cc |
| GenVertex.cc |
| GenRanges.cc |
| HeavyIon.cc |
| IO_AsciiParticles.cc |
| IO_GenEvent.cc |
| PdfInfo.cc |
| Polarization.cc |
| SearchVector.cc |
| StreamHelpers.cc |
| StreamInfo.cc |
| ${CMAKE_CURRENT_BINARY_DIR}/Units.cc |
| WeightContainer.cc |
| ) |
| #message(STATUS "default momentum and length are ${HEPMC_DEFAULT_MOM_UNIT} ${HEPMC_DEFAULT_LEN_UNIT}") |
| configure_file( Units.cc.in ${CMAKE_CURRENT_BINARY_DIR}/Units.cc @ONLY ) |
| ADD_LIBRARY (HepMC SHARED ${hepmc_source_list}) |
| ADD_LIBRARY (HepMCS STATIC ${hepmc_source_list}) |
| SET_TARGET_PROPERTIES (HepMC PROPERTIES OUTPUT_NAME HepMC ) |
| SET_TARGET_PROPERTIES (HepMCS PROPERTIES OUTPUT_NAME HepMC ) |
| SET_TARGET_PROPERTIES(HepMC PROPERTIES CLEAN_DIRECT_OUTPUT 1) |
| SET_TARGET_PROPERTIES(HepMCS PROPERTIES CLEAN_DIRECT_OUTPUT 1) |
| INSTALL (TARGETS HepMC HepMCS |
| RUNTIME DESTINATION bin |
| LIBRARY DESTINATION lib |
| ARCHIVE DESTINATION lib |
| ) |
| /trunk/HepMC/CMakeLists.txt |
|---|
| New file |
| 0,0 → 1,44 |
| set( pkginclude_HEADERS |
| CompareGenEvent.h |
| Flow.h |
| GenEvent.h |
| GenParticle.h |
| GenVertex.h |
| GenCrossSection.h |
| GenRanges.h |
| HeavyIon.h |
| HEPEVT_Wrapper.h |
| HerwigWrapper.h |
| IO_AsciiParticles.h |
| IO_BaseClass.h |
| IO_Exception.h |
| IO_GenEvent.h |
| IO_HEPEVT.h |
| IO_HERWIG.h |
| IteratorRange.h |
| PdfInfo.h |
| Polarization.h |
| PythiaWrapper6_4.h |
| PythiaWrapper6_4_WIN32.h |
| PythiaWrapper.h |
| WeightContainer.h |
| SearchVector.h |
| SimpleVector.h |
| SimpleVector.icc |
| StreamHelpers.h |
| StreamInfo.h |
| enable_if.h |
| is_arithmetic.h |
| TempParticleMap.h |
| Units.h |
| Version.h |
| HepMCDefs.h |
| ) |
| CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/cmake-defs.h.in |
| ${CMAKE_CURRENT_BINARY_DIR}/defs.h @ONLY ) |
| INSTALL (FILES ${pkginclude_HEADERS} |
| ${CMAKE_CURRENT_BINARY_DIR}/defs.h |
| DESTINATION include/HepMC ) |
| /trunk/doc/CMakeLists.txt |
|---|
| New file |
| 0,0 → 1,110 |
| # build HepMC documentation |
| # for documentation |
| find_package(LATEX) |
| find_package(Doxygen) |
| macro( hepmc_latex package main_tex_file ) |
| IF(LATEX_COMPILER) |
| FOREACH(arg ${ARGN}) |
| CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/${arg} |
| ${CMAKE_CURRENT_BINARY_DIR}/${arg} COPYONLY) |
| set( depend_list ${arg} ${depend_list} ) |
| ENDFOREACH(arg) |
| ##message(STATUS "${package} ${main_tex_file} depends on ${depend_list}" ) |
| ADD_CUSTOM_COMMAND( |
| OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${main_tex_file}.aux |
| COMMAND ${LATEX_COMPILER} |
| -interaction=batchmode ${CMAKE_CURRENT_SOURCE_DIR}/${main_tex_file} |
| DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${main_tex_file}.tex ${depend_list} |
| COMMENT "Latex - first pass" |
| ) |
| ADD_CUSTOM_COMMAND( |
| OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${main_tex_file}.dvi |
| COMMAND ${LATEX_COMPILER} |
| -interaction=batchmode ${CMAKE_CURRENT_SOURCE_DIR}/${main_tex_file} |
| DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${main_tex_file}.aux |
| COMMENT "Latex - second pass" |
| ) |
| ADD_CUSTOM_COMMAND( |
| OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${main_tex_file}.log |
| COMMAND ${LATEX_COMPILER} |
| -interaction=batchmode ${CMAKE_CURRENT_SOURCE_DIR}/${main_tex_file} |
| DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${main_tex_file}.dvi |
| COMMENT "Latex - third pass" |
| ) |
| ADD_CUSTOM_TARGET(${main_tex_file} ALL echo |
| DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${main_tex_file}.log |
| ) |
| IF(DVIPS_CONVERTER) |
| ADD_CUSTOM_COMMAND( |
| OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${main_tex_file}.ps |
| COMMAND ${DVIPS_CONVERTER} |
| ${CMAKE_CURRENT_BINARY_DIR}/${main_tex_file}.dvi |
| -o ${CMAKE_CURRENT_BINARY_DIR}/${main_tex_file}.ps |
| DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${main_tex_file}.dvi |
| COMMENT "dvi2ps" |
| ) |
| IF(PS2PDF_CONVERTER) |
| ADD_CUSTOM_COMMAND( |
| OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${main_tex_file}.pdf |
| COMMAND ${PS2PDF_CONVERTER} |
| ${CMAKE_CURRENT_BINARY_DIR}/${main_tex_file}.ps |
| DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${main_tex_file}.ps |
| COMMENT "ps2pdf" |
| ) |
| ADD_CUSTOM_TARGET( ${package}${main_tex_file}Document ALL echo |
| DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${main_tex_file}.pdf |
| ) |
| ENDIF(PS2PDF_CONVERTER) |
| ENDIF(DVIPS_CONVERTER) |
| ENDIF(LATEX_COMPILER) |
| INSTALL (FILES ${CMAKE_CURRENT_BINARY_DIR}/${main_tex_file}.pdf |
| DESTINATION share/HepMC/doc ) |
| endmacro( hepmc_latex ) |
| if ( build_docs ) |
| # use the macro to build the user manual |
| hepmc_latex( HepMC HepMC2_user_manual |
| graph_interpretation.eps |
| HepMC_basic_properties.eps |
| physicist_visualization.eps ) |
| # now try doxygen |
| IF (DOXYGEN_FOUND) |
| SET(DOXYGEN_INPUT doxygen.conf) |
| SET(DOXYGEN_OUTPUT ${CMAKE_BINARY_DIR}/html/index.html ) |
| ADD_CUSTOM_COMMAND( |
| OUTPUT ${DOXYGEN_OUTPUT} |
| COMMAND ${CMAKE_COMMAND} -E echo_append "Building HepMC Documentation..." |
| COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_INPUT} |
| COMMAND ${CMAKE_COMMAND} -E echo "Done." |
| WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} |
| DEPENDS ${DOXYGEN_INPUT} |
| ) |
| ADD_CUSTOM_TARGET(hepmcdoc ALL DEPENDS ${DOXYGEN_OUTPUT}) |
| ADD_CUSTOM_TARGET(hepmcdoc_forced |
| COMMAND ${CMAKE_COMMAND} -E echo_append "Building API Documentation..." |
| COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_INPUT} |
| COMMAND ${CMAKE_COMMAND} -E echo "Done." |
| WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} |
| ) |
| ENDIF (DOXYGEN_FOUND) |
| else( build_docs ) |
| # look for existing pdf files |
| FILE( GLOB pdf_files *.pdf ) |
| INSTALL (FILES ${pdf_files} |
| DESTINATION share/HepMC/doc ) |
| endif( build_docs ) |
| /trunk/INSTALL |
|---|
| 2,9 → 2,14 |
| # installing HepMC |
| #------------------------------------------------------------- |
| Although it is possible to build the HepMC libraries from this directory, |
| Although it may be possible to build the HepMC libraries from this directory, |
| we recommend that you create a separate build directory and work from there. |
| The directions below explain how to build with autoconf, etc. |
| As of HepMC 2.06.06, you also have the option to build with cmake. |
| We highly recommend that you build with cmake, as explained in |
| cmake/INSTALL. Using cmake is preferred for MacOSX and Windows. |
| #------------------------------------------------------------- |
| # platform specific issues |
| #------------------------------------------------------------- |
| /trunk/CMakeLists.txt |
|---|
| New file |
| 0,0 → 1,82 |
| #------------------------------------------------------------------------------ |
| # Top Level CMakeLists.txt for HepMC |
| # cmake -Dmomentum:STRING=[MEV|GEV] -Dlength:STRING=[MM|CM] |
| # [-DCMAKE_INSTALL_PREFIX=/install/path] |
| # [-DCMAKE_BUILD_TYPE=Debug|Release|RelWithDebInfo|MinSizeRel] |
| # [-Dbuild_docs:BOOL=ON] |
| # /path/to/source |
| # make |
| # make test |
| # make install |
| # |
| # The default HepMC build type is CMAKE_BUILD_TYPE=RelWithDebInfo, |
| # which matches the default HepMC autoconf flags |
| #------------------------------------------------------------------------------ |
| # use cmake 2.6 or later |
| cmake_minimum_required (VERSION 2.6) |
| # project name and version |
| project(HepMC) |
| set( version 2.06.05 ) |
| if ( momentum ) |
| set( HEPMC_DEFAULT_MOM_UNIT ${momentum} ) |
| else() |
| message(FATAL_ERROR "You must specify the momentum units with -Dmomentum:STRING=[MEV|GEV]") |
| endif() |
| if ( length ) |
| set( HEPMC_DEFAULT_LEN_UNIT ${length} ) |
| else() |
| message(FATAL_ERROR "You must specify the length units with -Dlength:STRING=[MM|CM]") |
| endif() |
| # find the HepMC cmake modules |
| set(CMAKE_MODULE_PATH "${CMAKE_ROOT}/Modules") |
| set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules ${CMAKE_MODULE_PATH}) |
| message(STATUS "module path is ${CMAKE_MODULE_PATH}" ) |
| # make sure we are not building from within the source code directory |
| include(HepMCOutOfSourceBuild) |
| hepmc_ensure_out_of_source_build() |
| # build_docs is OFF (false) by default |
| if ( build_docs ) |
| message(STATUS "documents WILL be built and installed" ) |
| else() |
| message(STATUS "documents WILL NOT be installed" ) |
| endif() |
| # various handy macros |
| include(HepMCVariables) |
| include(HepMCParseVersion) |
| include(CMakeDetermineFortranCompiler) |
| # because we want to move these libraries about, |
| # do not embed full path in shared libraries or executables |
| set (CMAKE_SKIP_RPATH) |
| ENABLE_TESTING() |
| # include search path |
| include_directories ("${CMAKE_CURRENT_SOURCE_DIR}") |
| #build all libraries in a single directory to facilitate testing |
| SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib) |
| # set our preferred compiler flags and other variables |
| hepmc_parse_version() |
| hepmc_set_compiler_flags() |
| add_subdirectory(HepMC) |
| add_subdirectory(src) |
| add_subdirectory(fio) |
| add_subdirectory(test) |
| add_subdirectory(examples) |
| add_subdirectory(doc) |
| # Packaging utility |
| include(HepMCUseCpack) |
| /trunk/fio/CMakeLists.txt |
|---|
| New file |
| 0,0 → 1,22 |
| set ( fio_source_list |
| HEPEVT_Wrapper.cc |
| HerwigWrapper.cc |
| IO_HEPEVT.cc |
| IO_HERWIG.cc |
| ) |
| ADD_LIBRARY (HepMCfio SHARED ${fio_source_list}) |
| ADD_LIBRARY (HepMCfioS STATIC ${fio_source_list}) |
| SET_TARGET_PROPERTIES (HepMCfio PROPERTIES OUTPUT_NAME HepMCfio ) |
| SET_TARGET_PROPERTIES (HepMCfioS PROPERTIES OUTPUT_NAME HepMCfio ) |
| SET_TARGET_PROPERTIES(HepMCfio PROPERTIES CLEAN_DIRECT_OUTPUT 1) |
| SET_TARGET_PROPERTIES(HepMCfioS PROPERTIES CLEAN_DIRECT_OUTPUT 1) |
| target_link_libraries(HepMCfio HepMC ) |
| target_link_libraries(HepMCfioS HepMC ) |
| INSTALL (TARGETS HepMCfio HepMCfioS |
| RUNTIME DESTINATION bin |
| LIBRARY DESTINATION lib |
| ARCHIVE DESTINATION lib |
| ) |
| /trunk/examples/CMakeLists.txt |
|---|
| New file |
| 0,0 → 1,19 |
| include(HepMCFindCompiler) |
| set( example_code |
| example_BuildEventFromScratch.cc |
| example_EventSelection.cc |
| example_UsingIterators.cc |
| example_UsingIterators.txt |
| example_VectorConversion.cc |
| VectorConversion.h |
| ) |
| CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/GNUmakefile.example.in |
| ${CMAKE_CURRENT_BINARY_DIR}/GNUmakefile @ONLY ) |
| INSTALL (FILES ${example_code} |
| ${CMAKE_CURRENT_BINARY_DIR}/GNUmakefile |
| DESTINATION share/HepMC/examples ) |
| add_subdirectory(fio) |
| /trunk/examples/fio/CMakeLists.txt |
|---|
| New file |
| 0,0 → 1,19 |
| set( example_code |
| example_MyHerwig.cc |
| example_MyPythia.cc |
| example_MyPythiaOnlyToHepMC.cc |
| example_PythiaStreamIO.cc |
| initpydata.f |
| initPythia.cc |
| PythiaHelper.h |
| testHerwigCopies.cc |
| testPythiaCopies.cc |
| ) |
| CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/GNUmakefile.example.in |
| ${CMAKE_CURRENT_BINARY_DIR}/GNUmakefile @ONLY ) |
| INSTALL (FILES ${example_code} |
| ${CMAKE_CURRENT_BINARY_DIR}/GNUmakefile |
| DESTINATION share/HepMC/examples/fio ) |