On Fri, Mar 12, 2010 at 1:25 PM, Kornel Benko <[email protected]> wrote:
> Am Freitag 12 März 2010 schrieb Kornel Benko:
>> Am Freitag 12 März 2010 schrieb BH:
>> > I can't get cmake to recognize my enchant installation at /opt/local/.
>> > What cmake variable am I not setting correctly?
>> >
>> > BH
>>
>> To compile, you need the development package. We are searching for include
>> files _and_ for libraries. (So e.g. for ubuntu this is: libenchant-dev +
>> libenchant1c2a)
>>
>> Kornel
>>
>
> Read again, I see the "unusual" path, therefore you have to patch the
> CMakeLists.txt.
>
> In trunk, look at line 228:
> ...
> find_library(ENCHANT_LIBRARY "enchant" "/usr/local/lib" "/usr/lib")
> ....
> Here you may provide your path like this:
> find_library(ENCHANT_LIBRARY "enchant" "/usr/local/lib" "/usr/lib"
> "/opt/local/lib")
>
> Appropriate change also to find the include (provided it is
> "/opt/local/enchant")
> find_path(ENCHANT_INCLUDE_DIR "enchant++.h" PATHS /usr/local/include
> /usr/local/include/enchant /usr/include /usr/include/enchant
> /opt/local/enchant)
Thanks. I used
cmake -DENCHANT_LIBRARY=/opt/local/lib
-DENCHANT_INCLUDE_DIR=/opt/local/include/enchant
and now it works. However, when cmake finishes, it now spits out this warning:
WARNING: Target "LyX2.0" requests linking to directory
"/opt/local/lib". Targets may link only to libraries. CMake is
dropping the item.
... and then linking fails:
Linking CXX executable ../bin/LyX2.0
Undefined symbols:
"_enchant_dict_get_error", referenced from:
lyx::EnchantChecker::check(lyx::WordLangTuple const&)in EnchantChecker.o
"_enchant_dict_suggest", referenced from:
lyx::EnchantChecker::suggest(lyx::WordLangTuple const&,
lyx::docstring_list&)in EnchantChecker.o
"_enchant_broker_request_dict", referenced from:
lyx::EnchantChecker::Private::addSpeller(std::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&)in
EnchantChecker.o
"_enchant_dict_free_string_list", referenced from:
lyx::EnchantChecker::suggest(lyx::WordLangTuple const&,
lyx::docstring_list&)in EnchantChecker.o
"_enchant_dict_check", referenced from:
lyx::EnchantChecker::check(lyx::WordLangTuple const&)in EnchantChecker.o
"_enchant_broker_get_error", referenced from:
lyx::EnchantChecker::Private::addSpeller(std::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&)in
EnchantChecker.o
"_enchant_broker_free_dict", referenced from:
lyx::EnchantChecker::Private::~Private()in EnchantChecker.o
"_enchant_dict_add_to_session", referenced from:
lyx::EnchantChecker::accept(lyx::WordLangTuple const&)in EnchantChecker.o
"_enchant_broker_free", referenced from:
___tcf_0 in EnchantChecker.o
"_enchant_broker_init", referenced from:
__static_initialization_and_destruction_0(int, int)in EnchantChecker.o
"_enchant_dict_add", referenced from:
lyx::EnchantChecker::insert(lyx::WordLangTuple const&)in EnchantChecker.o
"_enchant_dict_describe", referenced from:
lyx::EnchantChecker::Private::addSpeller(std::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&)in
EnchantChecker.o
"_enchant_broker_dict_exists", referenced from:
lyx::EnchantChecker::hasDictionary(lyx::Language const*) constin
EnchantChecker.o
lyx::EnchantChecker::Private::addSpeller(std::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&)in
EnchantChecker.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[2]: *** [bin/LyX2.0] Error 1
make[1]: *** [src/CMakeFiles/LyX2.0.dir/all] Error 2
make: *** [all] Error 2
What am I doing wrong?
(Note: I can build lyx with enchant using autotools rather than cmake.)
BH