Skip to content

Commit

Permalink
Changed CMakeLists so that protobuf files are generated automatically…
Browse files Browse the repository at this point in the history
… on project opening and only are generated if api.proto is changed (which leads to much faster build times on the pi)
  • Loading branch information
ClemensElflein committed Mar 13, 2019
1 parent 6f98515 commit fdf37d4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,6 @@ cmake-build-*/**

# protobuf build dir
protobuf/**

# CLion Files
.idea/**
13 changes: 8 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ project(self_o_mat)

set(CMAKE_CXX_STANDARD 14)

# Generate protobuf files on file change
add_custom_command(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/protobuf/api.pb.cc ${CMAKE_CURRENT_SOURCE_DIR}/protobuf/api.pb.h
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/api.proto
COMMAND /bin/sh ${CMAKE_CURRENT_SOURCE_DIR}/compile_protobuf.sh
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})



find_package(OpenCV REQUIRED)
find_package(Boost REQUIRED COMPONENTS system thread filesystem)
find_package(Cups REQUIRED)
Expand Down Expand Up @@ -48,9 +56,4 @@ endif()



add_custom_target( compile_protobuf
COMMAND /bin/sh ${CMAKE_CURRENT_SOURCE_DIR}/compile_protobuf.sh
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)

#add_dependencies(self_o_mat compile_protobuf)

0 comments on commit fdf37d4

Please sign in to comment.