Changeset View
Changeset View
Standalone View
Standalone View
cmake/modules/KReportMacros.cmake
Show All 18 Lines | |||||
19 | # x.80.y or larger means test release, so the stable major version is x+1 | 19 | # x.80.y or larger means test release, so the stable major version is x+1 | ||
20 | if(PROJECT_VERSION_MINOR GREATER 80) | 20 | if(PROJECT_VERSION_MINOR GREATER 80) | ||
21 | set(PROJECT_UNSTABLE ON) | 21 | set(PROJECT_UNSTABLE ON) | ||
22 | math(EXPR PROJECT_STABLE_VERSION_MAJOR "${PROJECT_VERSION_MAJOR} + 1") | 22 | math(EXPR PROJECT_STABLE_VERSION_MAJOR "${PROJECT_VERSION_MAJOR} + 1") | ||
23 | else() | 23 | else() | ||
24 | set(PROJECT_STABLE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}) | 24 | set(PROJECT_STABLE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}) | ||
25 | endif() | 25 | endif() | ||
26 | 26 | | |||
27 | if(WIN32) | ||||
28 | set(LIB_INSTALL_DIR ${LIB_INSTALL_DIR} | ||||
29 | RUNTIME DESTINATION ${BIN_INSTALL_DIR} | ||||
30 | LIBRARY ${INSTALL_TARGETS_DEFAULT_ARGS} | ||||
31 | ARCHIVE ${INSTALL_TARGETS_DEFAULT_ARGS} ) | ||||
32 | set(DATA_INSTALL_DIR "$ENV{APPDATA}") | ||||
33 | STRING(REGEX REPLACE "\\\\" "/" DATA_INSTALL_DIR ${DATA_INSTALL_DIR}) | ||||
34 | # Install own icons to CMAKE_INSTALL_FULL_ICONDIR (relative to bin/data/ on Windows) on Windows. | ||||
35 | # We're consistent because icons from breeze-icons.git are installed there as well. | ||||
36 | set(ICONS_INSTALL_DIR ${CMAKE_INSTALL_FULL_ICONDIR}) | ||||
37 | else() | ||||
38 | # On other OSes install own icons in app's data dir | ||||
39 | set(ICONS_INSTALL_DIR | ||||
40 | "${DATA_INSTALL_DIR}/${PROJECT_NAME_LOWER}${PROJECT_STABLE_VERSION_MAJOR}/icons") | ||||
41 | endif() | ||||
42 | | ||||
27 | # Adds a feature info using add_feature_info() with _NAME and _DESCRIPTION. | 43 | # Adds a feature info using add_feature_info() with _NAME and _DESCRIPTION. | ||
28 | # If _NAME is equal to _DEFAULT, shows this fact. | 44 | # If _NAME is equal to _DEFAULT, shows this fact. | ||
29 | macro(add_simple_feature_info _NAME _DESCRIPTION _DEFAULT) | 45 | macro(add_simple_feature_info _NAME _DESCRIPTION _DEFAULT) | ||
30 | if("${_DEFAULT}" STREQUAL "${${_NAME}}") | 46 | if("${_DEFAULT}" STREQUAL "${${_NAME}}") | ||
31 | set(_STATUS " (default value)") | 47 | set(_STATUS " (default value)") | ||
32 | else() | 48 | else() | ||
33 | set(_STATUS "") | 49 | set(_STATUS "") | ||
34 | endif() | 50 | endif() | ||
▲ Show 20 Lines • Show All 110 Lines • ▼ Show 20 Line(s) | 153 | macro(set_coinstallable_lib_version _target) | |||
145 | string(TOUPPER ${_target} _target_upper) | 161 | string(TOUPPER ${_target} _target_upper) | ||
146 | string(TOUPPER ${_target_upper}_BASE_NAME _var) | 162 | string(TOUPPER ${_target_upper}_BASE_NAME _var) | ||
147 | set(${_var} ${_name}) | 163 | set(${_var} ${_name}) | ||
148 | string(TOLOWER ${_name} ${_var}_LOWER) | 164 | string(TOLOWER ${_name} ${_var}_LOWER) | ||
149 | set(${_target_upper}_INCLUDE_INSTALL_DIR ${INCLUDE_INSTALL_DIR}/${_name}) | 165 | set(${_target_upper}_INCLUDE_INSTALL_DIR ${INCLUDE_INSTALL_DIR}/${_name}) | ||
150 | unset(_target_upper) | 166 | unset(_target_upper) | ||
151 | unset(_var) | 167 | unset(_var) | ||
152 | endmacro() | 168 | endmacro() | ||
169 | | ||||
170 | # Adds custom target ${_target} that updates file ${_file} in the current working dir | ||||
171 | # using command ${_command} and add sources ${_sources} to the project files. | ||||
172 | # The command is run as a part of the project. | ||||
173 | function(add_update_file_target) | ||||
174 | set(options) | ||||
175 | set(oneValueArgs TARGET FILE) | ||||
176 | set(multiValueArgs COMMAND SOURCES) | ||||
177 | cmake_parse_arguments(ARG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) | ||||
178 | message(STATUS "ARG_TARGET ${ARG_TARGET}") | ||||
179 | add_custom_target(${ARG_TARGET} | ||||
180 | COMMAND ${ARG_COMMAND} | ||||
181 | SOURCES ${ARG_SOURCES} | ||||
182 | DEPENDS ${ARG_SOURCES} | ||||
183 | WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" | ||||
184 | COMMENT "Updating ${ARG_FILE}" | ||||
185 | VERBATIM | ||||
186 | ) | ||||
187 | endfunction() |