سؤال

I am trying to add xapian search engine library in cmake file

project(search)
cmake_minimum_required(VERSION 2.8)
find_package(Xapian REQUIRED)

aux_source_directory(. SRC_LIST)
target_link_libraries(${PROJECT_NAME}
  ${Xapian_LIBRARY}
)
add_executable(${PROJECT_NAME} ${SRC_LIST})

This is not working can any one tell me how to add this if i compile with -lxapian it works

هل كانت مفيدة؟

المحلول

Swap target_link_libraries() and add_executable() calls. You can link library only to already defined target.

And use ${XAPIAN_LIBRARIES} instead of ${Xapian_LIBRARY}.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top