CMakeLists.txt 1.65 KB
Newer Older
Dion Haefner's avatar
Dion Haefner committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
function(scrape_parameters SOURCE_DIR XML_FILE CSS OUTPUT RESULT_NAME)
    message(STATUS "Running parameter scraper on sources ${SOURCE_DIR}")
    if(DEPLOY_SPHINX_SOURCE_URL)
        execute_process(COMMAND ${CMAKE_BINARY_DIR}/dune-env scrape_folder.py --source ${SOURCE_DIR}
                          --xml ${XML_FILE} --out ${OUTPUT} --css ${CSS}
                          --source_url ${DEPLOY_SPHINX_SOURCE_URL}
                          WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
                          RESULT_VARIABLE RETURN_CODE)
    else()
        execute_process(COMMAND ${CMAKE_BINARY_DIR}/dune-env scrape_folder.py --source ${SOURCE_DIR}
                          --xml ${XML_FILE} --out ${OUTPUT} --css ${CSS}
                          WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
                          RESULT_VARIABLE RETURN_CODE)
    endif()
    set(${RESULT_NAME} ${RETURN_CODE} PARENT_SCOPE)
endfunction()

file(COPY ${CMAKE_CURRENT_LIST_DIR} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/..)

Dion Haefner's avatar
Dion Haefner committed
20
scrape_parameters(${PROJECT_SOURCE_DIR}/dune/dorie-rfg ${CMAKE_CURRENT_SOURCE_DIR}/field-parameters.xml ${CMAKE_CURRENT_SOURCE_DIR}/parameters.css "parfield.ini;field-parameters.html;field-parameters.rst" FIELDPARSCRAPE_RETURN)
Dion Haefner's avatar
Dion Haefner committed
21 22 23 24
if (${FIELDPARSCRAPE_RETURN} GREATER 0)
    message(FATAL_ERROR "Parameter scraper failed. DORiE can not be built.")
endif()

Dion Haefner's avatar
Dion Haefner committed
25
scrape_parameters(${PROJECT_SOURCE_DIR}/dune/dorie ${CMAKE_CURRENT_SOURCE_DIR}/parameters.xml ${CMAKE_CURRENT_SOURCE_DIR}/parameters.css "config.ini;parameters.html;parameters.rst" PARSCRAPE_RETURN)
Dion Haefner's avatar
Dion Haefner committed
26 27 28
if (${PARSCRAPE_RETURN} GREATER 0)
    message(FATAL_ERROR "Parameter scraper failed. DORiE can not be built.")
endif()