summaryrefslogtreecommitdiff
path: root/metadata/CMakeLists.txt
blob: 77e2be9f58113ceed4fbe96f214a6c5e27dc9194 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
set (
    COMPIZ_DEFAULT_PLUGINS "core" CACHE STRING
    "Default plugins list that will be added to core metadata file"
)

find_program (XSLTPROC_EXECUTABLE xsltproc)
mark_as_advanced (FORCE XSLTPROC_EXECUTABLE)

if (XSLTPROC_EXECUTABLE)

    add_custom_command (
	OUTPUT ${CMAKE_BINARY_DIR}/generated/core.xml.in
	COMMAND ${XSLTPROC_EXECUTABLE}
		-o ${CMAKE_BINARY_DIR}/generated/core.xml.in
		--param default_plugins "\"'${COMPIZ_DEFAULT_PLUGINS}'\""
		${CMAKE_SOURCE_DIR}/xslt/default_plugins.xslt
		${CMAKE_CURRENT_SOURCE_DIR}/core.xml.in
	DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/core.xml.in
    )
    set (_core_file "${CMAKE_BINARY_DIR}/generated/core.xml.in")
else ()
    set (_core_file "${CMAKE_CURRENT_SOURCE_DIR}/core.xml.in")
endif ()


set (_xml_targets)
set (_schema_targets)

compiz_translate_xml (
    ${_core_file}
    ${CMAKE_BINARY_DIR}/generated/core.xml
)

install (
    FILES ${CMAKE_BINARY_DIR}/generated/core.xml
    DESTINATION ${COMPIZ_DESTDIR}${compiz_metadatadir}
)

add_custom_target (core-xml-file ALL
    DEPENDS ${CMAKE_BINARY_DIR}/generated/core.xml
)

if (USE_GCONF)
    compiz_gconf_schema (
	${CMAKE_BINARY_DIR}/generated/core.xml
	${CMAKE_BINARY_DIR}/generated/compiz-core.schemas
	${SCHEMADIR}
    )
    add_custom_target (core-gconf-schema ALL
	DEPENDS ${CMAKE_BINARY_DIR}/generated/compiz-core.schemas
    )
endif ()
if (USE_GSETTINGS)
    compiz_gsettings_schema (
	${CMAKE_BINARY_DIR}/generated/core.xml
	${CMAKE_BINARY_DIR}/generated/org.freedesktop.compiz.gschema.xml
	${datadir}/glib-2.0/schemas
    )
    add_custom_target (core-settings-schema ALL
	DEPENDS ${CMAKE_BINARY_DIR}/generated/org.freedesktop.compiz.gschema.xml
    )
endif ()