Created
December 12, 2019 12:28
-
-
Save handicraftsman/87255754eb059b1bd9c53fca0d0cff3a to your computer and use it in GitHub Desktop.
LibFinder.cmake
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
macro(_LIBFINDER_LIB variable lib) | |
find_library(${lib}-LIB ${lib}) | |
if(${lib}-LIB-NOTFOUND) | |
message(FATAL "Unable to find library ${lib}") | |
endif() | |
message(STATUS "${lib} library at ${${lib}-LIB}") | |
list(APPEND ${variable} ${${lib}-LIB}) | |
endmacro() | |
macro(LIBFINDER_LIBRARIES variable) | |
foreach(lib ${ARGN}) | |
_LIBFINDER_LIB("${variable}" "${lib}") | |
endforeach() | |
endmacro() | |
macro(_LIBFINDER_DIR variable file) | |
find_path(${file}-FILE ${file}) | |
if(${file}-FILE-NOTFOUND) | |
message(FATAL "Unable to find directory for file ${file}") | |
endif() | |
message(STATUS "${file} file at ${${file}-FILE} directory") | |
list(APPEND ${variable} ${${file}-FILE}) | |
endmacro() | |
macro(LIBFINDER_DIRECTORIES variable) | |
foreach(file ${ARGN}) | |
_LIBFINDER_DIR("${variable}" "${file}") | |
endforeach() | |
endmacro() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment