Skip to content

Commit

Permalink
minor cmake for msgs
Browse files Browse the repository at this point in the history
  • Loading branch information
SyllogismRXS committed Oct 25, 2017
1 parent a580954 commit 73c8464
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions msgs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ file(MAKE_DIRECTORY ${GEN_DIR})

foreach(PROTO_FILE ${PROTO_FILE_LIST})
# Get the name of the file without extension
# name.proto -> name
# name.proto -> name

get_filename_component(PROTO_NAME ${PROTO_FILE} NAME_WE)
get_filename_component(ABS_PROTO_NAME ${PROTO_FILE} REALPATH)

set(PROTO_FILE_GEN_CPP_FILES
${GEN_DIR}/${PROTO_NAME}.pb.cc
${GEN_DIR}/${PROTO_NAME}.pb.cc
)
set(PROTO_FILE_GEN_H_FILES
${GEN_DIR}/${PROTO_NAME}.pb.h
Expand All @@ -32,7 +32,7 @@ foreach(PROTO_FILE ${PROTO_FILE_LIST})

add_custom_command(
OUTPUT ${PROTO_FILE_GEN_FILES}
COMMAND ${PROTOBUF_PROTOC_EXECUTABLE} ${ABS_PROTO_NAME} --proto_path=${CMAKE_CURRENT_SOURCE_DIR} --cpp_out=${GEN_DIR} --python_out=${GEN_DIR}
COMMAND ${PROTOBUF_PROTOC_EXECUTABLE} ${ABS_PROTO_NAME} --proto_path=${CMAKE_CURRENT_SOURCE_DIR} --cpp_out=${GEN_DIR} --python_out=${GEN_DIR}
DEPENDS ${PROTO_FILE}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
Expand All @@ -46,14 +46,14 @@ foreach(PROTO_FILE ${PROTO_FILE_LIST})
# Make a list of all generated H files
set(GEN_H_FILES
${GEN_H_FILES}
${PROTO_FILE_GEN_H_FILES}
${PROTO_FILE_GEN_H_FILES}
)
endforeach()

##############################################
# Library Creation #
##############################################
SET (LIBRARY_NAME scrimmage-msgs)
SET (LIBRARY_NAME ${PROJECT_NAME}-msgs)
SET (LIB_MAJOR 0)
SET (LIB_MINOR 0)
SET (LIB_RELEASE 1)
Expand All @@ -63,17 +63,17 @@ ADD_LIBRARY( ${LIBRARY_NAME} SHARED
${GEN_H_FILES}
)

target_link_libraries(${LIBRARY_NAME}
${PROTOBUF_LIBRARIES}
target_link_libraries(${LIBRARY_NAME}
${PROTOBUF_LIBRARIES}
)

SET (_soversion ${LIB_MAJOR}.${LIB_MINOR}.${LIB_RELEASE})

set_target_properties(
${LIBRARY_NAME}
PROPERTIES
PROPERTIES
SOVERSION ${LIB_MAJOR}
VERSION ${_soversion}
VERSION ${_soversion}
)

install(TARGETS ${LIBRARY_NAME}
Expand Down

0 comments on commit 73c8464

Please sign in to comment.