~midori/midori/trunk

« back to all changes in this revision

Viewing changes to extensions/CMakeLists.txt

  • Committer: André Auzi
  • Date: 2013-09-17 19:34:23 UTC
  • mfrom: (6402 midori)
  • mto: This revision was merged to the branch mainline in revision 6406.
  • Revision ID: aauzi@free.fr-20130917193423-j3tqi7tt4b8afu41
merge lp:midori to fix conficts

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright (C) 2013 Christian Dywan <christian@twotoasts.de>
 
2
 
 
3
set(EXTENSIONDIR "${CMAKE_INSTALL_FULL_LIBDIR}/${CMAKE_PROJECT_NAME}")
 
4
include_directories(
 
5
                    "${CMAKE_SOURCE_DIR}"
 
6
                    "${CMAKE_SOURCE_DIR}/midori"
 
7
                    "${CMAKE_SOURCE_DIR}/katze"
 
8
                    ${DEPS_INCLUDE_DIRS}
 
9
                    ${OPTS_INCLUDE_DIRS}
 
10
                    ${DEPS_GTK_INCLUDE_DIRS}
 
11
                    ${OPTS_GTK_INCLUDE_DIRS}
 
12
                    ${CMAKE_BINARY_DIR}
 
13
                    "${CMAKE_BINARY_DIR}/midori"
 
14
                    )
 
15
file(GLOB EXTENSIONS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *)
 
16
if (HALF_BRO_INCOM_WEBKIT2)
 
17
    list(REMOVE_ITEM EXTENSIONS
 
18
         "adblock.c"
 
19
         "cookie-permissions"
 
20
         "addons.c"
 
21
         "formhistory"
 
22
         "external-download-manager.vala"
 
23
         "nojs"
 
24
         "nsplugin-manager.vala"
 
25
         )
 
26
endif ()
 
27
 
 
28
foreach(UNIT_SRC ${EXTENSIONS})
 
29
    string(FIND ${UNIT_SRC} ".c" UNIT_EXTENSION)
 
30
    if (UNIT_EXTENSION GREATER -1)
 
31
        string(REPLACE ".c" "" UNIT ${UNIT_SRC})
 
32
        add_library(${UNIT} MODULE ${UNIT_SRC})
 
33
        target_link_libraries(${UNIT}
 
34
                              ${LIBMIDORI}
 
35
                              )
 
36
        set_target_properties(${UNIT} PROPERTIES
 
37
                              COMPILE_FLAGS ${CFLAGS}
 
38
                              )
 
39
        install(TARGETS ${UNIT}
 
40
            LIBRARY DESTINATION ${EXTENSIONDIR}
 
41
                )
 
42
    endif ()
 
43
endforeach ()
 
44
 
 
45
foreach(UNIT_SRC ${EXTENSIONS})
 
46
    string(FIND ${UNIT_SRC} "." UNIT_EXTENSION)
 
47
    if (UNIT_EXTENSION EQUAL -1)
 
48
        file(GLOB UNIT_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "${UNIT_SRC}/*.c")
 
49
        if (UNIT_FILES)
 
50
            add_library(${UNIT_SRC} MODULE ${UNIT_FILES})
 
51
            target_link_libraries(${UNIT_SRC}
 
52
                                  ${LIBMIDORI}
 
53
                                  )
 
54
            set_target_properties(${UNIT_SRC} PROPERTIES
 
55
                                  COMPILE_FLAGS ${CFLAGS}
 
56
                                  )
 
57
            install(TARGETS ${UNIT_SRC}
 
58
                    LIBRARY DESTINATION ${EXTENSIONDIR}
 
59
                    )
 
60
        endif ()
 
61
    endif ()
 
62
endforeach ()
 
63
 
 
64
foreach(UNIT_SRC ${EXTENSIONS})
 
65
    string(FIND ${UNIT_SRC} ".vala" UNIT_EXTENSION)
 
66
    if (UNIT_EXTENSION GREATER -1)
 
67
        string(REPLACE ".vala" "" UNIT ${UNIT_SRC})
 
68
        include(ValaPrecompile)
 
69
        vala_precompile(UNIT_SRC_C ${UNIT}
 
70
            ${UNIT_SRC}
 
71
        PACKAGES
 
72
            ${PKGS}
 
73
        OPTIONS
 
74
            ${VALAFLAGS}
 
75
        CUSTOM_VAPIS
 
76
            ${EXTRA_VAPIS}
 
77
            "${CMAKE_SOURCE_DIR}/midori/midori.vapi"
 
78
            "${CMAKE_SOURCE_DIR}/katze/katze.vapi"
 
79
            "${CMAKE_BINARY_DIR}/midori/${LIBMIDORI}.vapi"
 
80
        )
 
81
        add_library(${UNIT} MODULE ${UNIT_SRC_C})
 
82
        target_link_libraries(${UNIT}
 
83
                              ${LIBMIDORI}
 
84
                              )
 
85
        set_target_properties(${UNIT} PROPERTIES
 
86
                              COMPILE_FLAGS "${VALA_CFLAGS}"
 
87
                              )
 
88
        install(TARGETS ${UNIT}
 
89
                LIBRARY DESTINATION ${EXTENSIONDIR}
 
90
                )
 
91
    endif ()
 
92
endforeach ()