htrdr

Solving radiative transfer in heterogeneous media
git clone git://git.meso-star.fr/htrdr.git
Log | Files | Refs | README | LICENSE

commit e4d069f508b7e3fd5266fe7b4d3a9b95292983a1
parent 06a309a6d58c2822d81ec64449d80db705febbaa
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Mon, 12 Nov 2018 11:44:53 +0100

Small clean up of CMake files

Diffstat:
Mcmake/CMakeLists.txt | 5-----
Mcmake/doc/CMakeLists.txt | 89+++++++++++++++++++++++++++++++------------------------------------------------
2 files changed, 35 insertions(+), 59 deletions(-)

diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt @@ -20,9 +20,6 @@ enable_testing() set(HTRDR_SOURCE_DIR ${PROJECT_SOURCE_DIR}/../src) option(NO_TEST "Do not build the tests" OFF) -set(HTRDR_DOC "TROFF & HTML" CACHE STRING - "Type of the documentation to generate install.") - ################################################################################ # Check dependencies ################################################################################ @@ -128,8 +125,6 @@ rcmake_prepend_path(HTRDR_FILES_INC ${HTRDR_SOURCE_DIR}) rcmake_prepend_path(HTRDR_FILES_INC2 ${CMAKE_CURRENT_BINARY_DIR}) rcmake_prepend_path(HTRDR_FILES_DOC ${PROJECT_SOURCE_DIR}/../) -message(STATUS ${HTRDR_FILES_INC2}) - add_executable(htrdr ${HTRDR_FILES_SRC} ${HTRDR_FILES_INC} ${HTRDR_FILES_INC2}) target_link_libraries(htrdr HTCP HTGOP HTMIE RSys Star3D Star3DAW StarSF StarSP StarVX) diff --git a/cmake/doc/CMakeLists.txt b/cmake/doc/CMakeLists.txt @@ -13,32 +13,15 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. -string(REGEX MATCH ".*HTML.*" _html ${HTRDR_DOC}) -string(REGEX MATCH ".*ROFF.*" _roff ${HTRDR_DOC}) - -set(HTRDR_DOC_DIR ${PROJECT_SOURCE_DIR}/../doc) - ################################################################################ -# Look for asciidoc and a2x programs +# Look for the a2x program ################################################################################ -if(_html) - find_program(ASCIIDOC NAMES asciidoc asciidoc.py) - if(NOT ASCIIDOC) - unset(_html) - message(WARNING - "The `asciidoc' program is missing. " - "The htrdr HTML documentation cannot be generated.") - endif() -endif() - -if(_roff) - find_program(A2X NAMES a2x a2x.py) - if(NOT A2X) - unset(_roff) - message(WARNING - "The `a2x' program is missing. " - "The htrdr man pages cannot be generated.") - endif() +find_program(A2X NAMES a2x a2x.py) +if(NOT A2X) + unset(_roff) + message(WARNING + "The `a2x' program is missing. " + "The htrdr man pages cannot be generated.") endif() ################################################################################ @@ -54,37 +37,35 @@ list(APPEND MAN_NAMES htrdr.1) ################################################################################ # ROFF man pages ################################################################################ -if(_roff) - set(A2X_OPTS -dmanpage -fmanpage) - set(MAN_FILES) - set(MAN5_FILES) - set(MAN1_FILES) - foreach(_name IN LISTS MAN_NAMES) - set(_man ${CMAKE_CURRENT_BINARY_DIR}/${_name}) - set(_txt ${CMAKE_CURRENT_BINARY_DIR}/${_name}.txt) +set(A2X_OPTS -dmanpage -fmanpage) +set(MAN_FILES) +set(MAN5_FILES) +set(MAN1_FILES) +foreach(_name IN LISTS MAN_NAMES) + set(_man ${CMAKE_CURRENT_BINARY_DIR}/${_name}) + set(_txt ${CMAKE_CURRENT_BINARY_DIR}/${_name}.txt) - add_custom_command( - OUTPUT ${_man} - COMMAND ${A2X} ${A2X_OPTS} ${_txt} - DEPENDS man-copy ${_txt} - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} - COMMENT "Build ROFF man page ${_man}" - VERBATIM) - list(APPEND MAN_FILES ${_man}) + add_custom_command( + OUTPUT ${_man} + COMMAND ${A2X} ${A2X_OPTS} ${_txt} + DEPENDS man-copy ${_txt} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMENT "Build ROFF man page ${_man}" + VERBATIM) + list(APPEND MAN_FILES ${_man}) - string(REGEX MATCH "^.*.5$" _man5 ${_man}) - string(REGEX MATCH "^.*.1$" _man1 ${_man}) - if(_man1) - list(APPEND MAN1_FILES ${_man1}) - elseif(_man5) - list(APPEND MAN5_FILES ${_man5}) - else() - message(FATAL_ERROR "Unexpected man type") - endif() - endforeach() - add_custom_target(man-roff ALL DEPENDS ${MAN_FILES}) + string(REGEX MATCH "^.*.5$" _man5 ${_man}) + string(REGEX MATCH "^.*.1$" _man1 ${_man}) + if(_man1) + list(APPEND MAN1_FILES ${_man1}) + elseif(_man5) + list(APPEND MAN5_FILES ${_man5}) + else() + message(FATAL_ERROR "Unexpected man type") + endif() +endforeach() +add_custom_target(man-roff ALL DEPENDS ${MAN_FILES}) - install(FILES ${MAN1_FILES} DESTINATION share/man/man1) - install(FILES ${MAN5_FILES} DESTINATION share/man/man5) -endif() +install(FILES ${MAN1_FILES} DESTINATION share/man/man1) +install(FILES ${MAN5_FILES} DESTINATION share/man/man5)