Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better errors #22

Merged
merged 2 commits into from
Feb 1, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions cmake/genmsg-extras.cmake.em
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ macro(add_message_files)
message(FATAL_ERROR "add_message_files() directory not found: ${MESSAGE_DIR}")
endif()

if(${PROJECT_NAME}_GENERATE_MESSAGES)
message(FATAL_ERROR "generate_messages() must be called after add_message_files()")
endif()

# if FILES are not passed search message files in the given directory
# note: ARGV is not variable, so it can not be passed to list(FIND) directly
set(_argv ${ARGV})
Expand Down Expand Up @@ -109,6 +113,10 @@ macro(add_service_files)
message(FATAL_ERROR "add_service_files() directory not found: ${SERVICE_DIR}")
endif()

if(${PROJECT_NAME}_GENERATE_MESSAGES)
message(FATAL_ERROR "generate_messages() must be called after add_service_files()")
endif()

# if FILES are not passed search service files in the given directory
# note: ARGV is not variable, so it can not be passed to list(FIND) directly
set(_argv ${ARGV})
Expand Down Expand Up @@ -136,6 +144,11 @@ endmacro()

macro(generate_messages)
cmake_parse_arguments(ARG "" "" "DEPENDENCIES;LANGS" ${ARGN})

if(${PROJECT_NAME}_GENERATE_MESSAGES)
message(FATAL_ERROR "generate_messages() must only be called once per project'")
endif()

if(ARG_UNPARSED_ARGUMENTS)
message(FATAL_ERROR "generate_messages() called with unused arguments: ${ARG_UNPARSED_ARGUMENTS}")
endif()
Expand Down