summaryrefslogtreecommitdiff
path: root/app/help/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'app/help/CMakeLists.txt')
-rw-r--r--app/help/CMakeLists.txt78
1 files changed, 62 insertions, 16 deletions
diff --git a/app/help/CMakeLists.txt b/app/help/CMakeLists.txt
index 34c8d33..efc7b23 100644
--- a/app/help/CMakeLists.txt
+++ b/app/help/CMakeLists.txt
@@ -1,26 +1,72 @@
-PROJECT(help)
+project(messagefile)
-ADD_EXECUTABLE(genhelp genhelp.c cJSON.c cJSON.h)
+#
+# genhelp is used in ..\bin to generate the tooltip texts
-ADD_EXECUTABLE(genmessages genmessages.c)
+add_executable(genhelp "")
+target_sources(genhelp
+ PRIVATE
+ genhelp.c)
-IF(XTRKCAD_USE_GETTEXT)
- SET(GENMESSAGES_OPTS "-i18n")
-ELSE(XTRKCAD_USE_GETTEXT)
- SET(GENMESSAGES_OPTS "")
-ENDIF(XTRKCAD_USE_GETTEXT)
+target_link_libraries(genhelp
+ PUBLIC
+ cJSON
+)
-ADD_CUSTOM_COMMAND(
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/messages.h ${CMAKE_CURRENT_BINARY_DIR}/messages.but
+#
+# interpreter for message source file
+
+add_executable(genmessages "")
+
+target_sources(genmessages PUBLIC
+ genmessages.c
+)
+
+set_source_files_properties(
+ genhelp.json messages.in xtrkcad.tip
+ PROPERTIES HEADER_FILE_ONLY TRUE
+)
+
+#
+# Generate message include file and the input file for the help system
+
+if(XTRKCAD_USE_GETTEXT)
+ set(GENHELP_OPTS "-bhi" )
+ set(GENMESSAGES_OPTS "-i18n")
+else()
+ set(GENHELP_OPTS "-bh" )
+ set(GENMESSAGES_OPTS "")
+endif()
+
+add_custom_command(
+ OUTPUT bllnhlp.c
+ DEPENDS genhelp genhelp.json
+ COMMAND genhelp ${GENHELP_OPTS} ${CMAKE_CURRENT_SOURCE_DIR}/genhelp.json ${CMAKE_CURRENT_BINARY_DIR}/bllnhlp.c
+)
+
+add_custom_target(balloonhelp ALL
+ DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/bllnhlp.c
+)
+
+add_custom_command(
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/messages.h ${CMAKE_CURRENT_BINARY_DIR}/messages.but
DEPENDS genmessages ${CMAKE_CURRENT_SOURCE_DIR}/messages.in
- COMMAND genmessages ${GENMESSAGES_OPTS} ${CMAKE_CURRENT_SOURCE_DIR}/messages.in ${CMAKE_CURRENT_BINARY_DIR}/messages.but
- )
+ COMMAND genmessages ${GENMESSAGES_OPTS} ${CMAKE_CURRENT_SOURCE_DIR}/messages.in ${CMAKE_CURRENT_BINARY_DIR}/messages.but
+)
-ADD_CUSTOM_TARGET(Help ALL
+add_custom_target(msgfiles ALL
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/messages.h ${CMAKE_CURRENT_BINARY_DIR}/messages.but
- )
+)
-INSTALL(
+install(
FILES xtrkcad.tip
DESTINATION ${XTRKCAD_SHARE_INSTALL_DIR}
- )
+)
+
+set_target_properties(
+ msgfiles
+ balloonhelp
+ genmessages
+ genhelp
+ PROPERTIES FOLDER HelpDocs
+) \ No newline at end of file