~compiz-team/compiz-core/compiz-core.gen_gsettings_schemas

« back to all changes in this revision

Viewing changes to cmake/CompizCommon.cmake

  • Committer: Sam Spilsbury
  • Date: 2011-07-14 15:42:41 UTC
  • mfrom: (2753.9.20 compiz-core)
  • Revision ID: sam.spilsbury@canonical.com-20110714154241-1ix2x6z6r88pucfd
Merge lp:compiz-core and allow keys to be relocatable in gsettings

Show diffs side-by-side

added added

removed removed

Lines of Context:
58
58
    set(IS_GIT_REPO 0)
59
59
endif (IS_DIRECTORY ${CMAKE_SOURCE_DIR}/.git)
60
60
 
61
 
if (IS_DIRECTORY ${CMAKE_SOURCE_DIR}/.gitmodules)
 
61
 
 
62
if (EXISTS ${CMAKE_SOURCE_DIR}/.gitmodules)
62
63
    set(IS_GIT_SUBMODULES_REPO 1)
63
 
else (IS_DIRECTORY ${CMAKE_SOURCE_DIR}/.gitmodules)
 
64
else (EXISTS ${CMAKE_SOURCE_DIR}/.gitmodules)
64
65
    set(IS_GIT_SUBMODULES_REPO 0)
65
 
endif (IS_DIRECTORY ${CMAKE_SOURCE_DIR}/.gitmodules)
 
66
endif (EXISTS ${CMAKE_SOURCE_DIR}/.gitmodules)
66
67
 
67
68
if (IS_DIRECTORY ${CMAKE_SOURCE_DIR}/.bzr)
68
69
    set(IS_BZR_REPO 1)
134
135
                           && tar xvf ${CMAKE_BINARY_DIR}/dist-build/${CMAKE_PROJECT_NAME}-${VERSION}.tar.bz2
135
136
                           && mkdir -p ${CMAKE_BINARY_DIR}/dist-build/${CMAKE_PROJECT_NAME}-${VERSION}/build
136
137
                           && cd ${CMAKE_BINARY_DIR}/dist-build/${CMAKE_PROJECT_NAME}-${VERSION}/build
137
 
                           && cmake -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/dist-build/buildroot -DCOMPIZ_PLUGIN_INSTALL_TYPE='package' .. -DCMAKE_MODULE_PATH=/usr/share/cmake -DCOMPIZ_DISABLE_PLUGIN_KDE=ON
 
138
                           && cmake -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/dist-build/buildroot -DCOMPIZ_PLUGIN_INSTALL_TYPE='package' .. -DCMAKE_MODULE_PATH=/usr/share/cmake -DCOMPIZ_DISABLE_PLUGIN_KDE=ON -DBUILD_KDE4=OFF
138
139
                           && make -j4
139
140
                           && make test
140
141
                           && make -j4 install
144
145
 
145
146
macro (compiz_add_release_signoff)
146
147
 
 
148
 
 
149
        set (AUTO_VERSION_UPDATE "" CACHE STRING "Automatically update VERSION to this number")
 
150
 
 
151
        if (AUTO_VERSION_UPDATE)
 
152
                message ("-- Next version will be " ${AUTO_VERSION_UPDATE})
 
153
        endif (AUTO_VERSION_UPDATE)
 
154
 
147
155
        add_custom_target (release-signoff)
148
156
 
149
157
        add_custom_target (release-update-working-tree
150
 
                           COMMAND cp NEWS ${CMAKE_SOURCE_DIR} &&
151
 
                                   cp AUTHORS ${CMAKE_SOURCE_DIR} &&
152
 
                                   cp ChangeLog ${CMAKE_SOURCE_DIR}) 
 
158
                           COMMAND cp NEWS ${CMAKE_SOURCE_DIR} && git add ${CMAKE_SOURCE_DIR}/NEWS &&
 
159
                                   cp AUTHORS ${CMAKE_SOURCE_DIR} && git add ${CMAKE_SOURCE_DIR}/AUTHORS && 
 
160
                                   cp ChangeLog ${CMAKE_SOURCE_DIR} && git add ${CMAKE_SOURCE_DIR}/ChangeLog
 
161
                           COMMENT "Updating working tree"
 
162
                           WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
153
163
 
154
164
        if (${IS_GIT_REPO})
