Commit in lcdd on MAIN | |||
CMakeLists.txt | +84 | added 1.1 | |
cmake/FindXERCES.cmake | +14 | added 1.1 | |
/LCDDConfig.cmake.in | +26 | added 1.1 | |
/LCDDConfigVersion.cmake.in | +11 | added 1.1 | |
+135 |
first working version of CMake build for LCDD
diff -N CMakeLists.txt --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ CMakeLists.txt 10 Apr 2013 22:32:02 -0000 1.1 @@ -0,0 +1,84 @@
+# +# CMake configuration for LCDD library. +# +# @author Jeremy McCormick <[log in to unmask]> +# + +# minimum cmake version +CMAKE_MINIMUM_REQUIRED( VERSION 2.8 ) + +# project name +PROJECT( LCDD ) + +# project version +SET( LCDD_VERSION_MAJOR 3 ) +SET( LCDD_VERSION_MINOR 0 ) +SET( LCDD_VERSION_PATCH 0 ) + +# find ilcutil +FIND_PACKAGE( ILCUTIL COMPONENTS ILCSOFT_CMAKE_MODULES REQUIRED ) + +# load default settings from ILCSOFT_CMAKE_MODULES +INCLUDE( ilcsoft_default_settings ) +INCLUDE( ExternalProject ) + +# add path containing CMake macros for this project +LIST( APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake ) + +# macro for generating configuration output +INCLUDE( MacroGeneratePackageConfigFiles ) + +# find Xerces C++ +find_package ( XERCES REQUIRED ) +IF( NOT XERCES_FOUND ) + MESSAGE( FATAL_ERROR "Xerces was not found! Define XERCES_DIR when calling cmake." ) +ENDIF() + +# find Geant4 +find_package(Geant4 REQUIRED) +if ( NOT Geant4_FOUND ) + MESSAGE( FATAL_ERROR "Geant4 was not found! Define Geant4_DIR when calling cmake." ) +ELSE() + MESSAGE( STATUS "Found Geant4: ${Geant4_DIR}" ) +ENDIF() + +# find GDML +find_package(GDML REQUIRED) +if ( NOT GDML_FOUND ) + MESSAGE( FATAL_ERROR "Geant4 was not found! Define GDML_DIR when calling cmake." ) +ELSE() + MESSAGE( STATUS "Found GDML: ${GDML_DIR}" ) +ENDIF() + +# local includes +SET( LCDD_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/include ) +INCLUDE_DIRECTORIES( ${LCDD_INCLUDE_DIR} ) + +# get list of LCDD sources +FILE( GLOB_RECURSE library_sources ${PROJECT_SOURCE_DIR}/src/*.cc ) + +# default compilation flags +ADD_DEFINITIONS( "-Wall -ansi -pedantic" ) +ADD_DEFINITIONS( "-Wno-long-long" ) + +# additional compilation flags +ADD_DEFINITIONS( ${Geant4_DEFINITIONS} ) + +# include directories +INCLUDE_DIRECTORIES( ${XERCES_INCLUDE_DIR} ${Geant4_INCLUDE_DIRS} ${GDML_INCLUDE_DIRS} ) + +# add GDML link directory +LINK_DIRECTORIES( ${GDML_LIBRARY_DIR} ) + +# libraries +LINK_LIBRARIES( ${XERCES_LIBRARY} ${Geant4_LIBRARIES} ${GDML_LIBRARY} ) + +# output shared library +ADD_LIBRARY( lcdd SHARED ${library_sources} ) + +# install library +SET( LCDD_LIB_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/lib ) +INSTALL( TARGETS lcdd DESTINATION ${CMAKE_INSTALL_PREFIX}/lib ) + +# generate package configuration +GENERATE_PACKAGE_CONFIGURATION_FILES( LCDDConfig.cmake LCDDConfigVersion.cmake LCDDLibDeps.cmake )
\ No newline at end of file
diff -N FindXERCES.cmake --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ FindXERCES.cmake 10 Apr 2013 22:32:03 -0000 1.1 @@ -0,0 +1,14 @@
+if(WIN32) + set(XERCES_LIBRARY_NAMES xerces-c_3) +else(WIN32) + set(XERCES_LIBRARY_NAMES xerces-c) +endif(WIN32) + +FIND_PATH(XERCES_INCLUDE_DIR xercesc/sax/InputSource.hpp xercesc/dom/DOMDocument.hpp xercesc/dom/DOMErrorHandler.hpp ${XERCES_DIR}/include) + +FIND_LIBRARY(XERCES_LIBRARY ${XERCES_LIBRARY_NAMES} ${XERCES_DIR}/lib /usr/lib64 /usr/lib /usr/local/lib64 /usr/local/lib) + +# Report the found libraries, quit with fatal error if any required library has not been found. +INCLUDE(FindPackageHandleStandardArgs) + +FIND_PACKAGE_HANDLE_STANDARD_ARGS(XERCES DEFAULT_MSG XERCES_LIBRARY XERCES_INCLUDE_DIR)
\ No newline at end of file
diff -N LCDDConfig.cmake.in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ LCDDConfig.cmake.in 10 Apr 2013 22:32:03 -0000 1.1 @@ -0,0 +1,26 @@
+############################################################################## +# cmake configuration file for LCDD +# +# LCDD_INCLUDE_DIRS +# LCDD_LIBRARIES +# +# requires: +# MacroCheckPackageLibs.cmake for checking package libraries +############################################################################## + +SET( LCDD_DIR "@CMAKE_INSTALL_PREFIX@" ) +SET( LCDD_VERSION "@LCDD_VERSION@" ) + +INCLUDE( "@[log in to unmask]" ) + +SET( LCDD_INCLUDE_DIR "@LCDD_INCLUDE_DIR@" ) + +SET( LCDD_LIBRARY lcdd) + +SET( LCDD_LIBRARY_DIR "@LCDD_LIB_INSTALL_DIR@" ) + +INCLUDE( "${LCDD_DIR}/lib/cmake/LCDDLibDeps.cmake" ) + +INCLUDE( FindPackageHandleStandardArgs ) + +FIND_PACKAGE_HANDLE_STANDARD_ARGS( LCDD DEFAULT_MSG LCDD_DIR LCDD_INCLUDE_DIRS LCDD_LIBRARY LCDD_LIBRARY_DIR ${LCDD_COMPONENT_VARIABLES} )
diff -N LCDDConfigVersion.cmake.in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ LCDDConfigVersion.cmake.in 10 Apr 2013 22:32:03 -0000 1.1 @@ -0,0 +1,11 @@
+############################################################################## +# this file is parsed when FIND_PACKAGE is called with version argument +############################################################################## + +SET( ${PACKAGE_FIND_NAME}_VERSION_MAJOR @LCDD_VERSION_MAJOR@ ) +SET( ${PACKAGE_FIND_NAME}_VERSION_MINOR @LCDD_VERSION_MINOR@ ) +SET( ${PACKAGE_FIND_NAME}_VERSION_PATCH @LCDD_VERSION_PATCH@ ) + +INCLUDE( "@[log in to unmask]" ) + +CHECK_PACKAGE_VERSION( ${PACKAGE_FIND_NAME} @LCDD_VERSION@ )
Use REPLY-ALL to reply to list
To unsubscribe from the LCD-CVS list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=LCD-CVS&A=1