summaryrefslogtreecommitdiffstats
path: root/cmake/modules/UseCustomIncludes.cmake
blob: be01303e14895595dbd65c7b87ca5afbb02a45ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#
# - Include a custom CMake file relative to the current source directory.
# - If no filename is provided, CMakeListsCustom.txt is used.
#
macro( ADD_CUSTOM_CMAKE_INCLUDE  )
    if( ${ARGN} )
        set( _file_list ${ARGN} )
    else()
        set( _file_list CMakeListsCustom.txt )
    endif()
    foreach (_include ${_file_list})
        set( _include_file ${CMAKE_CURRENT_SOURCE_DIR}/${_include} )
        if( EXISTS ${_include_file} )
            message ( STATUS "Custom file found, including: ${_include_file}" )
            include( ${_include_file} )
        endif()
    endforeach()
endmacro()