Skip to content

Commit

Permalink
Final twiddling of CMake files for now (I hope)
Browse files Browse the repository at this point in the history
  • Loading branch information
drummerdoc committed Sep 11, 2013
1 parent 97aaa12 commit 21fc642
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 19 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ set(CCSE_MODULE_PATH "${CCSE_TOOLS_DIR}/CMake")
set(CMAKE_MODULE_PATH ${CCSE_MODULE_PATH})

# Addtional build options
include(BoxLib_Version)
include(CCSEOptions)

# A property for accumulating the a global CCSE link line.
Expand Down
12 changes: 12 additions & 0 deletions Tools/CMake/BoxLib_Version.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Write the CCSEConfig.cmake file, can set as many as the following
# VERSION = full requested version string
# VERSION_MAJOR = major version if requested, else 0
# VERSION_MINOR = minor version if requested, else 0
# VERSION_PATCH = patch version if requested, else 0
# VERSION_TWEAK = tweak version if requested, else 0
# VERSION_COUNT = number of version components, 0 to 4
SET(CCSE_VERSION 1.1.8)
SET(CCSE_VERSION_MAJOR 1)
SET(CCSE_VERSION_MINOR 1)
SET(CCSE_VERSION_PATCH 8)
SET(CCSE_VERSION_COUNT 3)
12 changes: 0 additions & 12 deletions Tools/CMake/CCSEOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,6 @@ if(BUILD_STATIC_EXECUTABLES)
set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS)
endif(BUILD_STATIC_EXECUTABLES)

set(cat_exec "cat")
if (WIN32)
if( NOT UNIX)
set(cat_exec "type")
endif(NOT UNIX)
endif(WIN32)

execute_process(COMMAND "${cat_exec}" "${CCSE_ROOT_DIR}/BoxLib_Version.txt"
OUTPUT_VARIABLE CCSE_VERSION
ERROR_VARIABLE _stderr
OUTPUT_STRIP_TRAILING_WHITESPACE)

# Testing
include(CMakeDependentOption)
cmake_dependent_option(ENABLE_TESTS "Enable unit testing" ON
Expand Down
1 change: 0 additions & 1 deletion Tools/CMake/InstallManager.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,6 @@ set(out_makefile "${CCSE_BINARY_DIR}/Makefile.export")
configure_file("${in_makefile}" "${out_makefile}")
install(FILES "${out_makefile}" DESTINATION lib)

# Write the CCSEConfig.cmake file
set(in_config "${CCSE_MODULE_PATH}/CCSEConfig-install.cmake.in")
set(out_config "${CCSE_BINARY_DIR}/CCSEConfig.cmake")
configure_file(${in_config} ${out_config})
Expand Down
30 changes: 24 additions & 6 deletions Tools/C_scripts/gen_release_tarball
Original file line number Diff line number Diff line change
@@ -1,18 +1,36 @@
#!/bin/bash

if [ "$#" -ne 1 ]
if [ "$#" -ne 3 ]
then
echo " "
echo " Generate a release tarball: "
echo " "
echo " $0 <n> (where <n> is a version string)"
echo " $0 <n1.n2.n3> (where n1.n2.n3 is a version string)"
echo " "
echo " Note that "vn1.n2.n3" must be a named tag in the git repository"
echo " Done with the following sequence: "
echo " #> git tag -a v\${version} -m \"Version \${version}\""
echo " #> git push --tags"
echo " "
fi

export version=$1
export version=$1.$2.$3
export outfile="../ccse-${version}.tar.gz"
echo "Creating tarball ${outfile}"
echo ${version} > BoxLib_Version.txt
git tag -a v${version} -m "Version ${version}"
echo "Creating tarball ${outfile} and Tools/CMake/BoxLib_Version.cmake"
git archive --format=tar --prefix=ccse-${version}/ v${version} | gzip >${outfile}

cat <<EOF > Tools/CMake/BoxLib_Version.cmake
# Write the CCSEConfig.cmake file, can set as many as the following
# VERSION = full requested version string
# VERSION_MAJOR = major version if requested, else 0
# VERSION_MINOR = minor version if requested, else 0
# VERSION_PATCH = patch version if requested, else 0
# VERSION_TWEAK = tweak version if requested, else 0
# VERSION_COUNT = number of version components, 0 to 4
SET(CCSE_VERSION ${version})
SET(CCSE_VERSION_MAJOR $1)
SET(CCSE_VERSION_MINOR $2)
SET(CCSE_VERSION_PATCH $3)
SET(CCSE_VERSION_COUNT 3)
EOF

0 comments on commit 21fc642

Please sign in to comment.