aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/cmake
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/cmake/00-Common.cmake9
-rw-r--r--linden/indra/cmake/AddPackageTarget.cmake32
-rw-r--r--linden/indra/cmake/BuildVersion.cmake25
3 files changed, 58 insertions, 8 deletions
diff --git a/linden/indra/cmake/00-Common.cmake b/linden/indra/cmake/00-Common.cmake
index 7e85ce0..1a24a41 100644
--- a/linden/indra/cmake/00-Common.cmake
+++ b/linden/indra/cmake/00-Common.cmake
@@ -14,10 +14,13 @@ set(CMAKE_CXX_FLAGS_RELWITHDEBINFO
14 "-DLL_RELEASE=1 -D_SECURE_SCL=0 -DLL_SEND_CRASH_REPORTS=0 -DNDEBUG -DLL_RELEASE_WITH_DEBUG_INFO=1") 14 "-DLL_RELEASE=1 -D_SECURE_SCL=0 -DLL_SEND_CRASH_REPORTS=0 -DNDEBUG -DLL_RELEASE_WITH_DEBUG_INFO=1")
15 15
16 16
17# Don't bother with a MinSizeRel build. 17# Available build types / configurations.
18# Add our current build type first, to coax Xcode into selecting it by default.
18 19
19set(CMAKE_CONFIGURATION_TYPES "RelWithDebInfo;Release;Debug" CACHE STRING 20set(TYPES ${CMAKE_BUILD_TYPE} RelWithDebInfo Release Debug)
20 "Supported build types." FORCE) 21list(REMOVE_DUPLICATES TYPES)
22set(CMAKE_CONFIGURATION_TYPES ${TYPES} CACHE STRING "Supported build types." FORCE)
23unset(TYPES)
21 24
22 25
23# Determine the number of bits of this processor 26# Determine the number of bits of this processor
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
10set(AUTOPACKAGE OFF CACHE BOOL
11 "Automatically build an installer package after compiling.")
12
13
14function( 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
32endfunction( add_package_target )
diff --git a/linden/indra/cmake/BuildVersion.cmake b/linden/indra/cmake/BuildVersion.cmake
index 59b36ff..f86e9e5 100644
--- a/linden/indra/cmake/BuildVersion.cmake
+++ b/linden/indra/cmake/BuildVersion.cmake
@@ -2,17 +2,32 @@
2 2
3include(Python) 3include(Python)
4 4
5if (NOT SCRIPTS_DIR)
6 set( SCRIPTS_DIR "${CMAKE_SOURCE_DIR}/../scripts" )
7endif (NOT SCRIPTS_DIR)
8
5macro (build_version _target) 9macro (build_version _target)
6 execute_process( 10 execute_process(
7 COMMAND ${PYTHON_EXECUTABLE} ${SCRIPTS_DIR}/build_version.py 11 COMMAND ${PYTHON_EXECUTABLE} ${SCRIPTS_DIR}/viewer_info.py --version
8 viewerversion.xml ${CMAKE_CURRENT_SOURCE_DIR}/app_settings/
9 OUTPUT_VARIABLE ${_target}_VERSION 12 OUTPUT_VARIABLE ${_target}_VERSION
10 OUTPUT_STRIP_TRAILING_WHITESPACE 13 OUTPUT_STRIP_TRAILING_WHITESPACE
11 ) 14 )
12 15
13 if (${_target}_VERSION) 16 execute_process(
14 message(STATUS "Version of ${_target} is ${${_target}_VERSION}") 17 COMMAND ${PYTHON_EXECUTABLE} ${SCRIPTS_DIR}/viewer_info.py --name
18 OUTPUT_VARIABLE ${_target}_NAME
19 OUTPUT_STRIP_TRAILING_WHITESPACE
20 )
21
22 execute_process(
23 COMMAND ${PYTHON_EXECUTABLE} ${SCRIPTS_DIR}/viewer_info.py --bundle-id
24 OUTPUT_VARIABLE ${_target}_BUNDLE_ID
25 OUTPUT_STRIP_TRAILING_WHITESPACE
26 )
27
28 if ("${_target}_VERSION" AND "${_target}_NAME")
29 message(STATUS "Version of ${_target} is ${${_target}_NAME} ${${_target}_VERSION}")
15 else (${_target}_VERSION) 30 else (${_target}_VERSION)
16 message(SEND_ERROR "Could not determine ${_target} version") 31 message(SEND_ERROR "Could not determine ${_target} version")
17 endif (${_target}_VERSION) 32 endif ("${_target}_VERSION" AND "${_target}_NAME")
18endmacro (build_version) 33endmacro (build_version)