diff options
author | Jacek Antonelli | 2011-05-20 20:37:38 -0500 |
---|---|---|
committer | Jacek Antonelli | 2011-05-20 22:09:31 -0500 |
commit | 13b3170509117b6e00e612137afab1ec7a543cd3 (patch) | |
tree | 514adb46ff6a783059a579ab987f7eb83385ce4b /linden/indra | |
parent | Ported viewer_info.py and BuildVersion.cmake from Kokua. (diff) | |
download | meta-impy-13b3170509117b6e00e612137afab1ec7a543cd3.zip meta-impy-13b3170509117b6e00e612137afab1ec7a543cd3.tar.gz meta-impy-13b3170509117b6e00e612137afab1ec7a543cd3.tar.bz2 meta-impy-13b3170509117b6e00e612137afab1ec7a543cd3.tar.xz |
Ported Linux packaging system from Kokua.
Run "make package" in the build directory to create a tarball.
Diffstat (limited to 'linden/indra')
-rw-r--r-- | linden/indra/cmake/AddPackageTarget.cmake | 32 | ||||
-rw-r--r-- | linden/indra/newview/CMakeLists.txt | 73 |
2 files changed, 74 insertions, 31 deletions
diff --git a/linden/indra/cmake/AddPackageTarget.cmake b/linden/indra/cmake/AddPackageTarget.cmake new file mode 100644 index 0000000..66adf3e --- /dev/null +++ b/linden/indra/cmake/AddPackageTarget.cmake | |||
@@ -0,0 +1,32 @@ | |||
1 | # This function adds a custom target named 'package', which runs | ||
2 | # scripts/package.py to create an installer package. | ||
3 | # | ||
4 | # By default, you must manually build the 'package' target when you | ||
5 | # are ready to create the installer package. But if the global | ||
6 | # AUTOPACKAGE variable is ON ("cmake -D AUTOPACKAGE:BOOL=ON"), the | ||
7 | # 'package' target will be added to the default build target. | ||
8 | |||
9 | |||
10 | set(AUTOPACKAGE OFF CACHE BOOL | ||
11 | "Automatically build an installer package after compiling.") | ||
12 | |||
13 | |||
14 | function( add_package_target ) | ||
15 | |||
16 | if (AUTOPACKAGE) | ||
17 | add_custom_target(package ALL) | ||
18 | else (AUTOPACKAGE) | ||
19 | add_custom_target(package) | ||
20 | endif (AUTOPACKAGE) | ||
21 | |||
22 | add_custom_command( | ||
23 | TARGET package POST_BUILD | ||
24 | COMMAND | ||
25 | ${PYTHON_EXECUTABLE} | ||
26 | ${SCRIPTS_DIR}/package.py | ||
27 | --build-dir=${CMAKE_BINARY_DIR} | ||
28 | --build-type=${CMAKE_BUILD_TYPE} | ||
29 | --source-dir=${CMAKE_SOURCE_DIR} | ||
30 | ) | ||
31 | |||
32 | endfunction( add_package_target ) | ||
diff --git a/linden/indra/newview/CMakeLists.txt b/linden/indra/newview/CMakeLists.txt index 7ffb32b..7389075 100644 --- a/linden/indra/newview/CMakeLists.txt +++ b/linden/indra/newview/CMakeLists.txt | |||
@@ -3,6 +3,7 @@ | |||
3 | project(viewer) | 3 | project(viewer) |
4 | 4 | ||
5 | include(00-Common) | 5 | include(00-Common) |
6 | include(AddPackageTarget) | ||
6 | include(Boost) | 7 | include(Boost) |
7 | include(BuildVersion) | 8 | include(BuildVersion) |
8 | include(DBusGlib) | 9 | include(DBusGlib) |
@@ -1290,6 +1291,10 @@ add_executable(${VIEWER_BINARY_NAME} | |||
1290 | ) | 1291 | ) |
1291 | check_message_template(${VIEWER_BINARY_NAME}) | 1292 | check_message_template(${VIEWER_BINARY_NAME}) |
1292 | 1293 | ||
1294 | |||
1295 | # NOTE: This variable is DEPRECATED, and should not be used anymore. | ||
1296 | # The package target should always be added. The variable AUTOPACKAGE | ||
1297 | # (in AddPackageTarget.cmake) controls whether package is auto-built. | ||
1293 | set(PACKAGE OFF CACHE BOOL | 1298 | set(PACKAGE OFF CACHE BOOL |
1294 | "Add a package target that builds an installer package.") | 1299 | "Add a package target that builds an installer package.") |
1295 | 1300 | ||
@@ -1431,43 +1436,49 @@ set(ARTWORK_DIR ${CMAKE_CURRENT_SOURCE_DIR} CACHE PATH | |||
1431 | 1436 | ||
1432 | 1437 | ||
1433 | if (LINUX) | 1438 | if (LINUX) |
1434 | add_custom_command( | ||
1435 | OUTPUT imprudence-stripped | ||
1436 | COMMAND strip | ||
1437 | ARGS --strip-debug -o imprudence-stripped ${VIEWER_BINARY_NAME} | ||
1438 | DEPENDS imprudence-bin | ||
1439 | ) | ||
1440 | 1439 | ||
1441 | set(product Imprudence-${ARCH}-${viewer_VERSION}) | 1440 | string(REPLACE "-bin" "-stripped" |
1441 | VIEWER_STRIPPED_NAME ${VIEWER_BINARY_NAME}) | ||
1442 | |||
1443 | add_dependencies(${VIEWER_BINARY_NAME} | ||
1444 | SLPlugin | ||
1445 | media_plugin_gstreamer010 | ||
1446 | media_plugin_webkit) | ||
1442 | 1447 | ||
1443 | add_custom_command( | 1448 | add_custom_command( |
1444 | OUTPUT ${product}.tar.bz2 | 1449 | OUTPUT ${VIEWER_STRIPPED_NAME} |
1445 | COMMAND ${PYTHON_EXECUTABLE} | 1450 | COMMAND strip |
1446 | ARGS | 1451 | ARGS --strip-debug -o ${VIEWER_STRIPPED_NAME} ${VIEWER_BINARY_NAME} |
1447 | ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py | 1452 | DEPENDS ${VIEWER_BINARY_NAME} |
1448 | --standalone=${STANDALONE} | 1453 | ) |
1449 | --buildtype=${CMAKE_BUILD_TYPE} | 1454 | |
1450 | --grid=${GRID} | 1455 | add_custom_target( |
1451 | --channel=${VIEWER_CHANNEL} | 1456 | viewer-manifest-target |
1452 | --login_channel=${VIEWER_LOGIN_CHANNEL} | 1457 | COMMAND |
1453 | --installer_name=${product} | 1458 | ${PYTHON_EXECUTABLE} |
1454 | --arch=${ARCH} | 1459 | ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py |
1455 | --source=${CMAKE_CURRENT_SOURCE_DIR} | 1460 | --standalone=${STANDALONE} |
1456 | --artwork=${ARTWORK_DIR} | 1461 | --buildtype=${CMAKE_BUILD_TYPE} |
1457 | --build=${CMAKE_CURRENT_BINARY_DIR} | 1462 | --grid=${GRID} |
1458 | --dest=${CMAKE_CURRENT_BINARY_DIR}/packaged | 1463 | --channel=${VIEWER_CHANNEL} |
1459 | --touch=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/.${product}.touched | 1464 | --login_channel=${VIEWER_LOGIN_CHANNEL} |
1460 | DEPENDS imprudence-stripped ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py | 1465 | --arch=${ARCH} |
1461 | ) | 1466 | --source=${CMAKE_CURRENT_SOURCE_DIR} |
1462 | 1467 | --artwork=${ARTWORK_DIR} | |
1463 | add_dependencies(${VIEWER_BINARY_NAME} SLPlugin media_plugin_gstreamer010 media_plugin_webkit) | 1468 | --build=${CMAKE_CURRENT_BINARY_DIR} |
1469 | --dest=${CMAKE_CURRENT_BINARY_DIR}/packaged | ||
1470 | DEPENDS | ||
1471 | ${VIEWER_STRIPPED_NAME} | ||
1472 | linux-crash-logger | ||
1473 | ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py | ||
1474 | ) | ||
1475 | |||
1476 | add_package_target() | ||
1477 | add_dependencies(package viewer-manifest-target) | ||
1464 | 1478 | ||
1465 | if (NOT INSTALL) | ||
1466 | add_custom_target(package ALL DEPENDS ${product}.tar.bz2) | ||
1467 | add_dependencies(package linux-crash-logger-strip-target) | ||
1468 | endif (NOT INSTALL) | ||
1469 | endif (LINUX) | 1479 | endif (LINUX) |
1470 | 1480 | ||
1481 | |||
1471 | if (DARWIN) | 1482 | if (DARWIN) |
1472 | set(product "Imprudence") | 1483 | set(product "Imprudence") |
1473 | set_target_properties( | 1484 | set_target_properties( |