~ubuntu-branches/ubuntu/oneiric/strigi/oneiric

« back to all changes in this revision

Viewing changes to strigiutils/CMakeLists.txt

  • Committer: Package Import Robot
  • Author(s): Fathi Boudra
  • Date: 2011-09-20 08:50:25 UTC
  • mto: (1.1.20 upstream) (5.1.6 sid)
  • mto: This revision was merged to the branch mainline in revision 44.
  • Revision ID: package-import@ubuntu.com-20110920085025-wszfu6x8rshrjq0e
ImportĀ upstreamĀ versionĀ 0.7.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
project (strigiutils)
 
2
 
 
3
##### cmake settings #####
 
4
 
 
5
cmake_minimum_required(VERSION 2.6)
 
6
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
 
7
#include(MacroCheckGccVisibility)
 
8
#include(MacroFindOptionalDep)
 
9
enable_testing()
 
10
 
 
11
 
 
12
##### global variables #####
 
13
# Set up RPATH handling, so the libs are found if they are installed to a non-standard location.
 
14
# By default cmake builds the targets with full RPATH to everything in the build directory,
 
15
# but then removes the RPATH when installing.
 
16
# These two options below make it set the RPATH of the installed targets to all
 
17
# RPATH directories outside the current CMAKE_BINARY_DIR and also the library
 
18
# install directory. Alex
 
19
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH  TRUE)
 
20
set(CMAKE_INSTALL_RPATH                ${LIB_DESTINATION} )
 
21
 
 
22
 
 
23
##### environment inspection #####
 
24
 
 
25
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR})
 
26
  find_package(LibStreams REQUIRED)
 
27
  find_package(LibStreamAnalyzer REQUIRED)
 
28
else()
 
29
  set(LIBSTREAMS_INCLUDE_DIRS
 
30
    ${libstreams_SOURCE_DIR}/include
 
31
    ${libstreams_BINARY_DIR}/include
 
32
    )
 
33
  set(LIBSTREAMANALYZER_INCLUDE_DIRS
 
34
    ${libstreamanalyzer_SOURCE_DIR}/include
 
35
    ${libstreamanalyzer_BINARY_DIR}/include
 
36
    )
 
37
  set(LIBSTREAMS_LIBRARIES streams)
 
38
  set(LIBSTREAMANALYZER_LIBRARIES streamanalyzer)
 
39
endif()
 
40
 
 
41
# check for required packages
 
42
include(ConfigureChecks.cmake)
 
43
 
 
44
##### building and testing #####
 
45
include_directories(${LIBSTREAMS_INCLUDE_DIRS})
 
46
include_directories(${LIBSTREAMANALYZER_INCLUDE_DIRS})
 
47
link_directories(${LIBSTREAMANALYZER_LIBRARY_DIRS})
 
48
 
 
49
add_subdirectory(bin)
 
50
 
 
51
 
 
52
##### installing #####
 
53
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp "")
 
54
if(HAVE_REGEX_H)
 
55
        add_executable(deepfind dummy.cpp)      
 
56
        target_link_libraries(deepfind libdeepfind)
 
57
        install(TARGETS deepfind RUNTIME DESTINATION bin)
 
58
        add_executable(deepgrep dummy.cpp)
 
59
        target_link_libraries(deepgrep libdeepgrep)
 
60
        install(TARGETS deepgrep RUNTIME DESTINATION bin)
 
61
endif(HAVE_REGEX_H)
 
62
if(NOT MSVC)
 
63
        add_executable(xmlindexer dummy.cpp)
 
64
        target_link_libraries(xmlindexer libxmlindexer)
 
65
        install(TARGETS xmlindexer RUNTIME DESTINATION bin)
 
66
        add_executable(rdfindexer dummy.cpp)
 
67
        target_link_libraries(rdfindexer librdfindexer)
 
68
        install(TARGETS rdfindexer RUNTIME DESTINATION bin)
 
69
endif(NOT MSVC)