155
165
                add_custom_target (release-commits
174
184
                                   make dist
175
185
                                   COMMENT "Updating bz2 archive"
176
186
                                   WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
177
 
                add_custom_target (release-version-bump
178
 
                                   COMMAND git checkout master &&
179
 
                                   $ENV{EDITOR} VERSION &&
180
 
                                   git add VERSION &&
181
 
                                   git commit VERSION -m "Bump VERSION"
182
 
                                   COMMENT "Bumping VERSION"
183
 
                                   WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
 
187
 
 
188
                if (AUTO_VERSION_UPDATE)
 
189
                        add_custom_target (release-version-bump
 
190
                                           COMMAND git checkout master &&
 
191
                                           echo "${AUTO_VERSION_UPDATE}" > VERSION &&
 
192
                                           git add VERSION &&
 
193
                                           git commit VERSION -m "Bump VERSION"
 
194
                                           COMMENT "Bumping VERSION"
 
195
                                           WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
 
196
                else (AUTO_VERSION_UPDATE)
 
197
                        add_custom_target (release-version-bump
 
198
                                           COMMAND git checkout master &&
 
199
                                           $ENV{EDITOR} VERSION &&
 
200
                                           git add VERSION &&           
 
201
                                           git commit VERSION -m "Bump VERSION"
 
202
                                           COMMENT "Bumping VERSION"
 
203
                                           WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
 
204
                endif (AUTO_VERSION_UPDATE)
184
205
        else (${IS_GIT_REPO})
185
206
            add_custom_target (release-commits)
186
207
            add_custom_target (release-tags)
223
244
                                   COMMENT "Pushing to master"
224
245
                                   WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
225
246
                add_custom_target (push-release-branch
226
 
                                   COMMAND git push origin compiz-${VERISON}-series
227
 
                                   COMMENT "Pushing to compiz-${VERISON}-series"
 
247
                                   COMMAND git push origin compiz-${VERSION}-series
 
248
                                   COMMENT "Pushing to compiz-${VERSION}-series"
228
249
                                   WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
229
250
                add_custom_target (push-tag
230
251
                                   COMMAND git push origin compiz-${VERSION}
248
269
        set (COMPIZ_RELEASE_UPLOAD_DIR_VERSION  ${COMPIZ_RELEASE_UPLOAD_BASE}/${VERSION}/)
249
270
        set (COMPIZ_RELEASE_UPLOAD_DIR_COMPONENT ${COMPIZ_RELEASE_UPLOAD_BASE}/components/${CMAKE_PROJECT_NAME})
250
271
 
251
 
        message ("releasing to " ${COMPIZ_RELEASE_UPLOAD_HOST})
252
 
        message (" base: " ${COMPIZ_RELEASE_UPLOAD_BASE})
253
 
        message (" version: " ${COMPIZ_RELEASE_UPLOAD_BASE}/${VERSION})
254
 
        message (" component: ${COMPIZ_RELEASE_UPLOAD_BASE}/components/${CMAKE_PROJECT_NAME}")
255
 
 
256
272
        add_custom_target (release-upload-version
257
273
                           COMMAND ssh $ENV{USER}@${COMPIZ_RELEASE_UPLOAD_HOST} "mkdir -p ${COMPIZ_RELEASE_UPLOAD_BASE}/${VERSION}" && scp ${CMAKE_PROJECT_NAME}-${VERSION}.tar.bz2 $ENV{USER}@${COMPIZ_RELEASE_UPLOAD_HOST}:${COMPIZ_RELEASE_UPLOAD_DIR_VERSION}
258
274
                           COMMENT "Uploading ${CMAKE_PROJECT_NAME}-${VERSION} to ${VERSION}"
274
290
 
275
291
macro (compiz_add_release)
276
292
 
 
293
        set (AUTO_NEWS_UPDATE "" CACHE STRING "Value to insert into NEWS file, leave blank to get an editor when running make news-update")
 
294
 
 
295
        if (AUTO_NEWS_UPDATE)
 
296
                message ("-- Using auto news update: " ${AUTO_NEWS_UPDATE})
 
297
        endif (AUTO_NEWS_UPDATE)
 
298
 
277
299
        if (${IS_GIT_REPO})
278
300
                find_program (GEN_GIT_LOG gen-git-log.sh)
279
301
                add_custom_target (authors
293
315
                        message ("[WARNING]: gen-git-log.sh is required to make releases, ensure that it is installed into your PATH")
294
316
                endif (NOT (${GEN_GIT_LOG} STREQUAL "GEN_GIT_LOG-NOTFOUND"))
295
317
 
296
 
                add_custom_target (news-header echo 'Release ${VERSION} ('`date +%Y-%m-%d`' '`git config user.name`' <'`git config user.email`'>)' > ${CMAKE_BINARY_DIR}/NEWS.update && seq -s "=" `cat ${CMAKE_BINARY_DIR}/NEWS.update | wc -c` | sed 's/[0-9]//g' >> ${CMAKE_BINARY_DIR}/NEWS.update && $ENV{EDITOR} ${CMAKE_BINARY_DIR}/NEWS.update && echo >> ${CMAKE_BINARY_DIR}/NEWS.update
297
 
                                   COMMAND $ENV{EDITOR} ${CMAKE_BINARY_DIR}/NEWS.update
298
 
                                   COMMENT "Generating NEWS Header"
299
 
                                   WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
 
318
                if (AUTO_NEWS_UPDATE)
 
319
                        add_custom_target (news-header echo > ${CMAKE_BINARY_DIR}/NEWS.update
 
320
                                           COMMAND echo 'Release ${VERSION} ('`date +%Y-%m-%d`' '`git config user.name`' <'`git config user.email`'>)' > ${CMAKE_BINARY_DIR}/NEWS.update && seq -s "=" `cat ${CMAKE_BINARY_DIR}/NEWS.update | wc -c` | sed 's/[0-9]//g' >> ${CMAKE_BINARY_DIR}/NEWS.update && echo '${AUTO_NEWS_UPDATE}' >> ${CMAKE_BINARY_DIR}/NEWS.update && echo >> ${CMAKE_BINARY_DIR}/NEWS.update
 
321
                                           COMMENT "Generating NEWS Header"
 
322
                                           WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
 
323
                else (AUTO_NEWS_UPDATE)
 
324
                        add_custom_target (news-header echo > ${CMAKE_BINARY_DIR}/NEWS.update
 
325
                                           COMMAND echo 'Release ${VERSION} ('`date +%Y-%m-%d`' '`git config user.name`' <'`git config user.email`'>)' > ${CMAKE_BINARY_DIR}/NEWS.update && seq -s "=" `cat ${CMAKE_BINARY_DIR}/NEWS.update | wc -c` | sed 's/[0-9]//g' >> ${CMAKE_BINARY_DIR}/NEWS.update && $ENV{EDITOR} ${CMAKE_BINARY_DIR}/NEWS.update && echo >> ${CMAKE_BINARY_DIR}/NEWS.update
 
326
                                           COMMENT "Generating NEWS Header"
 
327
                                           WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
 
328
                endif (AUTO_NEWS_UPDATE)
 
329
 
300
330
        else (${IS_GIT_REPO})
301
331
                if (${IS_BZR_REPO})
302
332
                        add_custom_target (authors
306
336
                                           COMMAND bzr log --gnu-changelog > ChangeLog
307
337
                                           COMMENT "Generating ChangeLog")
308
338
 
309
 
                        add_custom_target (news-header echo > ${CMAKE_BINARY_DIR}/NEWS.update
310
 
                                           COMMAND echo 'Release ${VERSION} ('`date +%Y-%m-%d`' '`bzr config email`')' > ${CMAKE_BINARY_DIR}/NEWS.update && seq -s "=" `cat ${CMAKE_BINARY_DIR}/NEWS.update | wc -c` | sed 's/[0-9]//g' >> ${CMAKE_BINARY_DIR}/NEWS.update && $ENV{EDITOR} ${CMAKE_BINARY_DIR}/NEWS.update && echo >> ${CMAKE_BINARY_DIR}/NEWS.update
311
 
                                           COMMENT "Generating NEWS Header"
312
 
                                           WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
 
339
                        if (AUTO_NEWS_UPDATE)
 
340
 
 
341
                                add_custom_target (news-header echo > ${CMAKE_BINARY_DIR}/NEWS.update
 
342
                                                   COMMAND echo 'Release ${VERSION} ('`date +%Y-%m-%d`' '`bzr config email`')' > ${CMAKE_BINARY_DIR}/NEWS.update && seq -s "=" `cat ${CMAKE_BINARY_DIR}/NEWS.update | wc -c` | sed 's/[0-9]//g' >> ${CMAKE_BINARY_DIR}/NEWS.update && echo '${AUTO_NEWS_UPDATE}' >> ${CMAKE_BINARY_DIR}/NEWS.update && echo >> ${CMAKE_BINARY_DIR}/NEWS.update
 
343
                                                   COMMENT "Generating NEWS Header"
 
344
                                                   WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
 
345
                        else (AUTO_NEWS_UPDATE)
 
346
                                add_custom_target (news-header echo > ${CMAKE_BINARY_DIR}/NEWS.update
 
347
                                                   COMMAND echo 'Release ${VERSION} ('`date +%Y-%m-%d`' '`bzr config email`')' > ${CMAKE_BINARY_DIR}/NEWS.update && seq -s "=" `cat ${CMAKE_BINARY_DIR}/NEWS.update | wc -c` | sed 's/[0-9]//g' >> ${CMAKE_BINARY_DIR}/NEWS.update && $ENV{EDITOR} ${CMAKE_BINARY_DIR}/NEWS.update && echo >> ${CMAKE_BINARY_DIR}/NEWS.update
 
348
                                                   COMMENT "Generating NEWS Header"
 
349
                                                   WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
 
350
                        endif (AUTO_NEWS_UPDATE)
 
351
 
313
352
                else (${IS_BZR_REPO})
314
353
                        add_custom_target (authors)
315
354
                        add_custom_target (changelog)
318
357
        endif (${IS_GIT_REPO})
319
358
 
320
359
        add_custom_target (news
321
 
                           COMMAND cat ${CMAKE_SOURCE_DIR}/NEWS > NEWS.old &&
 
360
                           COMMAND touch ${CMAKE_SOURCE_DIR}/NEWS
 
361
                                   cat ${CMAKE_SOURCE_DIR}/NEWS > NEWS.old &&
322
362
                                   cat NEWS.old >> ${CMAKE_BINARY_DIR}/NEWS.update &&
323
363
                                   cat NEWS.update > NEWS
324
364
                           WORKING_DIRECTORY ${CMAKE_BINARY_DIR})