I am encountering a build failure and, upon a little inspection, the issue seems to be here;
|
foreach(HEADER IN LISTS HEADERS_REQUIRED) |
|
check_include_file(${HEADER} ${HEADER}_OK) |
|
if(NOT ${HEADER}_OK) |
|
message(FATAL_ERROR "header file ${HEADER} not found") |
|
endif() |
|
endforeach(HEADER) |
In particular, the HEADERS_REQUIRED variable contains two files; libvdeplug.h and slirp/libslirp.h. It seems that the latter is the problem, because it has a '/' in the path, and using that as part of a variable name (as the second parameter to check_include_file, on line 31) fails on my version of CMake. The following hack allows the build to complete and the resulting tools seem to do what they're supposed to;
foreach(HEADER IN LISTS HEADERS_REQUIRED)
- check_include_file(${HEADER} ${HEADER}_OK)
- if(NOT ${HEADER}_OK)
+ check_include_file(${HEADER} FOOBAR_OK)
+ if(NOT FOOBAR_OK)
message(FATAL_ERROR "header file ${HEADER} not found")
endif()
endforeach(HEADER)
Here, the same result variable is used for each/every header detection, which seems reasonable because you're not remembering/using these detection results later on - the build fails immediately unless they're TRUE. Otherwise, I assume another strategy would be required for having per-header detection variables. The precise CMake rules on what variable names can and can't be is not very clear, but the guidance is to keep it to alphanumeric + '_' + '-'; https://cmake.org/cmake/help/latest/manual/cmake-language.7.html#variables
BTW, this VDE stuff is awesome. Extremely useful. :-) Thanks!
I am encountering a build failure and, upon a little inspection, the issue seems to be here;
libvdeslirp/CMakeLists.txt
Lines 30 to 35 in 01af3c3
In particular, the
HEADERS_REQUIREDvariable contains two files;libvdeplug.handslirp/libslirp.h. It seems that the latter is the problem, because it has a'/'in the path, and using that as part of a variable name (as the second parameter tocheck_include_file, on line 31) fails on my version of CMake. The following hack allows the build to complete and the resulting tools seem to do what they're supposed to;Here, the same result variable is used for each/every header detection, which seems reasonable because you're not remembering/using these detection results later on - the build fails immediately unless they're TRUE. Otherwise, I assume another strategy would be required for having per-header detection variables. The precise CMake rules on what variable names can and can't be is not very clear, but the guidance is to keep it to alphanumeric + '_' + '-'; https://cmake.org/cmake/help/latest/manual/cmake-language.7.html#variables
BTW, this VDE stuff is awesome. Extremely useful. :-) Thanks!