blob: c2612702487958932e2b2a76c316f3c7e1d67d30 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
MACRO (CHECK_LIBRARY_WORKS _header _code _include _library _target)
set(CHECK_LIBRARY_WORKS_BACKUP_INCLUDES "${CMAKE_REQUIRED_INCLUDES}")
set(CHECK_LIBRARY_WORKS_BACKUP_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}")
set(CMAKE_REQUIRED_INCLUDES "${_include}")
set(CMAKE_REQUIRED_LIBRARIES "${_library}")
CHECK_C_SOURCE_COMPILES("
#ifdef _WIN32
#include <windows.h>
#endif
#include <${_header}>
int main(void) {
${_code}
return 0;
}
" "${_target}")
set(CMAKE_REQUIRED_INCLUDES "${CHECK_LIBRARY_WORKS_BACKUP_INCLUDES}")
set(CMAKE_REQUIRED_LIBRARIES "${CHECK_LIBRARY_WORKS_BACKUP_LIBRARIES}")
ENDMACRO()
|