~ubuntu-branches/ubuntu/saucy/darktable/saucy

« back to all changes in this revision

Viewing changes to data/CMakeLists.txt

  • Committer: Bazaar Package Importer
  • Author(s): David Bremner
  • Date: 2011-04-14 23:42:12 UTC
  • Revision ID: james.westby@ubuntu.com-20110414234212-kuffcz5wiu18v6ra
Tags: upstream-0.8
ImportĀ upstreamĀ versionĀ 0.8

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
cmake_minimum_required(VERSION 2.6)
 
2
 
 
3
add_subdirectory(pixmaps)
 
4
 
 
5
add_subdirectory(kernels)
 
6
 
 
7
#
 
8
# Generate and instal gtkrc
 
9
#
 
10
set(GTKRC_FONT_SIZE 8)
 
11
if(APPLE)
 
12
  # 8 is very tiny on mac
 
13
  set(GTKRC_FONT_SIZE 11)
 
14
endif(APPLE)
 
15
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/darktable.gtkrc.in ${CMAKE_CURRENT_BINARY_DIR}/darktable.gtkrc )
 
16
 
 
17
 
 
18
#
 
19
# Add files that should go into shared
 
20
#
 
21
set(SHARE_FILES ${CMAKE_CURRENT_BINARY_DIR}/darktable.gtkrc darktable.glade)
 
22
install(FILES ${SHARE_FILES} DESTINATION ${SHARE_INSTALL})
 
23
 
 
24
#
 
25
# Install other system shares
 
26
#
 
27
install(FILES darktable.desktop DESTINATION ./share/applications)
 
28
 
 
29
#
 
30
# Install watermarks
 
31
#
 
32
FILE(GLOB WATERMARKS "watermarks/*.svg")
 
33
install(FILES ${WATERMARKS} DESTINATION ${SHARE_INSTALL}/watermarks)
 
34
 
 
35
#
 
36
# Install gconf schema.
 
37
#
 
38
 
 
39
if(USE_GCONF_BACKEND)
 
40
  if(NOT DONT_INSTALL_GCONF_SCHEMAS)
 
41
    install (CODE "set(ENV{GCONF_CONFIG_SOURCE} ${DT_GCONF_SCHEMA_DIR})
 
42
        execute_process(WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} OUTPUT_QUIET COMMAND gconftool-2 --makefile-install-rule darktable.schemas)")
 
43
    install (CODE "message(\"-- Installing: gconf schemas to '${DT_GCONF_SCHEMA_DIR}'\")")
 
44
  else()
 
45
    install(FILES darktable.schemas DESTINATION /etc/gconf/schemas)
 
46
  endif(NOT DONT_INSTALL_GCONF_SCHEMAS)
 
47
else()
 
48
 # Setup some custom commands to generate a darktablerc template
 
49
 # out of the darktable.schemas file.
 
50
 add_custom_command (
 
51
    OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/darktablerc_keys
 
52
    COMMAND 
 
53
        grep '<key>' ${CMAKE_CURRENT_SOURCE_DIR}/darktable.schemas | 
 
54
        sed -e 's/<key>//g' -e 's/<\\/key>//g' -e 's/\\/schemas\\/apps\\/darktable\\///g' | 
 
55
        nl -s: | 
 
56
        sed -e 's/^[ \\t]*//\;s/[ \\t]*$$//' > ${CMAKE_CURRENT_BINARY_DIR}/darktablerc_keys
 
57
  )
 
58
 
 
59
  add_custom_command (
 
60
    OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/darktablerc_values
 
61
    COMMAND 
 
62
        grep '<default>' ${CMAKE_CURRENT_SOURCE_DIR}/darktable.schemas | 
 
63
        sed -e 's/<default>//g' -e 's/<\\/default>//g' | 
 
64
        nl -s: | 
 
65
        sed -e 's/^[ \\t]*//\;s/[ \\t]*$$//' > ${CMAKE_CURRENT_BINARY_DIR}/darktablerc_values
 
66
        
 
67
    DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/darktablerc_keys
 
68
  )
 
69
 
 
70
  add_custom_command (
 
71
    OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/darktablerc
 
72
    COMMAND 
 
73
      join -1 1 -2 1 -o 1.2 2.2 ${CMAKE_CURRENT_BINARY_DIR}/darktablerc_keys ${CMAKE_CURRENT_BINARY_DIR}/darktablerc_values | 
 
74
      sed -e 's/ /=/g' > ${CMAKE_CURRENT_BINARY_DIR}/darktablerc
 
75
      
 
76
    DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/darktablerc_values
 
77
  )
 
78
 
 
79
  add_custom_target(darktablerc ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/darktablerc)
 
80
 
 
81
  # first of all install darktablerc file into share as template
 
82
  # postinst script should copy this into users homedirectory 
 
83
  # $HOME/.config/darktable/darktable.rc
 
84
  install(FILES darktablerc DESTINATION ${SHARE_INSTALL}/)
 
85
  
 
86
endif()