diff options
author | Přemysl Eric Janouch <p@janouch.name> | 2021-11-16 03:33:54 +0100 |
---|---|---|
committer | Přemysl Eric Janouch <p@janouch.name> | 2021-11-16 04:48:52 +0100 |
commit | e66e9f249a2e42aaea2b92b36118a2f1c9c47618 (patch) | |
tree | 7f0dc6037d5b088518731648eae920271e912973 /CMakeLists.txt | |
parent | 32203f81171b699255533bb03487dd4912beaf17 (diff) | |
download | nncmpp-e66e9f249a2e42aaea2b92b36118a2f1c9c47618.tar.gz nncmpp-e66e9f249a2e42aaea2b92b36118a2f1c9c47618.tar.xz nncmpp-e66e9f249a2e42aaea2b92b36118a2f1c9c47618.zip |
Rename an action to be shorter
Also, fix make dependencies to include the source file for actions.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 2e637cd..c4ad3ce 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -91,9 +91,10 @@ configure_file (${PROJECT_SOURCE_DIR}/config.h.in include_directories (${PROJECT_SOURCE_DIR} ${PROJECT_BINARY_DIR}) # Assuming a Unix-compatible system with a standalone preprocessor +set (actions_list ${PROJECT_SOURCE_DIR}/nncmpp.actions) set (actions ${PROJECT_BINARY_DIR}/nncmpp-actions.h) add_custom_command (OUTPUT ${actions} - COMMAND cpp -I${PROJECT_BINARY_DIR} -P ${PROJECT_SOURCE_DIR}/nncmpp.actions + COMMAND cpp -I${PROJECT_BINARY_DIR} -P ${actions_list} | grep . | tr [[\n]] ^ | sed -ne [[h; s/,[^^]*/,/g]] -e [[s/$/COUNT/]] -e [[s/[^^]*/\tACTION_&/g]] -e [[s/.*/enum action {\n&\n};\n/p]] -e [[g; s/,[^^]*//g; y/_/-/]] -e [[s/[^^]\{1,\}/\t"&",/g]] @@ -102,7 +103,7 @@ add_custom_command (OUTPUT ${actions} -e [[s/.*/static const char *g_action_descriptions[] = {\n&};/p]] | tr ^ [[\n]] > ${actions} COMMAND test -s ${actions} - DEPENDS ${PROJECT_BINARY_DIR}/config.h VERBATIM) + DEPENDS ${actions_list} ${PROJECT_BINARY_DIR}/config.h VERBATIM) # Build the main executable and link it add_executable (${PROJECT_NAME} ${PROJECT_NAME}.c ${actions}) |