add cmake flag RELEASE_BUILD, to control build of staging products and devel addons

REVIEW: 111247

thanks boud, boemann, buscher, ahiemstra for review (on irc)
parent b99ed02d
......@@ -48,6 +48,26 @@ set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules )
include(CalligraProductSetMacros)
if(NOT DEFINED RELEASE_BUILD)
# estimate mode by CMAKE_BUILD_TYPE content if not set on cmdline
string(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_TOLOWER)
set(RELEASE_BUILD_TYPES "release" "relwithdebinfo" "minsizerel")
list(FIND RELEASE_BUILD_TYPES ${CMAKE_BUILD_TYPE_TOLOWER} INDEX)
if (INDEX EQUAL -1)
set(RELEASE_BUILD FALSE)
else(INDEX EQUAL -1)
set(RELEASE_BUILD TRUE)
endif(INDEX EQUAL -1)
endif(NOT DEFINED RELEASE_BUILD)
message(STATUS "Release build: ${RELEASE_BUILD}")
if (RELEASE_BUILD)
set(CALLIGRA_SHOULD_BUILD_STAGING FALSE)
else (RELEASE_BUILD)
set(CALLIGRA_SHOULD_BUILD_STAGING TRUE)
endif (RELEASE_BUILD)
option(GHNS "support Get Hot New Stuff" OFF)
option(NEPOMUK "support NEPOMUK Tagging" ON)
# TODO: orthogonal setting, results in minimal features, yet needs to be defined
......
......@@ -49,12 +49,12 @@ endmacro()
macro(calligra_drop_unbuildable_products)
# first drop all staging products if not in debug build
if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug" AND NOT CMAKE_BUILD_TYPE STREQUAL "DebugFull")
# first drop all staging products if not enabled
if(NOT CALLIGRA_SHOULD_BUILD_STAGING)
foreach(_product_id ${CALLIGRA_STAGING_PRODUCTS})
calligra_disable_product(${_product_id} "Not ready for release")
endforeach(_product_id)
endif(NOT CMAKE_BUILD_TYPE STREQUAL "Debug" AND NOT CMAKE_BUILD_TYPE STREQUAL "DebugFull")
endif(NOT CALLIGRA_SHOULD_BUILD_STAGING)
# can assume calligra_all_products has products in down-up order
# 1. check all wanted products and see if they will be built,
......
project( textPlugin)
# only build the textdocument inspector in debug builds
set(BUILD_TEXTDOCUMENT_INSPECTOR (CMAKE_BUILD_TYPE STREQUAL "Debug"))
if(BUILD_TEXTDOCUMENT_INSPECTOR)
# only build the textdocument inspector in non-release builds
if(NOT RELEASE_BUILD)
set(BUILD_TEXTDOCUMENT_INSPECTOR TRUE)
add_definitions(-DCREATE_TEXTDOCUMENT_INSPECTOR)
endif(BUILD_TEXTDOCUMENT_INSPECTOR)
else(NOT RELEASE_BUILD)
set(BUILD_TEXTDOCUMENT_INSPECTOR FALSE)
endif(NOT RELEASE_BUILD)
add_subdirectory( pics )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment