katie_string_unwrap("${KATIE_TOOLS}" KATIE_TOOLS)
# custom install targets to make packaging easier
-add_custom_target(install-devel
- COMMAND "${CMAKE_COMMAND}" -DCMAKE_INSTALL_COMPONENT=Devel -P cmake_install.cmake
- WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
-)
+if(KATIE_UNIFDEF)
+ add_custom_target(install-devel
+ COMMAND "${CMAKE_COMMAND}" -DCMAKE_INSTALL_COMPONENT=Devel -P cmake_install.cmake
+ WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
+ # installing from script does not execute other scripts
+ COMMAND "${CMAKE_COMMAND}" -DUNIFDEF_EXECUTABLE="${KATIE_UNIFDEF}" -DHEADERS_DIRECTORY="${KATIE_HEADERS_PATH}" -P "${CMAKE_SOURCE_DIR}/cmake/modules/OptimizeHeaders.cmake"
+ )
+else()
+ add_custom_target(install-devel
+ COMMAND "${CMAKE_COMMAND}" -DCMAKE_INSTALL_COMPONENT=Devel -P cmake_install.cmake
+ WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
+ )
+endif()
add_custom_target(install-runtime
DEPENDS ${KATIE_COMPONENTS}
install(
CODE "set(UNIFDEF_EXECUTABLE \"${KATIE_UNIFDEF}\")"
CODE "set(HEADERS_DIRECTORY \"${DIR}\")"
- CODE "set(HEADERS_DEFINITIONS \"${ARGN}\")"
SCRIPT "${CMAKE_SOURCE_DIR}/cmake/modules/OptimizeHeaders.cmake"
)
endif()
# Copyright (C) 2015, Ivailo Monev, <xakepa10@gmail.com>
# Redistribution and use is allowed according to the terms of the BSD license.
-# UNIFDEF_EXECUTABLE, HEADERS_DIRECTORY and HEADERS_DEFINITIONS origin from the macro call
+# UNIFDEF_EXECUTABLE and HEADERS_DIRECTORY origin from the macro call
-file(GLOB headers "$ENV{DESTDIR}/${HEADERS_DIRECTORY}/*.h")
+set(headers_directory "$ENV{DESTDIR}/${HEADERS_DIRECTORY}")
+file(GLOB_RECURSE headers "${headers_directory}/*.h")
-set(bootstrap
+set(unifdef_arguments
+ # bootstrap
-UQT_BOOTSTRAPPED
-UQT_MOC
-)
-
-set(notsupported
+ # not supported
-UQT_NO_QOBJECT
-UQT_NO_COMPRESS
-UQT_NO_THREAD
-UQT_NO_TEXTCODEC
)
-message(STATUS "Optimizing header in: $ENV{DESTDIR}/${HEADERS_DIRECTORY}")
+message(STATUS "Optimizing header in: ${headers_directory}")
execute_process(
- COMMAND ${UNIFDEF_EXECUTABLE} -m ${bootstrap} ${notsupported} ${HEADERS_DEFINITIONS} ${headers}
+ COMMAND ${UNIFDEF_EXECUTABLE} -m ${unifdef_arguments} ${headers}
RESULT_VARIABLE unifdef_result
ERROR_VARIABLE unifdef_output
OUTPUT_VARIABLE unifdef_output