From 95e10831a4ebe20fa71d7e70aa156e0195844d32 Mon Sep 17 00:00:00 2001 From: Sascha Kratky Date: Wed, 15 Aug 2012 19:54:06 +0200 Subject: [PATCH] cotire 1.1.4 --- CMake/cotire.cmake | 24 ++++++++++++++++-------- HISTORY.md | 5 +++++ README.md | 1 + 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/CMake/cotire.cmake b/CMake/cotire.cmake index 3ce94ac..616ac60 100644 --- a/CMake/cotire.cmake +++ b/CMake/cotire.cmake @@ -44,7 +44,7 @@ if (NOT CMAKE_SCRIPT_MODE_FILE) endif() set (COTIRE_CMAKE_MODULE_FILE "${CMAKE_CURRENT_LIST_FILE}") -set (COTIRE_CMAKE_MODULE_VERSION "1.1.3") +set (COTIRE_CMAKE_MODULE_VERSION "1.1.4") include(CMakeParseArguments) @@ -1680,15 +1680,23 @@ function (cotire_setup_unity_generation_commands _language _target _targetScript foreach (_unityFile ${_unityFiles}) file (RELATIVE_PATH _unityFileRelPath "${CMAKE_BINARY_DIR}" "${_unityFile}") set_property (SOURCE "${_unityFile}" PROPERTY GENERATED TRUE) + # set up compiled unity source dependencies + # this ensures that missing source files are generated before the unity file is compiled + if (COTIRE_DEBUG) + message (STATUS "${_unityCmd} OBJECT_DEPENDS ${_dependencySources}") + endif() + if (_dependencySources) + set_property (SOURCE "${_unityFile}" PROPERTY OBJECT_DEPENDS ${_dependencySources}) + endif() cotire_set_cmd_to_prologue(_unityCmd) list (APPEND _unityCmd -P "${COTIRE_CMAKE_MODULE_FILE}" "unity" "${_targetScript}" "${_unityFile}") if (COTIRE_DEBUG) - message (STATUS "add_custom_command: OUTPUT ${_unityFile} COMMAND ${_unityCmd} DEPENDS ${_targetScript} ${_dependencySources}") + message (STATUS "add_custom_command: OUTPUT ${_unityFile} COMMAND ${_unityCmd} DEPENDS ${_targetScript}") endif() add_custom_command( OUTPUT "${_unityFile}" COMMAND ${_unityCmd} - DEPENDS "${_targetScript}" ${_dependencySources} + DEPENDS "${_targetScript}" COMMENT "Generating ${_language} unity source ${_unityFileRelPath}" WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" VERBATIM) list (APPEND ${_cmdsVar} COMMAND ${_unityCmd}) @@ -2331,15 +2339,15 @@ if (CMAKE_SCRIPT_MODE_FILE) endif() endforeach() - if (COTIRE_DEBUG) - message (STATUS "${COTIRE_ARGV0} ${COTIRE_ARGV1} ${COTIRE_ARGV2} ${COTIRE_ARGV3} ${COTIRE_ARGV4} ${COTIRE_ARGV5}") - endif() - # include target script if available if ("${COTIRE_ARGV2}" MATCHES "\\.cmake$") include("${COTIRE_ARGV2}") endif() + if (COTIRE_DEBUG) + message (STATUS "${COTIRE_ARGV0} ${COTIRE_ARGV1} ${COTIRE_ARGV2} ${COTIRE_ARGV3} ${COTIRE_ARGV4} ${COTIRE_ARGV5}") + endif() + if (WIN32) # for MSVC, compiler IDs may not always be set correctly if (MSVC) @@ -2378,7 +2386,7 @@ if (CMAKE_SCRIPT_MODE_FILE) cotire_generate_unity_source( "${COTIRE_ARGV3}" ${_sources} LANGUAGE "${COTIRE_TARGET_LANGUAGE}" - DEPENDS "${COTIRE_ARGV0}" "${COTIRE_ARGV2}" ${COTIRE_TARGET_UNITY_DEPENDS} + DEPENDS "${COTIRE_ARGV0}" "${COTIRE_ARGV2}" SOURCES_COMPILE_DEFINITIONS ${_sourcesDefinitions} PRE_UNDEFS ${_targetPreUndefs} POST_UNDEFS ${_targetPostUndefs} diff --git a/HISTORY.md b/HISTORY.md index c710d47..a3b07d9 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,3 +1,8 @@ +## 1.1.4 (2012-08-15) + +* prevent redundant re-generation of the unity source, prefix header and precompiled header files + (this makes cotire more applicable to C++ projects that use Qt). + ## 1.1.3 (2012-08-12) * fix out of range index operation upon building list of target include directories. diff --git a/README.md b/README.md index b795801..ce4557e 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,7 @@ features * Leverages native precompiled header generation features of IDEs (Visual Studio and Xcode). * Compatible with CMake's [cross-compiling][ccrc] support. * Compatible with compiler wrappers like [ccache][ccch]. +* Applicable to CMake based Qt projects. * Tested with Windows, Linux and OS X. * MIT licensed.