bilke / cmake-modules

Additional CMake functionality. Most of the modules are from Ryan Pavlik (https://github.com/rpavlik/cmake-modules)
Boost Software License 1.0
542 stars 215 forks source link

GCOVR HTML target cannot create directory if base directory is given as an argument #80

Open cngzhnp opened 1 year ago

cngzhnp commented 1 year ago

In line 541,

The directory path was defined over PROJECT_BINARY_DIR variable but it must be calculated over BASEDIR variable because all base directory paths are assigned to this variable eventually.

Wrong approach:

# Create folder
    set(GCOVR_HTML_FOLDER_CMD
        ${CMAKE_COMMAND} -E make_directory ${PROJECT_BINARY_DIR}/${Coverage_NAME}
    )

Correct approach:

# Create folder
    set(GCOVR_HTML_FOLDER_CMD
        ${CMAKE_COMMAND} -E make_directory ${BASEDIR}/${Coverage_NAME}
    )