Skip to content

Instantly share code, notes, and snippets.

@masnagam
Created October 25, 2016 02:37
Show Gist options
  • Save masnagam/0fa79ee62ca77a42f2fa1d5e3bac9719 to your computer and use it in GitHub Desktop.
Save masnagam/0fa79ee62ca77a42f2fa1d5e3bac9719 to your computer and use it in GitHub Desktop.
#!/bin/bash
usage() {
echo 'sh reproduce.sh path/to/existing/empty/folder'
exit 1
}
if [ $# -ne 1 ]; then
usage
fi
if [ ! -d "$1" ]; then
usage
fi
pushd "$1"
git init
mkdir vendor
git submodule add https://github.com/Snaipe/Criterion.git vendor/criterion
cat <<-EOF >CMakeLists.txt
cmake_minimum_required(VERSION 2.8.0)
project(criterion-issue)
if(UNIX)
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
elseif(WIN32)
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR})
set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR})
endif()
add_subdirectory(vendor/criterion)
EOF
cmake -Bbuild -H.
popd
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment