~ubuntu-branches/ubuntu/trusty/grantlee/trusty

« back to all changes in this revision

Viewing changes to .pc/debian-changes-0.1.7-0ubuntu3/CMakeLists.txt

  • Committer: Bazaar Package Importer
  • Author(s): Scott Kitterman
  • Date: 2010-12-07 09:19:01 UTC
  • Revision ID: james.westby@ubuntu.com-20101207091901-hsfsvnkxdshv4k8g
Tags: 0.1.7-0ubuntu3
Revert previous upload and try again with the correct patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
project(Grantlee)
 
2
 
 
3
cmake_minimum_required(VERSION 2.6)
 
4
 
 
5
find_package(Qt4 4.5.0 REQUIRED)
 
6
 
 
7
option( BUILD_CORE "Build the Grantlee core library" TRUE )
 
8
option( BUILD_GUI "Build the Grantlee gui library" TRUE )
 
9
option( BUILD_MAIN_PLUGINS "Build the Grantlee plugins" TRUE )
 
10
option( BUILD_SCRIPT_PLUGIN "Build the Grantlee scriptable tags plugin" TRUE )
 
11
option( BUILD_TESTS "Build the Grantlee tests" TRUE )
 
12
 
 
13
if (BUILD_TESTS)
 
14
  enable_testing()
 
15
endif()
 
16
 
 
17
set(CMAKE_MODULE_PATH ${Grantlee_SOURCE_DIR}/cmake/modules)
 
18
 
 
19
if (CMAKE_COMPILER_IS_GNUCXX)
 
20
  set (CMAKE_C_FLAGS   "${CMAKE_C_FLAGS} -Wno-long-long -std=iso9899:1990 -Wundef -Wcast-align -Werror-implicit-function-declaration -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute -fno-common")
 
21
  set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wnon-virtual-dtor -Wno-long-long -ansi -Wundef -Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith -Wformat-security -fno-check-new -fno-common -pedantic-errors")
 
22
  if (NOT MINGW)
 
23
    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
 
24
  else ()
 
25
    # http://mail.kde.org/pipermail/kde-windows/2007-December/001692.html
 
26
    # http://lists.trolltech.com/pipermail/qt-interest/2009-July/009829.html
 
27
    # qt is always compiled with QT_NO_DEBUG under mingw,
 
28
    # so we need to compile stuff linked against it
 
29
    # the same or otherwise QPluginLoader rejects plugins
 
30
    add_definitions(-DQT_NO_DEBUG)
 
31
  endif ()
 
32
endif()
 
33
 
 
34
add_definitions(-DQT_NO_CAST_TO_ASCII)
 
35
add_definitions(-DQT_NO_CAST_FROM_ASCII)
 
36
add_definitions(-DQT_STRICT_ITERATORS)
 
37
add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
 
38
 
 
39
set(Grantlee_VERSION_MAJOR 0)
 
40
set(Grantlee_VERSION_MINOR 1)
 
41
set(Grantlee_VERSION_PATCH 7)
 
42
set(Grantlee_MIN_PLUGIN_VERSION 1)
 
43
 
 
44
set(Grantlee_MAJOR_MINOR_VERSION_STRING "${Grantlee_VERSION_MAJOR}.${Grantlee_VERSION_MINOR}" )
 
45
set(Grantlee_VERSION_STRING "${Grantlee_VERSION_MAJOR}.${Grantlee_VERSION_MINOR}.${Grantlee_VERSION_PATCH}" )
 
46
 
 
47
set (LIB_SUFFIX "" CACHE STRING "Define suffix of library directory name (eg. '64')")
 
48
 
 
49
set( LIB_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX} )
 
50
set( PLUGIN_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/grantlee/${Grantlee_MAJOR_MINOR_VERSION_STRING} )
 
51
set( BIN_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/bin )
 
52
set( INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include )
 
53
set( DATA_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/share/apps )
 
54
set( CMAKE_INSTALL_NAME_DIR ${LIB_INSTALL_DIR})
 
55
 
 
56
set(Grantlee_USE_FILE "${Grantlee_SOURCE_DIR}/cmake/modules/GrantleeUse.cmake")
 
57
 
 
58
if (BUILD_CORE)
 
59
  set(Grantlee_CORE_LIBRARY "grantlee_core")
 
60
  set(Grantlee_CORE_LIBRARIES ${Grantlee_CORE_LIBRARY} ${QT_QTCORE_LIBRARIES} )
 
61
  add_subdirectory(corelib)
 
62
endif()
 
63
 
 
64
if (BUILD_GUI)
 
65
  set(Grantlee_GUI_LIBRARY "grantlee_gui")
 
66
  set(Grantlee_GUI_LIBRARIES ${Grantlee_GUI_LIBRARY} ${QT_QTGUI_LIBRARIES} )
 
67
  add_subdirectory(gui)
 
68
endif()
 
69
 
 
70
if (BUILD_MAIN_PLUGINS)
 
71
  add_subdirectory(loadertags)
 
72
  add_subdirectory(defaulttags)
 
73
 
 
74
  add_subdirectory(defaultfilters)
 
