diff --git a/CMakeLists.txt b/CMakeLists.txt index 8f4e05b75..fc72593fe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -118,7 +118,10 @@ set(CMAKE_CXX_FLAGS "/MP /EHsc") #set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g3") #set(CMAKE_CXX_FLAGS_RELEASE "-O3") -else(WIN32) +else() +find_package(Protobuf REQUIRED) +include_directories(${Protobuf_INCLUDE_DIRS}) + find_library(IROHA_ED25519 ed25519 PATHS "dependencies/iroha-ed25519/build" REQUIRED) # set vars for mariadb cmake files set(INSTALL_BINDIR "bin") @@ -133,15 +136,15 @@ include_directories( -endif(WIN32) +endif() target_link_libraries(Gradido_LoginServer ${CONAN_LIBS} ${IROHA_ED25519}) if(WIN32) TARGET_LINK_LIBRARIES(Gradido_LoginServer optimized ${MYSQL_LIBRARIES} Shlwapi) TARGET_LINK_LIBRARIES(Gradido_LoginServer debug ${COMPILED_MARIADB_CLIENT_DEBUG} Shlwapi) -else(WIN32) -target_link_libraries(Gradido_LoginServer libmariadb protoc protobuf -pthread) -endif(WIN32) +else() +target_link_libraries(Gradido_LoginServer libmariadb ${Protobuf_LIBRARIES} -pthread) +endif() # install if(UNIX) @@ -169,8 +172,8 @@ target_link_libraries(Gradido_LoginServer_Test ${CONAN_LIBS} ${IROHA_ED25519}) if(WIN32) TARGET_LINK_LIBRARIES(Gradido_LoginServer_Test optimized ${MYSQL_LIBRARIES} Shlwapi) TARGET_LINK_LIBRARIES(Gradido_LoginServer_Test debug ${COMPILED_MARIADB_CLIENT_DEBUG} Shlwapi) -else(WIN32) - target_link_libraries(Gradido_LoginServer_Test libmariadb protoc protobuf -pthread) -endif(WIN32) +else() + target_link_libraries(Gradido_LoginServer_Test libmariadb ${Protobuf_LIBRARIES} -pthread) +endif() add_test(NAME main COMMAND Gradido_LoginServer_Test) diff --git a/Dockerfile b/Dockerfile index 7da73563c..1220b5279 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,13 +6,26 @@ ENV DOCKER_WORKDIR="/code" USER root RUN apt-get update && \ - apt-get install -y --no-install-recommends protobuf-compiler && \ + apt-get install -y --no-install-recommends protobuf-compiler libprotobuf-dev && \ apt-get autoclean && \ apt-get autoremove && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* - +#RUN grep processor /proc/cpuinfo | wc -l + +#RUN mkdir -p "/helper" +#WORKDIR "/helper" +#RUN git clone --recurse-submodules https://github.com/protocolbuffers/protobuf.git +#RUN cd protobuf && \ + #git checkout v3.14.0 && \ + #./autogen.sh && \ + #./configure && \ + #make -j$(grep processor /proc/cpuinfo | wc -l) && \ + #make check && \ + #make install && \ + #ldconfig + RUN mkdir -p ${DOCKER_WORKDIR} WORKDIR ${DOCKER_WORKDIR} @@ -43,3 +56,5 @@ RUN mkdir build && \ cmake .. && \ make -j$(grep processor /proc/cpuinfo | wc -l) +# deploy +#From \ No newline at end of file diff --git a/conanfile.txt b/conanfile.txt index 96bd6f5c8..a6c09d9fa 100644 --- a/conanfile.txt +++ b/conanfile.txt @@ -1,7 +1,6 @@ [requires] Poco/1.9.4@pocoproject/stable libsodium/1.0.18@bincrafters/stable -protobuf/3.9.1@bincrafters/stable boost/1.71.0@conan/stable gtest/1.8.1@bincrafters/stable