Skip to content

Commit

Permalink
Merge pull request #26 from hasselmm/packaging
Browse files Browse the repository at this point in the history
Packaging
  • Loading branch information
Alan Wright committed May 7, 2012
2 parents 2ad20d1 + f666cb3 commit c6e5192
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 9 deletions.
12 changes: 9 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ INCLUDE(PCHSupport)
####################################
#include sub-projects
ADD_SUBDIRECTORY (src/core)
ADD_SUBDIRECTORY (src/contrib EXCLUDE_FROM_ALL)
ADD_SUBDIRECTORY (src/contrib)
ADD_SUBDIRECTORY (src/demo EXCLUDE_FROM_ALL)
ADD_SUBDIRECTORY (src/test)

Expand All @@ -163,8 +163,14 @@ ADD_SUBDIRECTORY (src/test)
# install pkg-config file
#################################
IF(NOT WIN32)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/liblucene++.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/liblucene++.pc @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/liblucene++.pc
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/liblucene++.pc.cmake
${CMAKE_CURRENT_BINARY_DIR}/liblucene++.pc @ONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/liblucene++-contrib.pc.cmake
${CMAKE_CURRENT_BINARY_DIR}/liblucene++-contrib.pc @ONLY)

install(FILES
${CMAKE_CURRENT_BINARY_DIR}/liblucene++.pc
${CMAKE_CURRENT_BINARY_DIR}/liblucene++-contrib.pc
DESTINATION ${LIB_DESTINATION}/pkgconfig )
ENDIF(NOT WIN32)

Expand Down
7 changes: 6 additions & 1 deletion cmake/Lucene++Docs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,12 @@ IF (ENABLE_DOCS)
)
ENDIF ( TAR AND GZIP )

#install man if it was built
#install HTML pages if they were built
IF ( DOCS_HTML AND NOT WIN32 )
INSTALL(DIRECTORY ${PROJECT_BINARY_DIR}/doc/html/ DESTINATION share/doc/lucene++-${LUCENE++_VERSION})
ENDIF ( DOCS_HTML AND NOT WIN32 )

#install man pages if they were built
IF ( DOCS_MAN )
INSTALL(DIRECTORY ${PROJECT_BINARY_DIR}/doc/man/ DESTINATION man)
ENDIF ( DOCS_MAN )
Expand Down
2 changes: 1 addition & 1 deletion cmake/MacroCheckGccVisibility.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ macro(MACRO_CHECK_GCC_VISIBILITY GccVisibility)

if (${GccVisibility} AND GCC_IS_NEWER_THAN_4_1 AND NOT _GCC_COMPILED_WITH_BAD_ALLOCATOR)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
set (KDE4_C_FLAGS "${KDE4_C_FLAGS}" "-fvisibility=hidden")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden")

if (GCC_IS_NEWER_THAN_4_2)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility-inlines-hidden")
Expand Down
14 changes: 14 additions & 0 deletions liblucene++-contrib.pc.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}/bin
libdir=${prefix}/@LIB_DESTINATION@
includedir=${prefix}/include/lucene++
lib=lucene++-contrib

Name: liblucene++-contrib
Description: Contributions for Lucene++ - a C++ search engine, ported from the popular Apache Lucene
Version: @LUCENE++_VERSION@
Libs: -L${prefix}/@LIB_DESTINATION@/ -l${lib}
Cflags: -I${includedir}
Requires: liblucene++=@LUCENE++_VERSION@
~

5 changes: 3 additions & 2 deletions src/contrib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ INCLUDE_DIRECTORIES(${lucene++-contrib_SOURCE_DIR}/include)
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})

install(FILES HEADERS
install(FILES ${HEADERS}
DESTINATION include/lucene++
COMPONENT development-contrib)

Expand Down Expand Up @@ -47,7 +47,8 @@ SET_TARGET_PROPERTIES(lucene++-contrib PROPERTIES
COMPILE_FLAGS -DLPP_HAVE_DLL
)
TARGET_LINK_LIBRARIES(lucene++-contrib
${CMAKE_THREAD_LIBS_INIT})
${CMAKE_THREAD_LIBS_INIT}
lucene++)
install(TARGETS lucene++-contrib
DESTINATION ${LIB_DESTINATION}
COMPONENT runtime )
Expand Down
2 changes: 1 addition & 1 deletion src/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ ADD_PRECOMPILED_HEADER(lucene++ ${lucene++-lib_SOURCE_DIR}/include/LuceneInc.h)
SET_TARGET_PROPERTIES(lucene++ PROPERTIES
VERSION ${LUCENE++_VERSION}
SOVERSION ${LUCENE++_SOVERSION}
COMPILE_FLAGS -DLPP_HAVE_DLL
)
TARGET_LINK_LIBRARIES(lucene++
lucene++-c
Expand All @@ -63,7 +64,6 @@ install(TARGETS lucene++
ADD_LIBRARY(lucene++-static STATIC EXCLUDE_FROM_ALL
${lucene_sources} ${HEADERS} ${INTERN_HEADERS}
)
SET(PCH_ADDITIONAL_COMPILER_FLAGS_lucene++-static -DLPP_HAVE_DLL)
ADD_PRECOMPILED_HEADER(lucene++-static ${lucene++-lib_SOURCE_DIR}/include/LuceneInc.h)
#set properties on the libraries
SET_TARGET_PROPERTIES(lucene++-static PROPERTIES
Expand Down
2 changes: 1 addition & 1 deletion src/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ TARGET_LINK_LIBRARIES(lucene++-tester
${Boost_UNIT_TEST_FRAMEWORK_LIBRARY_RELEASE}
${LUCENE_BOOST_LIBS} )

ADD_TEST(${EXECUTABLE_OUTPUT_PATH}/lucene++-tester ${EXECUTABLE_OUTPUT_PATH}/lucene++-tester -p)
ADD_TEST(lucene++-tester ${EXECUTABLE_OUTPUT_PATH}/lucene++-tester -p --test_dir=${lucene++-tester_SOURCE_DIR}/testfiles)

0 comments on commit c6e5192

Please sign in to comment.