Commit in gdml2/CPPGDML on MAIN | |||
CMakeLists.txt | +7 | 1.1 -> 1.2 | |
cmake/FindPackageHandleStandardArgs.cmake | -58 | 1.1 removed | |
/MacroCheckPackageLibs.cmake | -164 | 1.1 removed | |
/MacroCheckPackageVersion.cmake | -108 | 1.1 removed | |
/MacroGeneratePackageConfigFiles.cmake | -44 | 1.1 removed | |
+7 | -374 |
depend on ILCUTIL in order to avoid duplicate CMake macros in every package
diff -u -r1.1 -r1.2 --- CMakeLists.txt 10 Apr 2013 20:36:42 -0000 1.1 +++ CMakeLists.txt 10 Apr 2013 21:00:12 -0000 1.2 @@ -17,6 +17,13 @@
SET( GDML_VERSION_MINOR 0 ) SET( GDML_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 )
diff -N FindPackageHandleStandardArgs.cmake --- FindPackageHandleStandardArgs.cmake 10 Apr 2013 20:36:42 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,58 +0,0 @@
-# FIND_PACKAGE_HANDLE_STANDARD_ARGS(NAME (DEFAULT_MSG|"Custom failure message") VAR1 ... ) -# This macro is intended to be used in FindXXX.cmake modules files. -# It handles the REQUIRED and QUIET argument to FIND_PACKAGE() and -# it also sets the <UPPERCASED_NAME>_FOUND variable. -# The package is found if all variables listed are TRUE. -# Example: -# -# FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXml2 DEFAULT_MSG LIBXML2_LIBRARIES LIBXML2_INCLUDE_DIR) -# -# LibXml2 is considered to be found, if both LIBXML2_LIBRARIES and -# LIBXML2_INCLUDE_DIR are valid. Then also LIBXML2_FOUND is set to TRUE. -# If it is not found and REQUIRED was used, it fails with FATAL_ERROR, -# independent whether QUIET was used or not. -# If it is found, the location is reported using the VAR1 argument, so -# here a message "Found LibXml2: /usr/lib/libxml2.so" will be printed out. -# If the second argument is DEFAULT_MSG, the message in the failure case will -# be "Could NOT find LibXml2", if you don't like this message you can specify -# your own custom failure message there. - -MACRO(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FAIL_MSG _VAR1 ) - - IF("${_FAIL_MSG}" STREQUAL "DEFAULT_MSG") - IF (${_NAME}_FIND_REQUIRED) - SET(_FAIL_MESSAGE "Could not find REQUIRED package ${_NAME}") - ELSE (${_NAME}_FIND_REQUIRED) - SET(_FAIL_MESSAGE "Could not find OPTIONAL package ${_NAME}") - ENDIF (${_NAME}_FIND_REQUIRED) - ELSE("${_FAIL_MSG}" STREQUAL "DEFAULT_MSG") - SET(_FAIL_MESSAGE "${_FAIL_MSG}") - ENDIF("${_FAIL_MSG}" STREQUAL "DEFAULT_MSG") - - STRING(TOUPPER ${_NAME} _NAME_UPPER) - - SET(${_NAME_UPPER}_FOUND TRUE) - IF(NOT ${_VAR1}) - SET(${_NAME_UPPER}_FOUND FALSE) - ENDIF(NOT ${_VAR1}) - - FOREACH(_CURRENT_VAR ${ARGN}) - IF(NOT ${_CURRENT_VAR}) - SET(${_NAME_UPPER}_FOUND FALSE) - ENDIF(NOT ${_CURRENT_VAR}) - ENDFOREACH(_CURRENT_VAR) - - IF (${_NAME_UPPER}_FOUND) - IF (NOT ${_NAME}_FIND_QUIETLY) - MESSAGE(STATUS "Found ${_NAME}: ${${_VAR1}}") - ENDIF (NOT ${_NAME}_FIND_QUIETLY) - ELSE (${_NAME_UPPER}_FOUND) - IF (${_NAME}_FIND_REQUIRED) - MESSAGE(FATAL_ERROR "${_FAIL_MESSAGE}") - ELSE (${_NAME}_FIND_REQUIRED) - IF (NOT ${_NAME}_FIND_QUIETLY) - MESSAGE(STATUS "${_FAIL_MESSAGE}") - ENDIF (NOT ${_NAME}_FIND_QUIETLY) - ENDIF (${_NAME}_FIND_REQUIRED) - ENDIF (${_NAME_UPPER}_FOUND) -ENDMACRO(FIND_PACKAGE_HANDLE_STANDARD_ARGS)
diff -N MacroCheckPackageLibs.cmake --- MacroCheckPackageLibs.cmake 10 Apr 2013 20:36:42 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,164 +0,0 @@
-############################################################################## -# macro for checkin package libraries in ${PKG_ROOT}/lib -# -# -# macro usage: -# CHECK_PACKAGE_LIBS( PACKAGE_NAME stdlib1 stdlib2 ... stdlibn ) -# only standard libraries should be passed as arguments to the macro -# component libraries are set by cmake in PKG_FIND_COMPONENTS (when -# calling FIND_PACKAGE with COMPONENTS argument) or through the -# variable PKG_USE_COMPONENTS -# -# -# required variables: -# PKG_ROOT : path to PKG root directory -# -# -# returns following variables: -# PKG_LIBRARY_DIRS : list of paths to be used with LINK_DIRECTORIES -# PGK_LIBRARIES : list of STANDARD libraries (NOT including COMPONENTS) -# PKG_COMPONENT_LIBRARIES : list of COMPONENT libraries -# PKG_${COMPONENT}_FOUND : set to TRUE or FALSE for each library -# PKG_${COMPONENT}_LIBRARY : path to each individual library -# -# -# PKG_LIBRARIES and PKG_LIBRARY_DIRS will be empty if any of the standard -# libraries is missing -# -# @author Jan Engels, Desy -############################################################################## - - -SET( CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS TRUE ) - -MACRO( CHECK_PACKAGE_LIBS _pkgname ) - - SET( _std_lib_missing FALSE ) - SET( _ext_lib_missing FALSE ) - - SET( _std_libnames ${ARGN} ) - SET( _ext_libnames ${${_pkgname}_FIND_COMPONENTS} ${${_pkgname}_USE_COMPONENTS} ) - - IF( _ext_libnames ) - SEPARATE_ARGUMENTS( _ext_libnames ) - LIST( REMOVE_DUPLICATES _ext_libnames ) - ENDIF() - - IF( NOT ${_pkgname}_FIND_QUIETLY ) - MESSAGE( STATUS "Check for ${_pkgname}_LIBRARIES: ${_std_libnames}" ) - IF( _ext_libnames ) - MESSAGE( STATUS "Check for ${_pkgname}_COMPONENT_LIBRARIES: ${_ext_libnames}" ) - ENDIF() - ENDIF() - - SET( ${_pkgname}_LIBRARY_DIRS ) - MARK_AS_ADVANCED( ${_pkgname}_LIBRARY_DIRS ) - - SET( ${_pkgname}_LIBRARIES ) - MARK_AS_ADVANCED( ${_pkgname}_LIBRARIES ) - - SET( ${_pkgname}_COMPONENT_LIBRARIES ) - MARK_AS_ADVANCED( ${_pkgname}_COMPONENT_LIBRARIES ) - - SET( ${_pkgname}_COMPONENT_VARIABLES ) - MARK_AS_ADVANCED( ${_pkgname}_COMPONENT_VARIABLES ) - - FOREACH( _libname ${_std_libnames} ${_ext_libnames} ) - - # flag to check if it is a standard or a component library - LIST( FIND _std_libnames "${_libname}" _aux ) - IF( ${_aux} LESS 0 ) - SET( _is_std_lib FALSE ) - ELSE() - SET( _is_std_lib TRUE ) - ENDIF() - - # libname in upper case - STRING( TOUPPER ${_libname} _ulibname ) - - SET( ${_pkgname}_${_ulibname}_LIBRARY ${_pkgname}_${_ulibname}_LIBRARY-NOTFOUND ) - MARK_AS_ADVANCED( ${_pkgname}_${_ulibname}_LIBRARY ) - - # WARNING: using PATH_SUFFIXES may cause problems when using variable CMAKE_FIND_ROOT_PATH - # this problem does not occur if expanding PATHS - # look in FindMySQL.cmake for more info - #FIND_LIBRARY( ${_pkgname}_${_ulibname}_LIBRARY NAMES ${_libname} PATHS - # ${${_pkgname}_ROOT} ${${_pkgname}_DIR} ${${_pkgname}_LIB_SEARCH_PATH} - # PATH_SUFFIXES lib64 lib - # NO_DEFAULT_PATH - #) - - FIND_LIBRARY( ${_pkgname}_${_ulibname}_LIBRARY NAMES ${_libname} PATHS - ${${_pkgname}_ROOT}/lib64 ${${_pkgname}_ROOT}/lib - ${${_pkgname}_DIR}/lib64 ${${_pkgname}_DIR}/lib - ${${_pkgname}_LIB_SEARCH_PATH} ${${_pkgname}_LIB_SEARCH_PATH}/lib64 ${${_pkgname}_LIB_SEARCH_PATH}/lib - NO_DEFAULT_PATH - ) - - IF( NOT ${_pkgname}_DIR ) - FIND_LIBRARY( ${_pkgname}_${_ulibname}_LIBRARY NAMES ${_libname} ) - ENDIF() - - IF( ${_pkgname}_FIND_REQUIRED ) - LIST( APPEND ${_pkgname}_COMPONENT_VARIABLES ${_pkgname}_${_ulibname}_LIBRARY ) - ENDIF() - - IF( ${_pkgname}_${_ulibname}_LIBRARY ) # if library found - - SET( ${_pkgname}_${_ulibname}_FOUND TRUE ) - - # split libraries in PKG_LIBRARIES and PKG_COMPONENT_LIBRARIES - IF( _is_std_lib ) - LIST( APPEND ${_pkgname}_LIBRARIES ${${_pkgname}_${_ulibname}_LIBRARY} ) - ELSE() - LIST( APPEND ${_pkgname}_COMPONENT_LIBRARIES ${${_pkgname}_${_ulibname}_LIBRARY} ) - ENDIF() - - GET_FILENAME_COMPONENT( _aux ${${_pkgname}_${_ulibname}_LIBRARY} PATH ) - LIST( APPEND ${_pkgname}_LIBRARY_DIRS ${_aux} ) - - IF( NOT ${_pkgname}_FIND_QUIETLY ) - MESSAGE( STATUS "Check for ${_pkgname}_${_ulibname}_LIBRARY: ${${_pkgname}_${_ulibname}_LIBRARY} -- ok" ) - ENDIF() - - ELSE() # library not found - - SET( ${_pkgname}_${_ulibname}_FOUND FALSE ) - - IF( _is_std_lib ) - SET( _std_lib_missing TRUE ) - ELSE() - SET( _ext_lib_missing TRUE ) - ENDIF() - - IF( NOT ${_pkgname}_FIND_QUIETLY ) - MESSAGE( STATUS "Check for ${_pkgname}_${_ulibname}_LIBRARY: ${_libname} -- failed" ) - ENDIF() - - ENDIF() - - ENDFOREACH() - - # clear PKG_LIBRARIES if standard library is missing - IF( _std_lib_missing ) - SET( ${_pkgname}_LIBRARIES ) - ENDIF() - - # clear PKG_COMPONENT_LIBRARIES if a component library is missing and - # FIND_PACKAGE called with REQUIRED argument - IF( _ext_lib_missing AND ${_pkgname}_FIND_REQUIRED ) - SET( ${_pkgname}_COMPONENT_LIBRARIES ) - ENDIF() - - # remove duplicate paths in PKG_LIBRARY_DIRS - IF( ${_pkgname}_LIBRARY_DIRS ) - LIST( REMOVE_DUPLICATES ${_pkgname}_LIBRARY_DIRS ) - ENDIF() - - # debug - #MESSAGE( STATUS "${_pkgname}_LIBRARIES: ${${_pkgname}_LIBRARIES}" ) - #MESSAGE( STATUS "${_pkgname}_COMPONENT_LIBRARIES: ${${_pkgname}_COMPONENT_LIBRARIES}" ) - #MESSAGE( STATUS "${_pkgname}_LIBRARY_DIRS: ${${_pkgname}_LIBRARY_DIRS}" ) - -ENDMACRO( CHECK_PACKAGE_LIBS _pkgname ) -
diff -N MacroCheckPackageVersion.cmake --- MacroCheckPackageVersion.cmake 10 Apr 2013 20:36:42 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,108 +0,0 @@
-############################################################################## -# macro for checking a package version -# -# this macro should be called from your PKGVersion.cmake or from a -# FindPKG.cmake module with the following arguments: -# _pkgname : The package name -# _iversion : The installed version of the package -# -# -# the following conventions are used: -# -# if FIND_PACKAGE is called with EXACT argument than the version has to -# match EXACTLY, i.e.: -# 1.5 == 1.5 -# 1.5 == 1.5.0 -# 1.5 == 1.5.0.0 -# 1.5.2 == 1.5.2.0 -# 1.5.2.1 == 1.5.2.1 -# 1.5.2 != 1.5.2.1 -# 1.5 != 1.5.0.1 -# -# -# otherwise a MINIMUM_REQUIRED version is checked for, i.e. the same -# behavior as with the cmake variable CMAKE_MINIMUM_REQUIRED, e.g.: -# searching: 1.2 --> installed: 1.5.2.2 --> compatible -# searching: 1.5 --> installed: 1.5.2.2 --> compatible -# searching: 1.5.2.1 --> installed: 1.5.2.2 --> compatible -# searching: 1.5.2.3 --> installed: 1.5.2.2 --> unsuitable -# searching: 1.7 --> installed: 1.5.2.2 --> unsuitable -# -# -# following variables are returned (internally to cmake): -# PACKAGE_VERSION_EXACT : set to TRUE if exact version was found -# PACKAGE_VERSION_COMPATIBLE : set to TRUE if version is compatible -# PACKAGE_VERSION_UNSUITABLE : set to TRUE if version found is unsuitable -# -# -# @author Jan Engels, Desy IT -############################################################################## - -# these variables are evaluated internally by the cmake command FIND_PACKAGE to mark this -# package as suitable or not depending on the required version -SET( PACKAGE_VERSION_EXACT FALSE ) -SET( PACKAGE_VERSION_COMPATIBLE TRUE ) -SET( PACKAGE_VERSION_UNSUITABLE FALSE ) - - -# cmake internal variable PACKAGE_FIND_NAME is not defined on FindPKG.cmake -# modules, therefore it is passed as an argument to the macro -# _iversion is the installed version of the package -# _sversion is the version searched by the user with FIND_PACKAGE -#MACRO( CHECK_PACKAGE_VERSION _pkgname _iversion ) -MACRO( CHECK_PACKAGE_VERSION _pkgname ) # left with one argument only for backwards compatibility - - IF( NOT "${ARGV1}" STREQUAL "" ) - SET( _iversion ${ARGV1} ) - ELSE() - SET( _iversion ${${_pkgname}_VERSION_MAJOR}.${${_pkgname}_VERSION_MINOR}.${${_pkgname}_VERSION_PATCH}.${${_pkgname}_VERSION_TWEAK} ) - ENDIF() - - #SET( _sversion_major ${${_pkgname}_FIND_VERSION_MAJOR} ) - #SET( _sversion_minor ${${_pkgname}_FIND_VERSION_MINOR} ) - - SET( _sversion ${${_pkgname}_FIND_VERSION} ) - - IF( NOT ${_pkgname}_FIND_QUIETLY ) - MESSAGE( STATUS "Check for ${_pkgname} (${_iversion})" ) - ENDIF() - - # only do work if FIND_PACKAGE called with a version argument - IF( _sversion ) - - #IF( NOT ${_pkgname}_FIND_QUIETLY ) - # MESSAGE( STATUS "Check for ${_pkgname}: looking for version ${_sversion}" ) - #ENDIF() - - IF( ${_iversion} VERSION_EQUAL ${_sversion} ) # if version matches EXACTLY - #IF( NOT ${_pkgname}_FIND_QUIETLY ) - # MESSAGE( STATUS "Check for ${_pkgname}: exact version found: ${_iversion}" ) - #ENDIF() - SET( PACKAGE_VERSION_EXACT TRUE ) - ELSE() # if version does not match EXACTLY, check if it is compatible/suitable - - # installed version must be greater or equal than version searched by the user, i.e. - # like with the CMAKE_MINIMUM_REQUIRED commando - # if user asks for version 1.2.5 then any version >= 1.2.5 is suitable/compatible - IF( NOT ${_sversion} VERSION_LESS ${_iversion} ) - SET( PACKAGE_VERSION_UNSUITABLE TRUE ) - ENDIF() - # ------------------------------------------------------------------------------------- - - IF( ${_pkgname}_FIND_VERSION_EXACT ) # if exact version was required search must fail!! - #IF( NOT ${_pkgname}_FIND_QUIETLY ) - # MESSAGE( "Check for ${_pkgname}: could not find exact version" ) - #ENDIF() - SET( PACKAGE_VERSION_UNSUITABLE TRUE ) - ENDIF() - - ENDIF() - - IF( PACKAGE_VERSION_UNSUITABLE ) - SET( PACKAGE_VERSION_COMPATIBLE FALSE ) - ENDIF() - - ENDIF( _sversion ) - -ENDMACRO( CHECK_PACKAGE_VERSION ) -
diff -N MacroGeneratePackageConfigFiles.cmake --- MacroGeneratePackageConfigFiles.cmake 10 Apr 2013 20:36:42 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,44 +0,0 @@
-#GET_FILENAME_COMPONENT( _current_dir ${CMAKE_CURRENT_LIST_FILE} PATH ) - -# helper macro for generating project configuration file -MACRO( GENERATE_PACKAGE_CONFIGURATION_FILES ) - - FOREACH( arg ${ARGN} ) - IF( ${arg} MATCHES "Config.cmake" ) - IF( EXISTS "${PROJECT_SOURCE_DIR}/cmake/${arg}.in" ) - CONFIGURE_FILE( "${PROJECT_SOURCE_DIR}/cmake/${arg}.in" - "${PROJECT_BINARY_DIR}/${arg}" @ONLY - ) - INSTALL( FILES "${PROJECT_BINARY_DIR}/${arg}" DESTINATION . ) - #IF( EXISTS "${_current_dir}/MacroCheckPackageLibs.cmake" ) - # INSTALL( FILES "${_current_dir}/MacroCheckPackageLibs.cmake" DESTINATION cmake ) - #ENDIF() - #IF( EXISTS "${_current_dir}/MacroExportPackageDeps.cmake" ) - # INSTALL( FILES "${_current_dir}/MacroExportPackageDeps.cmake" DESTINATION cmake ) - #ENDIF() - ENDIF() - ENDIF() - - - IF( ${arg} MATCHES "ConfigVersion.cmake" ) - # version configuration file - IF( EXISTS "${PROJECT_SOURCE_DIR}/cmake/${arg}.in" ) - CONFIGURE_FILE( "${PROJECT_SOURCE_DIR}/cmake/${arg}.in" - "${PROJECT_BINARY_DIR}/${arg}" @ONLY - ) - INSTALL( FILES "${PROJECT_BINARY_DIR}/${arg}" DESTINATION . ) - #IF( EXISTS "${_current_dir}/MacroCheckPackageVersion.cmake" ) - # INSTALL( FILES "${_current_dir}/MacroCheckPackageVersion.cmake" DESTINATION cmake ) - #ENDIF() - ENDIF( EXISTS "${PROJECT_SOURCE_DIR}/cmake/${arg}.in" ) - ENDIF() - - IF( ${arg} MATCHES "LibDeps.cmake" ) - EXPORT_LIBRARY_DEPENDENCIES( "${arg}" ) - INSTALL( FILES "${PROJECT_BINARY_DIR}/${arg}" DESTINATION lib/cmake ) - ENDIF() - - ENDFOREACH() - -ENDMACRO( GENERATE_PACKAGE_CONFIGURATION_FILES ) -
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