[FindBISON,FindFLEX] Unable to create directories
When directories of paths given as arguments to bison_target
and flex_target
do not exist, an existence error is emitted. It is not possible to create these directories ahead of time, because in order for the custom target that does this (see below) to run prior to Bison and Flex, a dependency must be defined. But add_dependency()
does not work on the targets created by bison_target
and flex_target
(Cannot add target-level dependencies to non-existent target "NTriplesParser"
).
add_custom_target(build-time-make-directories
ALL
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/include
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/log
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/src)
Expected: bison_target
and flex_target
to create directories for their argument paths, of their targets to become regular targets for which dependencies can be defined.
The above is independent of whether or not CMP0088
is OLD
or NEW
. A workaround is to create these subdirectories (/include
, /log
) munually inside the build directory.