[hatari-devel] cmake doesn't find readline
Thomas Huth
huth at users.berlios.de
Sun Feb 21 16:31:38 CET 2010
Hi!
On Sun, 21 Feb 2010 15:06:37 +0100 (CET)
npomarede at corp.free.fr wrote:
> Replying to myself, I used CMAKE_REQUIRED_LIBRARIES before the call
> to check_function_exists :
>
> diff -r db449c77e9b2 CMakeLists.txt
> --- a/CMakeLists.txt Sun Feb 21 12:03:53 2010 +0200
> +++ b/CMakeLists.txt Sun Feb 21 15:00:50 2010 +0100
> @@ -46,6 +46,7 @@
>
> find_package(Readline)
> if(READLINE_FOUND)
> + set(CMAKE_REQUIRED_LIBRARIES "readline")
> check_function_exists(rl_filename_completion_function
> HAVE_RL_COMPLETION_FUNCTION) if(HAVE_RL_COMPLETION_FUNCTION)
> set(HAVE_LIBREADLINE 1)
>
>
> I don't know if this is the most efficient way to fix this, but it
> fixed the problem and readline is working under the debugger.
Looks like the right fix to me, please commit it!
> Another "problem" : after running cmake, "hg diff" is now reporting
> all the Makefile files in the various subdirs as being modified (as
> they were replaced by the cmake version). Which means a "hg ci/push"
> would overwrite the original Makefile files on berlios, which may not
> be what we want.
>
> Is there a way to handle this ?
Yes, there are several solutions:
1) Force Eero to also use cmake, than we can remove the old
Makefiles ;-)
2) Use "make distclean" before the check-in, this should remove the
generated Makefiles
3) Do an out-of-source build instead, i.e. run the initial "cmake" from
a separate folder that is not part of the source tree.
4) Maybe rename the old Makefiles to GNUmakefile, since this file name
is accepted by GNU make, too... but I doubt that this will work
well since the name "GNUmakefile" seems to have a higher priority for
make than "Makefile".
Regards,
Thomas
More information about the hatari-devel
mailing list