75
endif()
 
76
 
 
77
if (BUILD_SCRIPT_PLUGIN)
 
78
#  add_subdirectory(scriptabletags)
 
79
endif()
 
80
 
 
81
if (BUILD_TESTS)
 
82
  add_subdirectory(tests)
 
83
endif()
 
84
 
 
85
configure_file(
 
86
  "${CMAKE_MODULE_PATH}/GrantleeConfig.cmake.in"
 
87
  "${Grantlee_BINARY_DIR}/GrantleeConfig.cmake"
 
88
  IMMEDIATE @ONLY
 
89
)
 
90
 
 
91
configure_file(
 
92
  "${CMAKE_MODULE_PATH}/GrantleeConfigVersion.cmake.in"
 
93
  "${Grantlee_BINARY_DIR}/GrantleeConfigVersion.cmake"
 
94
  IMMEDIATE @ONLY
 
95
)
 
96
 
 
97
install(FILES
 
98
  "${Grantlee_BINARY_DIR}/GrantleeConfig.cmake"
 
99
  "${Grantlee_BINARY_DIR}/GrantleeConfigVersion.cmake"
 
100
  DESTINATION "${LIB_INSTALL_DIR}/grantlee")
 
101
 
 
102
install(FILES
 
103
  "${CMAKE_MODULE_PATH}/GrantleeUse.cmake"
 
104
  DESTINATION "${PLUGIN_INSTALL_DIR}"
 
105
)
 
106
 
 
107
# Add support for an uninstall target
 
108
configure_file(
 
109
  "${CMAKE_MODULE_PATH}/cmake_uninstall.cmake.in"
 
110
  "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
 
111
  IMMEDIATE @ONLY)
 
112
 
 
113
add_custom_target(uninstall
 
114
  "${CMAKE_COMMAND}" -P
 
115
  "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
 
116
 
 
117
find_package(Doxygen)
 
118
if (DOXYGEN_FOUND AND DOXYGEN_DOT_FOUND)
 
119
  message (STATUS "Doxygen and dot found. make docs target is available")
 
120
  # Add support for a docs target
 
121
 
 
122
  # Available from http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/libstdc++.tag
 
123
  set(STLTAGFILE "${CMAKE_SOURCE_DIR}/scripts/libstdc++.tag=http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen")
 
124
  set(QTTAGFILE "${CMAKE_SOURCE_DIR}/scripts/qttags.tag=http://qt.nokia.com/doc/${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}")
 
125
 
 
126
  set(TAGFILES "${QTTAGFILE} ${STLTAGFILE}")
 
127
  set(DOCS_OUTPUT_DIRECTORY "@CMAKE_BINARY_DIR@")
 
128
  configure_file(
 
129
    "${CMAKE_MODULE_PATH}/Doxyfile.in"
 
130
    "${CMAKE_CURRENT_BINARY_DIR}/Doxyfile"
 
131
    IMMEDIATE @ONLY)
 
132
 
 
133
  # Add support for a Qt assistant docs target
 
134
  # qttags.tag is too big to distribute with Grantlee. Get it
 
135
  # from http://api.kde.org/kdereview-api/kdereview.tar.gz for example.
 
136
  if(EXISTS ${CMAKE_SOURCE_DIR}/scripts/qttags.tag)
 
137
    set(DOCS_OUTPUT_DIRECTORY "@CMAKE_BINARY_DIR@/qtdocs")
 
138
 
 
139
    # Available from http://steveire.com/libstdc++-longnames.tag
 
140
    # Also recommended: http://www.steveire.com/libstdc++-v3.qch
 
141
    set(STLTAGFILE "${CMAKE_SOURCE_DIR}/scripts/libstdc++-longnames.tag=qthelp://org.gnu.libstdcxx/libstdc++-v3/")
 
142
    set(QTTAGFILE "${CMAKE_SOURCE_DIR}/scripts/qttags.tag=qthelp://com.trolltech.qt/qdoc/")
 
143
 
 
144
    set(TAGFILES "${QTTAGFILE} ${STLTAGFILE}")
 
145
    set(GENERATE_QHP "yes")
 
146
 
 
147
    configure_file(
 
148
      "${CMAKE_MODULE_PATH}/Doxyfile.in"
 
149
      "${CMAKE_CURRENT_BINARY_DIR}/Doxyfile.qt"
 
150
      IMMEDIATE @ONLY)
 
151
  endif()
 
152
 
 
153
  set( DOCS_ARGS ${DOXYGEN_EXECUTABLE} "${CMAKE_CURRENT_BINARY_DIR}/Doxyfile" )
 
154
  if(EXISTS "${CMAKE_CURRENT_BINARY_DIR}/Doxyfile.qt")
 
155
    set(DOCS_ARGS ${DOCS_ARGS} COMMAND ${DOXYGEN_EXECUTABLE} "${CMAKE_CURRENT_BINARY_DIR}/Doxyfile.qt" )
 
156
  endif()
 
157
 
 
158
  add_custom_target(docs
 
159
    ${DOCS_ARGS}
 
160
  )
 
161
endif()
 
162