diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | CMakeLists.txt | 14 | ||||
-rw-r--r-- | VERSION | 1 | ||||
-rw-r--r-- | cmake/lang_cfg.cmake | 2 | ||||
-rw-r--r-- | cmake/version.cmake | 6 | ||||
-rw-r--r-- | src/CMakeLists.txt | 5 | ||||
-rwxr-xr-x | src/lang_cfg.py | 8 |
7 files changed, 19 insertions, 18 deletions
@@ -9,7 +9,6 @@ *.pro /.makeconfig /.tmakeconfig -/VERSION /src/libdoxycfg.t /src/libdoxygen.t /packages/rpm/doxygen.spec diff --git a/CMakeLists.txt b/CMakeLists.txt index bc36d23..aa1902a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,6 +22,7 @@ option(build_doc "Build user manual" OFF) option(use_sqlite3 "Add support for sqlite3 output [experimental]." OFF) option(use_libclang "Add support for libclang parsing." OFF) option(win_static "Link with /MT in stead of /MD on windows" OFF) +option(english_only "Only compile in support for the English language" OFF) list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") include(version) @@ -72,6 +73,19 @@ set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin) set(CUSTOM_INCLUDE_DIR "" CACHE FILEPATH "Extra include path") set(CUSTOM_LINK_DIR "" CACHE FILEPATH "Extra library path") +# gather lang codes for translation +if (english_only) # user only wants English + set(LANG_CODES "ENONLY") +else() # find languages based on available translator files + set(LANG_CODES "") + file(GLOB lang_files RELATIVE "${CMAKE_SOURCE_DIR}/src" "${CMAKE_SOURCE_DIR}/src/translator_??.h") + foreach (_lang ${lang_files}) + string(REGEX REPLACE "translator_(.*).h" "\\1" _lang_code ${_lang}) + string(TOUPPER ${_lang_code} lang_code) + list(APPEND LANG_CODES "${lang_code}") + endforeach() +endif() + if (${CUSTOM_INCLUDE_DIR}) include_directories(${CUSTOM_INCLUDE_DIR}) endif() @@ -0,0 +1 @@ +1.8.9.1 diff --git a/cmake/lang_cfg.cmake b/cmake/lang_cfg.cmake index b2b6708..c57d3ed 100644 --- a/cmake/lang_cfg.cmake +++ b/cmake/lang_cfg.cmake @@ -4,7 +4,7 @@ if(${CMAKE_ARGC} GREATER 1) else() math(EXPR UPTO ${CMAKE_ARGC}-1) foreach(i RANGE 3 ${UPTO}) - message("#define ENGLISH_${CMAKE_ARGV${i}}") + message("#define LANG_${CMAKE_ARGV${i}}") endforeach() endif() endif() diff --git a/cmake/version.cmake b/cmake/version.cmake index 0c5add9..2ebf42d 100644 --- a/cmake/version.cmake +++ b/cmake/version.cmake @@ -1,8 +1,2 @@ file (STRINGS "VERSION" VERSION) -#string(REGEX MATCH "([0-9]+).([0-9]+).([0-9]+)" ${doxygen_version_major} ${doxygen_version_minor} ${doxygen_version_revision} ) -#set(doxygen_version_major "1" CACHE STRING "Major") -#set(doxygen_version_minor "8" CACHE STRING "Minor") -#set(doxygen_version_revision "9.1" CACHE STRING "Revision") -#set(doxygen_version_mmn "-5" CACHE STRING "Mmn") -#set(VERSION "${doxygen_version_major}.${doxygen_version_minor}.${doxygen_version_revision}${doxygen_version_mmn}") set(ENV{VERSION} "${VERSION}") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1ca6d43..155bf77 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -11,6 +11,7 @@ include_directories( file(MAKE_DIRECTORY ${GENERATED_SRC}) +file(GLOB LANGUAGE_FILES "${CMAKE_SOURCE_DIR}/src/translator_??.h") # instead of increasebuffer.py add_definitions(-DYY_BUF_SIZE=262144 -DYY_READ_BUF_SIZE=262144) @@ -54,11 +55,11 @@ add_custom_command( ) set_source_files_properties(${GENERATED_SRC}/ce_parse.h PROPERTIES GENERATED 1) - # lang_cfg.h add_custom_command( COMMENT "Generating ${GENERATED_SRC}/lang_cfg.h" - COMMAND ${CMAKE_COMMAND} -P ${CMAKE_SOURCE_DIR}/cmake/lang_cfg.cmake ENONLY 2> ${GENERATED_SRC}/lang_cfg.h + COMMAND ${CMAKE_COMMAND} -P ${CMAKE_SOURCE_DIR}/cmake/lang_cfg.cmake ${LANG_CODES} 2> ${GENERATED_SRC}/lang_cfg.h + DEPENDS ${LANGUAGE_FILES} OUTPUT ${GENERATED_SRC}/lang_cfg.h ) set_source_files_properties(${GENERATED_SRC}/lang_cfg.h PROPERTIES GENERATED 1) diff --git a/src/lang_cfg.py b/src/lang_cfg.py deleted file mode 100755 index efed05f..0000000 --- a/src/lang_cfg.py +++ /dev/null @@ -1,8 +0,0 @@ -import sys - -if (len(sys.argv) > 1): - if (sys.argv[1] == "ENONLY"): - print("#define ENGLISH_ONLY") - else: - for x in range(1, len(sys.argv)): - print("#define LANG_%s"%(sys.argv[x])) |