]> granicus.if.org Git - icinga2/blob - cmake/SetFullDir.cmake
Merge pull request #7403 from Icinga/feature/docs-agents
[icinga2] / cmake / SetFullDir.cmake
1 # Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+
2 #
3 # Ensures a directory is absolute by prefixing CMAKE_INSTALL_PREFIX if it is not
4 # similar to CMAKE_INSTALL_FULL_... https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html
5 function(set_full_dir var path)
6   if(NOT IS_ABSOLUTE "${path}")
7     message(STATUS "Prefixing in ${var} \"${path}\" with ${CMAKE_INSTALL_PREFIX}")
8     set(path "${CMAKE_INSTALL_PREFIX}/${path}")
9   endif()
10   set(${var} "${path}" PARENT_SCOPE)
11 endfunction(set_full_dir)