Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change directory pointing to StdFace submodule #119

Merged
merged 3 commits into from
Sep 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "src/StdFace/submodule"]
path = src/StdFace/submodule
[submodule "src/StdFace"]
path = src/StdFace
url = https://github.com/issp-center-dev/StdFace
13 changes: 3 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,11 @@ set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
set(CMAKE_MACOSX_RPATH 1)

if(NOT STDFACE_DIR)
set(STDFACE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/StdFace")
# git submodule update
# ref: https://cliutils.gitlab.io/modern-cmake/chapters/projects/submodule.html
find_package(Git QUIET)
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/src/StdFace/clone")
set(STDFACE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/StdFace/clone")
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/src/StdFace")
elseif(GIT_FOUND AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git")
set(STDFACE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/StdFace/submodule")
if(GIT_FOUND AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git")
# Update submodules as needed
if(GIT_SUBMODULE_UPDATE)
message(STATUS "Submodule update")
Expand All @@ -47,13 +44,9 @@ if(NOT STDFACE_DIR)
message(FATAL_ERROR "git submodule update --init failed with ${GIT_SUBMOD_RESULT}, please checkout submodules")
endif()
endif()
else()
set(STDFACE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/StdFace/clone")
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/src/StdFace")
endif()

if(NOT EXISTS "${STDFACE_DIR}/CMakeLists.txt")
message(FATAL_ERROR "Automatic download of the submodule StdFace failed! Please run 'sh ${CMAKE_CURRENT_SOURCE_DIR}/src/StdFace/download.sh' to download manually.")
message(FATAL_ERROR "StdFace is not found. Please `git clone` the repository (https://github.com/issp-center-dev/HPhi) or download an archive file (HPhi-X.Y.Z.tar.gz) from the release page (https://github.com/issp-center-dev/HPhi/releases)")
endif()
else()
if(NOT EXISTS "${STDFACE_DIR}/CMakeLists.txt")
Expand Down
51 changes: 25 additions & 26 deletions dist.sh
Original file line number Diff line number Diff line change
@@ -1,39 +1,38 @@
#!/bin/sh
#
# ############# Note ################################
# Before packing, you should clean the GIT directory as
# $ git clean -f -d -x
# #####################################################
# ############# README ##############
# This makes an archive file including static copy of submodules (StdFace)
# and PDF formatted documents docs/userguide_HPhi_(ja|en).pdf
# The output filename is HPhi-${vid}.tar.gz,
# where ${vid} is the version number such as 3.5.0 .
# Before using this, install the following python packages:
# sphinx
# sphinx_numfig
# sphinxcontib_spelling
# git-archive-all
# #####################################
#
# Version ID
#
major=`cat src/include/version_major.h`
minor=`cat src/include/version_minor.h`
patch=`cat src/include/version_patch.h`
vid=`echo ${major}.${minor}.${patch}`
#
mkdir HPhi-${vid}
#
#cp -rf * HPhi-${vid}
rsync --exclude HPhi-${vid} -a * HPhi-${vid}
#

ROOTDIR=`pwd`

# Build docments
#
cd HPhi-${vid}/doc/ja
cd doc/ja
make latexpdf
cp ./build/latex/userguide_HPhi_ja.pdf ../../
cp ./build/latex/userguide_HPhi_ja.pdf $ROOTDIR/doc
cd ../en
make latexpdf
cp ./build/latex/userguide_HPhi_en.pdf ../../
#
# Remove some files
#
find ./ -name ".git*" -delete
#
# Pack
#
cd ../../
rm dist.sh
cd ../
tar czvf HPhi-${vid}.tar.gz HPhi-${vid}
rm -rf HPhi-${vid}
cp ./build/latex/userguide_HPhi_en.pdf $ROOTDIR/doc

# Make a tarball
cd $ROOTDIR
git-archive-all \
--extra=doc/userguide_HPhi_ja.pdf \
--extra=doc/userguide_HPhi_en.pdf \
--prefix=HPhi-${vid} \
HPhi-${vid}.tar.gz
16 changes: 0 additions & 16 deletions src/StdFace/CMakeLists.txt

This file was deleted.

2 changes: 0 additions & 2 deletions src/StdFace/download.sh

This file was deleted.