On Sun, Jan 27, 2013 at 3:12 AM, Kornel Benko <kor...@lyx.org> wrote: > Am Sonntag, 27. Januar 2013 um 02:10:58, schrieb Scott Kostyshak > <skost...@lyx.org> > > .... > >> >> > >> >> Should be easy. > >> > > >> > Ah yes you're right. You are convincing me more and more that > >> > out-of-source builds have many advantages and no disadvantages. So all > >> > is needed is just to copy the .lyx file there. > >> > > >> > Scott > >> > >> Please see the attached patches. Everything works fine under CMake, > >> except that another mystery (for me, at least) has appeared. The new > >> autotest only works for me if I revert the XVKBD_HACKED commit > >> (dae22baf). If that commit is left in, everything works fine except > >> that \[Return] does not get rid of the warning that is given on > >> opening the .lyx file. If you quickly press return manually, the rest > >> of the test works fine. This same behavior happens under autotools > >> with XVKBD_HACKED set. (Note that I haven't figured out yet how to run > >> the autotools tests without setting XVKBD_HACKED so I can't test > >> that.) > >> > >> Why would there be this difference depending on XVKBD_HACKED? The most > >> surprising thing is that my system version of xvkbd was installed from > >> the version in LyX (with make install) so I don't think it could be > >> differences in the versions. > > > > This surprises me. Checking the created package, there is no xvkbd > contained. > > Also, we have no 'instal()' statement for xvkbd in the cmake-files.
I'm not sure what to do then. bug-8523-in.txt only works for me if XVKBD_HACKED is not hard-coded. > > > >> Note that the attached autotest should currently fail because #8523 is > >> not fixed yet. > >> > >> Any ideas? > >> > >> Kornel, do you have any comments on the CMake patch? > > > > Yes. > > single-test.cmake: > > > > 1.) What if KEYTEST_INFILE = "abcd-in.txtabcd-in.sh"? > > Then _jj is "abcdabcd-in.sh", but it should be "abcd-in.txtabcd" > > Therefore (notice the '$') > > string(REGEX REPLACE "-in\\.(txt|sh)$" "" _jj ${KEYTEST_INFILE}) Good point. I will change this. > 2.) We do not need BUILD_DIR, why not use "${WORKDIR}/.."? This is much nicer. I did not know you could do that in CMake. For example, I don't think you can use "~" to refer to /home/user/. Ah, but that's because ~ is Unix-specific I guess. > 3.) I wonder, why configure_file() is called that way. > > configure_file("${AUTOTEST_ROOT}/${_jj}.lyx" ${BUILD_DIR}) > > > > it should at least be > > configure_file("${AUTOTEST_ROOT}/${_jj}.lyx" "${BUILD_DIR}/${_jj}.lyx") > > > > but even that seams not needed yet, since there are no '@xyzzy@' strings in > bug-8523.lyx > > > > If you want to copy so > > execute_program(COMMAND ${CMAKE_COMMAND} -E copy > "${AUTOTEST_ROOT}/${_jj}.lyx" "${BUILD_DIR}/${_jj}.lyx") > > or > > configure_file("${AUTOTEST_ROOT}/${_jj}.lyx" "${BUILD_DIR}/${_jj}.lyx" > COPYONLY) > > > > should be enough. OK, I will change this. I am in the habit of writing copies of the form "cp filename folder1/folder2/" because (1) this prevents type errors such as "cp filename folder1/folder2/fielname" and (2) the reader of the code doesn't have to check whether the two filenames are exactly the same. But I guess with this form there are concerns that filename could overwrite folder2? > bug-8523-in.txt: > > > > I would change the file, there is also no need to remove, on next test it > will be overwritten anyway > > and we can check the result too. > > > > TestBegin ../bug-8523.lyx > lyx-log.txt 2>&1 > > KK: \[Home] > > KK: some text > > KK: \Ax > > KK: buffer-save\[Return] > > TestEnd > > I don't understand. First, on opening bug-8523.lyx you should immediately see a warning which must be addressed. This is where the \[Return] works if XVKBD_HACKED is not automatically set. Also, I don't see a way around saving to another file because that is what triggers the bug. Thanks a lot for reviewing the patches, Scott