[bt-devel] Windows build system

Greg Hellings greg.hellings at gmail.com
Fri Feb 27 16:30:06 MST 2009


On Fri, Feb 27, 2009 at 4:46 PM, Eeli Kaikkonen
<eekaikko at mail.student.oulu.fi> wrote:
> I made DBus automatically detected so that it's used only if it exists.
> Greg, does it work now on Windows without any hassle with patches or project
> files? How about the FindSword.cmake, can I commit it?

I'll test the new FindSword.cmake in a few minutes and then report on
the new updates to the DBus stuff.  As for patching - yes, I still
have a number of files altered in my local copy, as follows:

backend\cmodulesearch.h - I still have pthread.h commented out.  SVN
still has it in.  This should be rectified.
backend\keys\cswordkey.cpp - stricmp/strcasecmp issue
backend\filters\bt_thmlhtml.cpp - stricmp/strcasecmp
backend\modules\cswordmoduleinfo.cpp - explicit casts to (const
TCHAR*) still need to be added in all the places I have enumerated
before.  All the calls to lucene::document::Field need their first two
arguments cast to (const TCHAR*),
lucene::queryparser::QueryParser::parse does as well and line 449
needs to look like
			lucene_wcstoutf8(utfBuffer, (const wchar_t *) doc->get((const
TCHAR*) _T("key")), BT_MAX_LUCENE_FIELD_LENGTH);

That is the sum total of the source changes that I have present in my
local Windows tree.  Just glancing through the FindSword.cmake, I'm
confused by line 30.  There it says to output "Found CLucene library:
${CLUCENE_LIBRARY}" if it has found the SWORD_LIBRARY.  I have a
feeling that might be an issue with me having taken most of that code
from the FindCLucene.cmake file, and I just neglected to change that.
Obviously that should read "Found SWORD library: ${SWORD_LIBRARY}"
instead.  However, that's just a cosmetic, user-output status message
and shouldn't affect its actual behavior.

The IF(WIN32) .... ELSE(WIN32) .... ENDIF(WIN32) structure shouldn't
be necessary.  Calls to pkg-config are superfluous if the rest of the
CMake is written properly - which is should be.  It is more or less an
exact copy of the CLucene.cmake file, which works fine.  The only real
problem before was that in WIN32, CMake is pretty much not going to
find where the libraries might have been built, and the file just
needs to get far enough to define the SWORD_LIBS and SWORD_LIBRARY_DIR
as unfound so that the user can manually point the CMake gui to the
proper location and continue.  The properly written CLucene file would
define that, whereas the pkg-config implementation of the
FindSword.cmake wouldn't.  But you might want to try using an
implementation of FindSword.cmake without relying on pkg-config at
all, since pkg-config is not actually a requirement of SWORD.  I
successfully used the version I submitted to you with no reference to
pkg-config on both Windows and on Mac to ensure that it works properly
in both environments, since I usually run without pkg-config on my Mac
and always without it in Windows.

--Greg

>
> --Eeli Kaikkonen
>
> _______________________________________________
> bt-devel mailing list
> bt-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/bt-devel
>



More information about the bt-devel mailing list