[CMake] CMake 2.4.2 dependency path qualifier bug
Brandon J. Van Every
bvanevery at gmail.com
Thu May 18 14:55:08 EDT 2006
CMake 2.4.2 is dropping directory path qualifiers, seemingly when a
generated file depends on a generated file. I have
- ${Chicken_BINARY_DIR}/csc.c, which needs
- ${Chicken_BINARY_DIR}/csc.scm, which needs
- ${Chicken_SOURCE_DIR}/csc.scm.in
but the generated makefile drops the ${Chicken_BINARY_DIR}/csc.scm
qualifier in the dependency. This causes something to erroneously look
for ${Chicken_SOURCE_DIR}/csc.scm and the build fails. My code:
# csc.c needs its own custom rule because csc.scm is generated.
# Could make macros that distinguish generated vs. non-generated
# arguments, but there aren't many cases of that, so doesn't
# seem worth it.
CONFIGURE_FILE(${Chicken_SOURCE_DIR}/csc.scm.in
${Chicken_BINARY_DIR}/csc.scm)
ADD_CUSTOM_COMMAND(
OUTPUT ${Chicken_BINARY_DIR}/csc.c
MAIN_DEPENDENCY ${Chicken_BINARY_DIR}/csc.scm
COMMAND ${VALID_CHICKEN} ${Chicken_BINARY_DIR}/csc.scm -output-file
${Chicken_BINARY_DIR}/csc.c ${CHICKEN_FLAGS}
)
and the output in csc.dir:
csc.c: csc.scm
@echo "Generating csc.c"
E:/Program\ Files/Chicken/chicken-static.exe
E:/devel/msys/chicken1/csc.scm -output-file E:/devel/msys/chicken1/csc.c
-quiet -no-trace -optimize-level 2 -include-path E:/devel/src/chicken
nsample.c: E:/devel/src/chicken/nsample.scm
@echo "Generating nsample.c"
E:/Program\ Files/Chicken/chicken-static.exe
E:/devel/src/chicken/nsample.scm -output-file
E:/devel/msys/chicken1/nsample.c nsample nsample -explicit-use -uses
library -uses eval -quiet -no-trace -optimize-level 2 -include-path
E:/devel/src/chicken
batch-driver.c: E:/devel/src/chicken/batch-driver.scm
@echo "Generating batch-driver.c"
E:/Program\ Files/Chicken/chicken-static.exe
E:/devel/src/chicken/batch-driver.scm -output-file
E:/devel/msys/chicken1/batch-driver.c batch-driver batch-driver -quiet
-no-trace -optimize-level 2 -include-path E:/devel/src/chicken
[etc.]
Note that all my other dependencies have fully qualified pathnames.
Note further, none of their .scm sources are generated, i.e. they're all
of the form ${Chicken_SOURCE_DIR}/*.scm. The error I get with csc.c:
Generating csc.c
make[2]: *** No rule to make target `E:/devel/src/chicken/csc.scm',
needed by `CMakeFiles/csc.dir/depend.make.mark'. Stop.
make[1]: *** [CMakeFiles/csc.dir/all] Error 2
make: *** [all] Error 2
Cheers,
Brandon Van Every
More information about the CMake
mailing list