Skip to content

Commit

Permalink
Added support for language codes
Browse files Browse the repository at this point in the history
  • Loading branch information
Dimitri van Heesch committed May 31, 2015
1 parent 5f67c67 commit eae07d9
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 18 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
*.pro
/.makeconfig
/.tmakeconfig
/VERSION
/src/libdoxycfg.t
/src/libdoxygen.t
/packages/rpm/doxygen.spec
Expand Down
14 changes: 14 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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()
Expand Down
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.8.9.1
2 changes: 1 addition & 1 deletion cmake/lang_cfg.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
6 changes: 0 additions & 6 deletions cmake/version.cmake
Original file line number Diff line number Diff line change
@@ -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}")
5 changes: 3 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
8 changes: 0 additions & 8 deletions src/lang_cfg.py

This file was deleted.

0 comments on commit eae07d9

Please sign in to comment.