[CMake] strange build problems
Bill Hoffman
bill.hoffman at kitware.com
Fri Apr 6 13:08:10 EDT 2007
Alan W. Irwin wrote:
> On 2007-04-06 08:56+0200 Klaas Gadeyne wrote:
>
>> Unfortunately, this was not the case, the line continuation problem is
>> due to emacs (which I use for typing emails) in auto-fill-mode (I
>> must have forgotten to turn it of when pasting the dynamic command)
>> I'll have a second try pasting the command now disabling autofill...
>>
>> /usr/bin/g++-3.4 -fPIC
>> `/root/install/xenomai-trunk-2.4.33-ipipe-1.2-08//bin/xeno-config
>> --posix-ldflags` -shared -Wl,-soname,libeml.so -o libeml.so
>> "CMakeFiles/eml-dynamic.dir/al/ethercat_process_data.o"
>> "CMakeFiles/eml-dynamic.dir/al/ethercat_slave_handler.o"
>> "CMakeFiles/eml-dynamic.dir/al/ethercat_AL.o"
>> "CMakeFiles/eml-dynamic.dir/al/ethercat_router.o"
>> "CMakeFiles/eml-dynamic.dir/al/ethercat_slave_conf.o"
>> "CMakeFiles/eml-dynamic.dir/al/ethercat_mbx.o"
>> "CMakeFiles/eml-dynamic.dir/al/ethercat_FSM.o"
>> "CMakeFiles/eml-dynamic.dir/al/ethercat_master.o"
>> "CMakeFiles/eml-dynamic.dir/dll/ethercat_slave_memory.o"
>> "CMakeFiles/eml-dynamic.dir/dll/ethercat_telegram.o"
>> "CMakeFiles/eml-dynamic.dir/dll/ethercat_dll.o"
>> "CMakeFiles/eml-dynamic.dir/dll/ethercat_device_addressed_telegram.o"
>> "CMakeFiles/eml-dynamic.dir/dll/ethercat_frame.o"
>> "CMakeFiles/eml-dynamic.dir/dll/ethercat_logical_addressed_telegram.o"
>> "CMakeFiles/eml-dynamic.dir/arch/RTnet/ethercat_xenomai_drv.o"
>> -L/root/install/xenomai-trunk-2.4.33-ipipe-1.2-08/lib
>> g++-3.4:
>> `/root/install/xenomai-trunk-2.4.33-ipipe-1.2-08//bin/xeno-config: No
>> such file or directory
>>
>> So that appears not to be the problem.
>
> It appears you now have a workaround with EXEC_PROGRAM, but if you
> want to
> follow this up (to help decide the question whether CMake has a bug), I
> suggest you make a simple "hello world) style example of the problem
> which
> makes it easy for anybody to replicate the problem. Use a config
> programme
> that is accessible to most people and which emits linker flags (e.g.,
> freetype-config --libs). Those extra linker flags should not
> interfere with
> the hello-world build, but if there is some general CMake problem with
> using
> "`" and a dynamic library build it should show for the simple example as
> well using any config programme that emits linker flags. OTOH, if
> xeno-config has the problem and freetype-config (or whatever) does not
> with
> the simple example, then that is an additional clue about what is causing
> trouble for CMake for the xeno-config case.
EXEC program is the right way to do this. Actually execute_process
should be used. The back tick approach of running stuff is not
portable, and only works with certain shells. It will fail in Xcode,
and possibly other IDE systems. There is a pkgconfig macro in cmake
that extracts this stuff using execute_process.
-Bill
More information about the CMake
mailing list