]> git.proxmox.com Git - ceph.git/blob - ceph/cmake/modules/ExternalProjectHelper.cmake
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / cmake / modules / ExternalProjectHelper.cmake
1 function (set_library_properties_for_external_project _target _lib)
2 # Manually create the directory, it will be created as part of the build,
3 # but this runs in the configuration phase, and CMake generates an error if
4 # we add an include directory that does not exist yet.
5 set(_libfullname "${CMAKE_SHARED_LIBRARY_PREFIX}${_lib}${CMAKE_SHARED_LIBRARY_SUFFIX}")
6 set(_libpath "${CMAKE_BINARY_DIR}/external/lib/${_libfullname}")
7 set(_includepath "${CMAKE_BINARY_DIR}/external/include")
8 message(STATUS "Configuring ${_target} with ${_libpath}")
9
10 file(MAKE_DIRECTORY "${_includepath}")
11 set_target_properties(${_target} PROPERTIES
12 INTERFACE_LINK_LIBRARIES "${_libpath}"
13 IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
14 IMPORTED_LOCATION "${_libpath}"
15 INTERFACE_INCLUDE_DIRECTORIES "${_includepath}")
16 # set_property(TARGET ${_target} APPEND PROPERTY IMPORTED_LINK_INTERFACE_LIBRARIES "CXX")
17 endfunction ()