Skip to content
Snippets Groups Projects
Commit 906fe47d authored by Pospelov, Gennady's avatar Pospelov, Gennady
Browse files

thisbornagain.sh

parent 9e9bf306
No related branches found
No related tags found
No related merge requests found
...@@ -26,6 +26,8 @@ set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules) ...@@ -26,6 +26,8 @@ set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)
include(BornAgainMacros) include(BornAgainMacros)
include(SearchInstalledSoftware) include(SearchInstalledSoftware)
include(CheckCompiler) include(CheckCompiler)
include(BornAgainConfiguration)
#--- Recurse into the given subdirectories --- #--- Recurse into the given subdirectories ---
add_subdirectory(Core) add_subdirectory(Core)
......
How to use the release script.
1. cd to some empty directory
2. git clone git://apps.jcns.fz-juelich.de/BornAgain.git
3. git checkout develop
4. change the release number in BornAgain/CMakeLists.txt (also in BornAgain/Doc/UserManual/CMakeLists.txt if a new version of the manual is needed)
5. create the build directory somewhere outside the source tree
6. cd path-to-build-directory
7. cmake path-to-source-dir
8. run script path-to-build-dir/bin/release.sh
# set BornAgain environment variables
# see boost bug https://svn.boost.org/trac/boost/ticket/4688
export LC_ALL=C
# BornAgain project general configuration
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/lib)
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/bin)
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/bin)
set(bindir $BORNAGAINSYS/bin)
set(libdir $BORNAGAINSYS/lib)
if(WIN32)
set(libprefix lib)
set(libsuffix .dll)
elseif(APPLE)
set(libprefix lib)
set(libsuffix .so)
else()
set(libprefix lib)
set(libsuffix .so)
endif()
# --- configure a header file to pass CMake settings to the source code
configure_file(
"${CMAKE_SOURCE_DIR}/Core/Samples/inc/BAVersion.h.in"
"${CMAKE_SOURCE_DIR}/Core/Samples/inc/BAVersion.h"
)
# --- configure deployment script for release
configure_file(
"${CMAKE_SOURCE_DIR}/bin/release.sh.in"
"${CMAKE_BINARY_DIR}/bin/release.sh"
)
# --- configure user setup script
configure_file("${CMAKE_SOURCE_DIR}/cmake/scripts/thisbornagain.sh.in" "${CMAKE_BINARY_DIR}/bin/thisbornagain.sh" @ONLY)
configure_file("${CMAKE_SOURCE_DIR}/cmake/scripts/thisbornagain.csh.in" "${CMAKE_BINARY_DIR}/bin/thisbornagain.csh" @ONLY)
# --- installation
install(FILES ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/thisbornagain.sh
${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/thisbornagain.csh
PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ
GROUP_EXECUTE GROUP_READ
WORLD_EXECUTE WORLD_READ
DESTINATION bin)
cmake_minimum_required(VERSION 2.8 FATAL_ERROR) # --- Collection of scripts for BornAgain CMake infrastructure
#cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
# --- configure a header file to pass CMake settings to the source code
configure_file(
"${CMAKE_SOURCE_DIR}/Core/Samples/inc/BAVersion.h.in"
"${CMAKE_SOURCE_DIR}/Core/Samples/inc/BAVersion.h"
)
# --- configure deployment script for release
configure_file(
"${CMAKE_SOURCE_DIR}/bin/release.sh.in"
"${CMAKE_BINARY_DIR}/bin/release.sh"
)
# --- end of the version setting --- # --- end of the version setting ---
set(lib lib) #set(lib lib)
set(bin bin) #set(bin bin)
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/lib) #execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/lib)
execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/bin) #execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/bin)
#set(BORNAGAIN_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) ##set(BORNAGAIN_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) #set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) #set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/bin) #set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/bin) #set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/bin)
#set(BORNAGAIN_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) ##set(BORNAGAIN_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
#set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${BORNAGAIN_RUNTIME_OUTPUT_DIRECTORY}) ##set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${BORNAGAIN_RUNTIME_OUTPUT_DIRECTORY})
#set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${BORNAGAIN_RUNTIME_OUTPUT_DIRECTORY}) ##set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${BORNAGAIN_RUNTIME_OUTPUT_DIRECTORY})
#set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${BORNAGAIN_RUNTIME_OUTPUT_DIRECTORY}) ##set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${BORNAGAIN_RUNTIME_OUTPUT_DIRECTORY})
#set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${BORNAGAIN_RUNTIME_OUTPUT_DIRECTORY}) ##set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${BORNAGAIN_RUNTIME_OUTPUT_DIRECTORY})
#set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) ##set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
#set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) ##set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
if(WIN32) #if(WIN32)
set(ssuffix .bat) # set(ssuffix .bat)
set(scomment rem) # set(scomment rem)
set(libprefix lib) # set(libprefix lib)
set(ld_library_path PATH) # set(ld_library_path PATH)
set(libsuffix .dll) # set(libsuffix .dll)
set(runtimedir bin) # set(runtimedir bin)
#set(CMAKE_FIND_LIBRARY_SUFFIXES ".a;.lib;.dll") # doesn't work anyway for MSVC generator # #set(CMAKE_FIND_LIBRARY_SUFFIXES ".a;.lib;.dll") # doesn't work anyway for MSVC generator
#
elseif(APPLE) #elseif(APPLE)
set(ld_library_path DYLD_LIBRARY_PATH) # set(ld_library_path DYLD_LIBRARY_PATH)
set(ssuffix .csh) # set(ssuffix .csh)
set(scomment \#) # set(scomment \#)
set(libprefix lib) # set(libprefix lib)
set(libsuffix .so) # set(libsuffix .so)
set(runtimedir lib) # set(runtimedir lib)
else() #else()
set(ld_library_path LD_LIBRARY_PATH) # set(ld_library_path LD_LIBRARY_PATH)
set(ssuffix .csh) # set(ssuffix .csh)
set(scomment \#) # set(scomment \#)
set(libprefix lib) # set(libprefix lib)
set(libsuffix .so) # set(libsuffix .so)
set(runtimedir lib) # set(runtimedir lib)
endif() #endif()
......
% User Manual version number % User Manual version number
% this file is automatically generated by CMakeLists.txt using cmake/modules/Version.tex.in % this file is automatically generated by CMakeLists.txt using cmake/modules/UserManualVersion.tex.in
\newcommand{\UserManualVersionNumber}{@UM_VERSION_MAJOR@.@UM_VERSION_MINOR@.@UM_VERSION_PATCH@} \newcommand{\UserManualVersionNumber}{@UM_VERSION_MAJOR@.@UM_VERSION_MINOR@.@UM_VERSION_PATCH@}
# Source this script to set up the BornAgain.
# This script if for the csh like shells, see thisbornagain.sh for bash like shells.
#
# Original script is borrowed from ROOT distribution (http://root.cern.ch)
# Author: Fons Rademakers, 18/8/2006
# Source this script to set up the BornAgain build that this script is part of.
#
# Conveniently an alias like this can be defined in ~/.cshrc:
# alias thisbornagain "source bin/thisbornagain.sh"
#
# This script if for the csh like shells, see thisbornagain.sh for bash like shells.
#
# Author: Fons Rademakers, 18/8/2006
if ($?BORNAGAINSYS) then
set old_bornagain="$BORNAGAINSYS"
endif
# $_ should be source .../thisbornagain.csh
set ARGS=($_)
if ("$ARGS" != "") then
set thisbornagain="`dirname ${ARGS[2]}`"
else
# But $_ might not be set if the script is source non-interactively.
# In [t]csh the sourced file is inserted 'in place' inside the
# outer script, so we need an external source of information
# either via the current directory or an extra parameter.
if ( -e thisbornagain.csh ) then
set thisbornagain=${PWD}
else if ( -e bin/thisbornagain.csh ) then
set thisbornagain=${PWD}/bin
else if ( "$1" != "" ) then
if ( -e ${1}/bin/thisbornagain.csh ) then
set thisbornagain=${1}/bin
else if ( -e ${1}/thisbornagain.csh ) then
set thisbornagain=${1}
else
echo "thisbornagain.csh: ${1} does not contain a BornAgain installation"
endif
else
echo 'Error: The call to "source where_bornagain_is/bin/thisbornagain.csh" can not determine the location of the BornAgain installation'
echo "because it was embedded another script (this is an issue specific to csh)."
echo "Use either:"
echo " cd where_bornagain_is; source bin/thisbornagain.csh"
echo "or"
echo " source where_bornagain_is/bin/thisbornagain.csh where_bornagain_is"
endif
endif
if ($?thisbornagain) then
setenv BORNAGAINSYS "`(cd ${thisbornagain}/..;pwd)`"
if ($?old_bornagain) then
setenv PATH `echo $PATH | sed -e "s;:$old_bornagain/bin:;:;g" \
-e "s;:$old_bornagain/bin;;g" \
-e "s;$old_bornagain/bin:;;g" \
-e "s;$old_bornagain/bin;;g"`
if ($?LD_LIBRARY_PATH) then
setenv LD_LIBRARY_PATH `echo $LD_LIBRARY_PATH | \
sed -e "s;:$old_bornagain/lib:;:;g" \
-e "s;:$old_bornagain/lib;;g" \
-e "s;$old_bornagain/lib:;;g" \
-e "s;$old_bornagain/lib;;g"`
endif
if ($?DYLD_LIBRARY_PATH) then
setenv DYLD_LIBRARY_PATH `echo $DYLD_LIBRARY_PATH | \
sed -e "s;:$old_bornagain/lib:;:;g" \
-e "s;:$old_bornagain/lib;;g" \
-e "s;$old_bornagain/lib:;;g" \
-e "s;$old_bornagain/lib;;g"`
endif
if ($?SHLIB_PATH) then
setenv SHLIB_PATH `echo $SHLIB_PATH | \
sed -e "s;:$old_bornagain/lib:;:;g" \
-e "s;:$old_bornagain/lib;;g" \
-e "s;$old_bornagain/lib:;;g" \
-e "s;$old_bornagain/lib;;g"`
endif
if ($?LIBPATH) then
setenv LIBPATH `echo $LIBPATH | \
sed -e "s;:$old_bornagain/lib:;:;g" \
-e "s;:$old_bornagain/lib;;g" \
-e "s;$old_bornagain/lib:;;g" \
-e "s;$old_bornagain/lib;;g"`
endif
if ($?PYTHONPATH) then
setenv PYTHONPATH `echo $PYTHONPATH | \
sed -e "s;:$old_bornagain/lib:;:;g" \
-e "s;:$old_bornagain/lib;;g" \
-e "s;$old_bornagain/lib:;;g" \
-e "s;$old_bornagain/lib;;g"`
endif
# if ($?MANPATH) then
# setenv MANPATH `echo $MANPATH | \
# sed -e "s;:$old_bornagain/man:;:;g" \
# -e "s;:$old_bornagain/man;;g" \
# -e "s;$old_bornagain/man:;;g" \
# -e "s;$old_bornagain/man;;g"`
# endif
endif
#if ($?MANPATH) then
## Nothing to do
#else
# # Grab the default man path before setting the path to avoid duplicates
# if ( -X manpath ) then
# set default_manpath = `manpath`
# else
# set default_manpath = `man -w`
# endif
#endif
set path = (@bindir@ $path)
if ($?LD_LIBRARY_PATH) then
setenv LD_LIBRARY_PATH @libdir@:$LD_LIBRARY_PATH # Linux, ELF HP-UX
else
setenv LD_LIBRARY_PATH @libdir@
endif
if ($?DYLD_LIBRARY_PATH) then
setenv DYLD_LIBRARY_PATH @libdir@:$DYLD_LIBRARY_PATH # Mac OS X
else
setenv DYLD_LIBRARY_PATH @libdir@
endif
if ($?SHLIB_PATH) then
setenv SHLIB_PATH @libdir@:$SHLIB_PATH # legacy HP-UX
else
setenv SHLIB_PATH @libdir@
endif
if ($?LIBPATH) then
setenv LIBPATH @libdir@:$LIBPATH # AIX
else
setenv LIBPATH @libdir@
endif
if ($?PYTHONPATH) then
setenv PYTHONPATH @libdir@:$PYTHONPATH
else
setenv PYTHONPATH @libdir@
endif
#if ($?MANPATH) then
# setenv MANPATH `dirname @mandir@`:$MANPATH
#else
# setenv MANPATH `dirname @mandir@`:$default_manpath
#endif
endif # if ("$thisbornagain" != "")
set thisbornagain=
set old_bornagain=
# Source this script to set up the BornAgain.
# This script if for the bash like shells, see thisbornagain.csh for csh like shells.
#
# Original script is borrowed from ROOT distribution (http://root.cern.ch)
# Author: Fons Rademakers, 18/8/2006
drop_from_path()
{
# Assert that we got enough arguments
if test $# -ne 2 ; then
echo "drop_from_path: needs 2 arguments"
return 1
fi
p=$1
drop=$2
newpath=`echo $p | sed -e "s;:${drop}:;:;g" \
-e "s;:${drop};;g" \
-e "s;${drop}:;;g" \
-e "s;${drop};;g"`
}
if [ -n "${BORNAGAINSYS}" ] ; then
old_bornagainsys=${BORNAGAINSYS}
fi
if [ "x${BASH_ARGV[0]}" = "x" ]; then
if [ ! -f bin/thisbornagain.sh ]; then
echo ERROR: must "cd where/BornAgain/is" before calling ". bin/thisbornagain.sh" for this version of bash!
BORNAGAINSYS=; export BORNAGAINSYS
return 1
fi
BORNAGAINSYS="$PWD"; export BORNAGAINSYS
else
# get param to "."
thisbornagain=$(dirname ${BASH_ARGV[0]})
BORNAGAINSYS=$(cd ${thisbornagain}/..;pwd); export BORNAGAINSYS
fi
if [ -n "${old_bornagainsys}" ] ; then
if [ -n "${PATH}" ]; then
drop_from_path $PATH ${old_bornagainsys}/bin
PATH=$newpath
fi
if [ -n "${LD_LIBRARY_PATH}" ]; then
drop_from_path $LD_LIBRARY_PATH ${old_bornagainsys}/lib
LD_LIBRARY_PATH=$newpath
fi
if [ -n "${DYLD_LIBRARY_PATH}" ]; then
drop_from_path $DYLD_LIBRARY_PATH ${old_bornagainsys}/lib
DYLD_LIBRARY_PATH=$newpath
fi
if [ -n "${SHLIB_PATH}" ]; then
drop_from_path $SHLIB_PATH ${old_bornagainsys}/lib
SHLIB_PATH=$newpath
fi
if [ -n "${LIBPATH}" ]; then
drop_from_path $LIBPATH ${old_bornagainsys}/lib
LIBPATH=$newpath
fi
if [ -n "${PYTHONPATH}" ]; then
drop_from_path $PYTHONPATH ${old_bornagainsys}/lib
PYTHONPATH=$newpath
fi
# if [ -n "${MANPATH}" ]; then
# drop_from_path $MANPATH ${old_bornagainsys}/man
# MANPATH=$newpath
# fi
fi
#if [ -z "${MANPATH}" ]; then
# # Grab the default man path before setting the path to avoid duplicates
# if `which manpath > /dev/null 2>&1` ; then
# default_manpath=`manpath`
# else
# default_manpath=`man -w 2> /dev/null`
# fi
#fi
if [ -z "${PATH}" ]; then
PATH=@bindir@; export PATH
else
PATH=@bindir@:$PATH; export PATH
fi
if [ -z "${LD_LIBRARY_PATH}" ]; then
LD_LIBRARY_PATH=@libdir@; export LD_LIBRARY_PATH # Linux, ELF HP-UX
else
LD_LIBRARY_PATH=@libdir@:$LD_LIBRARY_PATH; export LD_LIBRARY_PATH
fi
if [ -z "${DYLD_LIBRARY_PATH}" ]; then
DYLD_LIBRARY_PATH=@libdir@; export DYLD_LIBRARY_PATH # Mac OS X
else
DYLD_LIBRARY_PATH=@libdir@:$DYLD_LIBRARY_PATH; export DYLD_LIBRARY_PATH
fi
if [ -z "${SHLIB_PATH}" ]; then
SHLIB_PATH=@libdir@; export SHLIB_PATH # legacy HP-UX
else
SHLIB_PATH=@libdir@:$SHLIB_PATH; export SHLIB_PATH
fi
if [ -z "${LIBPATH}" ]; then
LIBPATH=@libdir@; export LIBPATH # AIX
else
LIBPATH=@libdir@:$LIBPATH; export LIBPATH
fi
if [ -z "${PYTHONPATH}" ]; then
PYTHONPATH=@libdir@; export PYTHONPATH
else
PYTHONPATH=@libdir@:$PYTHONPATH; export PYTHONPATH
fi
#if [ -z "${MANPATH}" ]; then
# MANPATH=`dirname @mandir@`:${default_manpath}; export MANPATH
#else
# MANPATH=`dirname @mandir@`:$MANPATH; export MANPATH
#fi
unset old_bornagainsys
unset thisbornagain
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment