[CMake] ADD_CUSTOM_COMMAND problem with cmake 2.4.3
Alexander Neundorf
a.neundorf-work at gmx.net
Thu Oct 5 08:51:14 EDT 2006
-------- Original-Nachricht --------
Datum: Thu, 5 Oct 2006 09:53:37 +0200
Von: "Gregor Berginc" <gregor.berginc at gmail.com>
An: cmake at cmake.org
Betreff: [CMake] ADD_CUSTOM_COMMAND problem with cmake 2.4.3
> Dear all,
>
> yesterday I faced wierd behaviour of the newest cmake. Before, I was
> using cmake version 2.4-patch 2 and the following command executed
> successfully:
> =
> ADD_CUSTOM_COMMAND(
> OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/${cpp_class}.h
> COMMAND ${JAVAH_RUNTIME}
> ARGS -verbose -classpath ${OUTPUT}/classes -d
> ${CMAKE_CURRENT_SOURCE_DIR} ${jni_class}
> )
>
> The command should use javah executable to compile the ${jni_class}
> into ${cpp_class}.h. The output should be placed in
> <project_root>/src/c++/balt/jni directory. Now, when I use cmake
> version 2.4-patch 3, I get the following error during make:
>
> make[2]: *** No rule to make target
> `../src/c++/balt/jni/balt_jni_NativeProcessLauncher.h', needed by
> `src/c++/balt/jni/CMakeFiles/FrameworkJNI.dir/JNIProcessInterface.o'.
> Stop.
> make[1]: *** [src/c++/balt/jni/CMakeFiles/FrameworkJNI.dir/all] Error 2
> make: *** [all] Error 2
>
> Note, that I am using out-of-source build which is started from
> <project_root>/.debug. Now, I am not sure why the command is not
> executed. The path
> ../src/c++/balt/jni/balt_jni_NativeProcessLauncher.h is correct if it
> is relative to the <project_root>/.debug. The file needs to be created
> under the src directory!
>
> What has changed since patch 2 version? Is this a bug or just my bad
> interpretation of ADD_CUSTOM_COMMAND and cmake variables?
You need to add the generated file to the list of sources for the target where it's needed. Then it will work.
Bye
Alex
--
GMX DSL-Flatrate 0,- Euro* - Überall, wo DSL verfügbar ist!
NEU: Jetzt bis zu 16.000 kBit/s! http://www.gmx.net/de/go/dsl
More information about the CMake
mailing list