Commit 3c4c78ed authored by Sonja Happ's avatar Sonja Happ

cleanup: remove protobuf submodule, remove protobuf build scripts, add comment...

cleanup: remove protobuf submodule, remove protobuf build scripts, add comment in Dockerfile, improve output of proto CMakeFile, improve cleanup script
parent c6a46d51
......@@ -4,11 +4,13 @@ build/CMakeFiles/
build/CPackConfig.cmake
build/CPackSourceConfig.cmake
build/Makefile
build/proto
build/cmake_install.cmake
build/libs/
build/spdlogConfigVersion.cmake
build/spdlog.pc
proto/cpp/
proto/*.h
proto/*.cc
libs/repasthpc/src/CMakeLists.txt
.idea/
bin/error
......
......@@ -8,10 +8,6 @@
path = libs/repasthpc
url = https://github.com/Repast/repast.hpc.git
ignore=dirty
[submodule "libs/protocolbuffers"]
path = libs/protocolbuffers
url = https://github.com/protocolbuffers/protobuf
ignore=dirty
[submodule "libs/dbconnector"]
path = libs/dbconnector
url = ../dbconnector.git
......
......@@ -69,6 +69,7 @@ RUN cd /tmp && mkdir boost && cd boost && \
ldconfig && \
rm -rf /tmp/*
# Install Protobuf 3.3.2 (Dependency of DistAIX)
RUN cd /tmp && mkdir protobuf && cd protobuf && \
git clone https://github.com/protocolbuffers/protobuf . && \
git checkout 3.3.x && \
......
......@@ -24,7 +24,7 @@
#!/bin/bash
echo "Removing all temporary CMake files..."
rm -r CMakeCache.txt CMakeFiles cmake_install.cmake Makefile CPackConfig.cmake CPackSourceConfig.cmake libs
rm -r CMakeCache.txt CMakeFiles cmake_install.cmake Makefile CPackConfig.cmake CPackSourceConfig.cmake libs proto spdlog.pc spdlogConfigVersion.cmake
echo "Removing binary file..."
rm ../bin/distaix
echo "Done."
#############################################################################
# DistAIX compile_protobuf.sh script
#
# @author Sonja Happ <sonja.happ@eonerc.rwth-aachen.de>, Jonas Otten
# @copyright 2019, Institute for Automation of Complex Power Systems, EONERC
# @license GNU General Public License (version 3)
#
# DistAIX
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#############################################################################
#!/bin/bash
# determine initial directory
INIT_DIR=$(pwd)
#determine operating system (ubuntu or centos)
. /etc/os-release
OS=$NAME
DIR=$(dirname $(readlink -f $0))
cd ${DIR}
#init and update git submodule
cd ../../
git submodule init distaix/libs/protocolbuffers
git submodule update distaix/libs/protocolbuffers
#build protobuf lib and protoc with cmake
cd distaix/libs/protocolbuffers
cmake -Dprotobuf_BUILD_TESTS=OFF -Dprotobuf_BUILD_EXAMPLES=OFF -Dprotobuf_BUILD_SHARED_LIBS=ON -Dprotobuf_VERBOSE=ON cmake/
if [ "${OS}" = "CentOS Linux" ]
then
make -j
else
make
fi
# move back to init directory
cd $INIT_DIR
#############################################################################
# DistAIX proto_to_cpp.sh script
#
# @author Sonja Happ <sonja.happ@eonerc.rwth-aachen.de>, Jonas Otten
# @copyright 2019, Institute for Automation of Complex Power Systems, EONERC
# @license GNU General Public License (version 3)
#
# DistAIX
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#############################################################################
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
cd ${DIR}
echo "Converting proto to cpp and h files..."
cd ../proto
mkdir -p cpp
../libs/protocolbuffers/protoc -I=`pwd` --cpp_out=cpp `pwd`/*.proto
echo "Finished converting proto to cpp and h files"
Subproject commit 5532abc15b97f3489183b266b41844306052a3fa
file(GLOB PROTOS ${CMAKE_CURRENT_SOURCE_DIR}/*.proto)
MESSAGE(STATUS "PROTOC: ${Protobuf_PROTOC_EXECUTABLE}")
foreach( proto_file ${PROTOS} )
FILE(TO_NATIVE_PATH ${proto_file} proto_native)
#generate cpp and h files from proto files
#generate cpp and h files from proto file
EXECUTE_PROCESS(COMMAND ${Protobuf_PROTOC_EXECUTABLE} --proto_path=${CMAKE_CURRENT_SOURCE_DIR} --cpp_out=${CMAKE_CURRENT_SOURCE_DIR} ${proto_native}
RESULT_VARIABLE rv)
MESSAGE("Generation of data model returned ${rv} for proto ${proto_native}")
if(rv)
MESSAGE("Generation of data model returned ${rv} for proto ${proto_native}")
else(rv)
MESSAGE("Generated .cc and .h for proto file: ${proto_native}")
endif(rv)
endforeach( proto_file)
file(GLOB PROTO_SRC *.cc)
file(GLOB PROTO_HDR *.h)
# Lists of generated .cc and .h files should be visible in superordinate CMakeFile
set(PROTO_SRC ${PROTO_SRC} PARENT_SCOPE)
set(PROTO_HDR ${PROTO_HDR} PARENT_SCOPE)
#MESSAGE(STATUS "Generated cc: ${PROTO_SRC}")
#MESSAGE(STATUS "Generated h: ${PROTO_HDR}")
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment