Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
CLHEP
CLHEP
Commits
e8045a66
Commit
e8045a66
authored
Dec 16, 2011
by
Lynn Garren
Browse files
get expected package name on Scientific Linux
parent
31a872f9
Changes
3
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
e8045a66
...
...
@@ -44,9 +44,6 @@ include(ClhepVariables)
include
(
CheckFunctionExists
)
include
(
ClhepToolchain
)
# Custom Packaging
include
(
ClhepPackaging
)
# because we want to move these libraries about,
# do not embed full path in shared libraries or executables
set
(
CMAKE_SKIP_RPATH
)
...
...
@@ -124,3 +121,6 @@ clhep_build_libclhep( ${CLHEP_libraries} )
# provide tools for other packages to include CLHEP easily
clhep_toolchain
()
# Custom Packaging
include
(
ClhepPackaging
)
cmake/Modules/ClhepPackaging.cmake
View file @
e8045a66
...
...
@@ -4,54 +4,48 @@
#
# original code supplied by Ben Morgan Ben.Morgan@warwick.ac.uk
# modifications by Lynn Garren garren@fnal.gov
# the binary tarball should, e.g., have this format:
# x86_64-slc5-gcc46-opt/include
# /bin
# /lib
# /doc (optional)
# basically, the tarball should mirror the install directory,
# but with the appropriate top level directory
# tarball names: clhep-2.1.1.0-x86_64-slc5-gcc46-opt.tgz
# clhep-2.1.1.0-x86_64-slc5-gcc41-opt.tgz
# clhep-2.1.1.0-x86_64-mac106-gcc42-opt.tgz
# result of lsb_release -s -i on various platforms
# Scientific Linux Fermi 5.x: ScientificSLF
# Scientific Linux Fermi 6.x: ScientificFermi
# Scientific Linux CERN 5.x: ScientificCERNSLC
# Scientific Linux CERN 6.x: ScientificFermi
# no lsb_release on lx64slc6.cern.ch machines?
include
(
FindCompilerVersion
)
#----------------------------------------------------------------------------
# Package up needed system libraries - seems to only be needed on Windows
#
include
(
InstallRequiredSystemLibraries
)
if
(
"
${
CPACK_SYSTEM_NAME
}
"
MATCHES Windows
)
include
(
InstallRequiredSystemLibraries
)
endif
()
#----------------------------------------------------------------------------
# General packaging setup - variables relevant to all package formats
# CLHEP use of version variables is
n't optimal.
# CLHEP use of version variables is
non-standard
set
(
CPACK_PACKAGE_VERSION
${
VERSION
}
)
#set(CPACK_PACKAGE_VERSION_MAJOR ${${PROJECT_NAME}_VERSION_MAJOR})
#set(CPACK_PACKAGE_VERSION_MINOR ${${PROJECT_NAME}_VERSION_MINOR})
#set(CPACK_PACKAGE_VERSION_PATCH ${${PROJECT_NAME}_VERSION_PATCH})
# We can't completely set the resource files yet - they need to be .txt,
# and the default GPL text isn't always handled correctly by self extracting
# sh files...
set
(
CPACK_PACKAGE_DESCRIPTION_SUMMARY
"Class Library for High Energy Physics"
)
#set(CPACK_PACKAGE_DESCRIPTION_FILE "${PROJECT_SOURCE_DIR}/README.txt")
set
(
CPACK_PACKAGE_VENDOR
"CLHEP Project"
)
#set(CPACK_RESOURCE_FILE_README "${PROJECT_SOURCE_DIR}/README.txt")
# We don't put the license in yet because the GPL text has quotes which make
# sh barf. We need to fix that, but at present I don't want to edit the GPL!
#set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE.txt")
#----------------------------------------------------------------------------
# Source package settings
# Exclude VCS and standard temporary files from the source package.
# This is not perfected yet!
set
(
CPACK_SOURCE_IGNORE_FILES
${
CMAKE_BINARY_DIR
}
"~$"
"/CVS/"
"/.svn/"
"/
\\\\\\\\
.svn/"
"/.git/"
"/
\\\\\\\\
.git/"
"
\\\\\\\\
.swp$"
"
\\\\\\\\
.swp$"
"
\\\\
.swp"
"
\\\\\\\\
.#"
"/#"
)
# - Limit source packages to the three main types
set
(
CPACK_SOURCE_GENERATOR
"TGZ;TBZ2;ZIP"
)
set
(
CPACK_INCLUDE_TOPLEVEL_DIRECTORY 0
)
set
(
CPACK_GENERATOR TGZ
)
set
(
CPACK_PACKAGE_NAME clhep
)
find_compiler
()
#----------------------------------------------------------------------------
# Set name of CPACK_SYSTEM_NAME based on platform and architecture where
...
...
@@ -62,7 +56,7 @@ set(CPACK_SOURCE_GENERATOR "TGZ;TBZ2;ZIP")
#
if
(
NOT DEFINED CPACK_SYSTEM_NAME
)
# Cygwin is always Cygwin...
if
(
"
${
CMAKE_SYSTEM_NAME
}
"
STREQUAL
"CYGWIN"
)
if
(
"
${
CMAKE_SYSTEM_NAME
}
"
MATCHES
"CYGWIN"
)
set
(
CPACK_SYSTEM_NAME Cygwin
)
else
()
if
(
UNIX AND NOT APPLE
)
...
...
@@ -75,21 +69,36 @@ if(NOT DEFINED CPACK_SYSTEM_NAME)
exec_program
(
${
LSB_RELEASE_PROGRAM
}
ARGS -s -i OUTPUT_VARIABLE LSB_VENDOR
)
string
(
REGEX REPLACE
" "
"-"
LSB_VENDOR
${
LSB_VENDOR
}
)
string
(
TOLOWER
${
LSB_VENDOR
}
LSB_VENDOR
)
if
(
"
${
LSB_VENDOR
}
"
MATCHES
"scientificslf"
)
set
(
LSB_VENDOR
"slf"
)
elseif
(
"
${
LSB_VENDOR
}
"
MATCHES
"scientificfermi"
)
set
(
LSB_VENDOR
"slf"
)
elseif
(
"
${
LSB_VENDOR
}
"
MATCHES
"scientificcernslc"
)
set
(
LSB_VENDOR
"slc"
)
else
()
set
(
LSB_VENDOR
${
LSB_VENDOR
}
)
endif
()
# - Distributor release
exec_program
(
${
LSB_RELEASE_PROGRAM
}
ARGS -s -r OUTPUT_VARIABLE LSB_RELEASE
)
string
(
TOLOWER
${
LSB_RELEASE
}
LSB_RELEASE
)
string
(
REGEX REPLACE
"([0-9])
\\
.([0-9])?"
"
\\
1"
LSB_RELEASE
${
LSB_RELEASE
}
)
# Cache the vendor tag, because users might want to edit it
set
(
LSB_VENDOR_TAG
${
LSB_VENDOR
}
-
${
LSB_RELEASE
}
set
(
LSB_VENDOR_TAG
${
LSB_VENDOR
}${
LSB_RELEASE
}
CACHE STRING
"LSB vendor tag for use in packaging"
)
set
(
CPACK_SYSTEM_NAME
${
CMAKE_SYSTEM_NAME
}
-
${
LSB_VENDOR_TAG
}
-
${
CMAKE_SYSTEM_PROCESSOR
}
)
if
(
NOT CPack_COMPILER_STRING
)
set
(
CPACK_SYSTEM_NAME
${
CMAKE_SYSTEM_PROCESSOR
}
-
${
LSB_VENDOR_TAG
}
)
else
()
set
(
CPACK_SYSTEM_NAME
${
CMAKE_SYSTEM_PROCESSOR
}
-
${
LSB_VENDOR_TAG
}${
CPack_COMPILER_STRING
}
)
endif
()
mark_as_advanced
(
LSB_RELEASE_PROGRAM LSB_VENDOR_TAG
)
else
()
# Fallback to using NAME-ARCH on other UNICES other than Apple
set
(
CPACK_SYSTEM_NAME
${
CMAKE_SYSTEM_
NAME
}
-
${
CMAKE_SYSTEM_
PROCESSOR
}
)
set
(
CPACK_SYSTEM_NAME
${
CMAKE_SYSTEM_
PROCESSOR
}
-
${
CMAKE_SYSTEM_
NAME
}
)
endif
()
else
()
# On Mac, we use NAME-ARCH, but ARCH is 'Universal' if more than
...
...
@@ -120,6 +129,22 @@ if("${CPACK_SYSTEM_NAME}" MATCHES Windows)
endif
()
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
"relwithdebinfo"
)
set
(
CPACK_SYSTEM_NAME
${
CPACK_SYSTEM_NAME
}
-opt
)
endif
()
endif
()
message
(
STATUS
"CPACK_PACKAGE_NAME:
${
CPACK_PACKAGE_NAME
}
"
)
message
(
STATUS
"CPACK_PACKAGE_VERSION:
${
CPACK_PACKAGE_VERSION
}
"
)
message
(
STATUS
"CPACK_SYSTEM_NAME:
${
CPACK_SYSTEM_NAME
}
"
)
#----------------------------------------------------------------------------
# Finally, include the base CPack configuration
#
...
...
cmake/Modules/FindCompilerVersion.cmake
0 → 100644
View file @
e8045a66
# 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
(
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
(
find_compiler
)
macro
(
compiler_status
)
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
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment