File: CMakeLists.txt

package info (click to toggle)
plee-the-bear 0.4.1-3
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 105,316 kB
  • ctags: 10,258
  • sloc: lisp: 314,071; cpp: 69,621; xml: 2,117; sh: 465; makefile: 80
file content (107 lines) | stat: -rw-r--r-- 3,055 bytes parent folder | download
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
CMAKE_MINIMUM_REQUIRED(VERSION 2.4)

SET(
  BEAR_ENGINE_COMMON_INCLUDE_DIRECTORY
  "${CMAKE_CURRENT_SOURCE_DIR}/bear-engine/common/include"
  )
SET(
  BEAR_ENGINE_INCLUDE_DIRECTORY
  "${CMAKE_CURRENT_SOURCE_DIR}/bear-engine/core/src"
  )
SET(
  BEAR_ITEMS_INCLUDE_DIRECTORY
  "${CMAKE_CURRENT_SOURCE_DIR}/bear-engine/lib/src"
  )

IF ( BEAR_PROFILE )
  ADD_DEFINITIONS( "-DBEAR_PROFILE" )
ENDIF ( BEAR_PROFILE )

# replace the GETTEXT_CREATE_TRANSLATIONS macro to allow to specify the target
# name. So we can have translations in several subdirectories.
MACRO(GETTEXT_CREATE_TRANSLATIONS_CUSTOM _targetName _potFile _firstPoFile)

   SET(_gmoFiles)
   GET_FILENAME_COMPONENT(_potBasename ${_potFile} NAME_WE)
   GET_FILENAME_COMPONENT(_absPotFile ${_potFile} ABSOLUTE)

   FOREACH (_currentPoFile ${_firstPoFile} ${ARGN})
      GET_FILENAME_COMPONENT(_absFile ${_currentPoFile} ABSOLUTE)
      GET_FILENAME_COMPONENT(_abs_PATH ${_absFile} PATH)
      GET_FILENAME_COMPONENT(_lang ${_absFile} NAME_WE)
      SET(_gmoFile ${CMAKE_CURRENT_BINARY_DIR}/${_lang}.gmo)

      ADD_CUSTOM_COMMAND( 
         OUTPUT ${_gmoFile} 
         COMMAND ${GETTEXT_MSGMERGE_EXECUTABLE}
           --quiet --update --backup=none -s ${_absFile} ${_absPotFile}
         COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${_gmoFile} ${_absFile}
         DEPENDS ${_absPotFile} ${_absFile} 
      )

      INSTALL(
        FILES ${_gmoFile}
        DESTINATION share/locale/${_lang}/LC_MESSAGES
        RENAME ${_potBasename}.mo
        )
      
      SET(_gmoFiles ${_gmoFiles} ${_gmoFile})
   ENDFOREACH (_currentPoFile )

   ADD_CUSTOM_TARGET(${_targetName} ALL DEPENDS ${_gmoFiles})

ENDMACRO(GETTEXT_CREATE_TRANSLATIONS_CUSTOM)

# Search docbook-to-man
FIND_PROGRAM(DOCBOOK_TO_MAN docbook-to-man ENV)

IF(DOCBOOK_TO_MAN)
  SET(DOCBOOK_TO_MAN_FOUND 1)
ENDIF(DOCBOOK_TO_MAN)

# Use this macro to create man pages with docbook-to-man
MACRO(DOCBOOK_CREATE_MAN _targetName _volume _first_sgml_file)
  FOREACH (_file ${_first_sgml_file} ${ARGN})
    GET_FILENAME_COMPONENT(_absFile ${_file} ABSOLUTE)
    GET_FILENAME_COMPONENT(_abs_PATH ${_absFile} PATH)
    GET_FILENAME_COMPONENT(_prog ${_absFile} NAME_WE)
    SET(_man_file ${CMAKE_CURRENT_BINARY_DIR}/${_prog}.${_volume})

    ADD_CUSTOM_COMMAND(
      OUTPUT ${_man_file}
      COMMAND ${DOCBOOK_TO_MAN} ${_absFile} > ${_man_file}
      DEPENDS ${_absFile}
      )

    INSTALL(
      FILES ${_man_file}
      DESTINATION share/man/man${_volume}
      )
      
    SET(_man_files ${_man_files} ${_man_file})
  ENDFOREACH(_file)

  ADD_CUSTOM_TARGET(${_targetName} ALL DEPENDS ${_man_files})
ENDMACRO(DOCBOOK_CREATE_MAN)

# target to uninstall files
CONFIGURE_FILE(
  "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
  "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
  IMMEDIATE @ONLY)

ADD_CUSTOM_TARGET(
  uninstall
  "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
  )

SUBDIRS(
  bear-engine
  plee-the-bear
  )

IF( NOT BEAR_NO_EDITOR )
SUBDIRS(
  bear-factory
  )
ENDIF( NOT BEAR_NO_EDITOR )