CMake module to speed up builds.

Related tags

Build Systems cmake
Overview

cotire

Cotire (compile time reducer) is a CMake module that speeds up the build process of CMake based build systems by fully automating techniques as precompiled header usage and single compilation unit builds for C and C++.

The functionality provided by cotire has been superseded by features added to CMake 3.16. Support for pre-compiling and unity builds is now built into CMake. Thus, there will not be any further updates or support for this project.

features

  • Non-intrusive. Requires no source code modification and only minimal changes to CMake list files.
  • Automatically generates a single compilation unit (aka unity source file) for a CMake target.
  • Automatically generates a prefix header by tracking includes used by a CMake target.
  • Automatically precompiles prefix header and applies resulting precompiled header to a CMake target.
  • Alternatively, allows for using manually maintained unity source and prefix header files.
  • Supports C/C++ compilers Clang, GCC, Intel and Visual Studio C++.
  • Supports mixed language CMake targets.
  • Supports console (Makefile generator) and IDE (Visual Studio and Xcode) based builds.
  • Compatible with CMake single build type and CMake multi-configuration builds.
  • Compatible with most CMake generators (including Ninja).
  • Supports multi-core unity builds for some generators (make -j, jom, Visual Studio, Ninja).
  • Leverages native precompiled header generation features of IDEs (Visual Studio and Xcode).
  • Compatible with CMake's cross-compiling support.
  • Compatible with compiler wrappers like ccache.
  • Tested with Windows, Linux and OS X.
  • MIT licensed.

requirements

installation

Copy the file CMake/cotire.cmake to the module directory of your CMake project. In the top-level CMakeList.txt file, add the module directory to the CMake module search path:

set (CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMake")

usage

To use cotire in your CMake project, add the following include directive to the beginning of the top-level CMakeList.txt:

include(cotire)

To speed the build process of a CMake library or executable target, just apply the cotire function to the target:

add_executable(MyExecutable ${MyExecutableSources})
target_link_libraries(MyExecutable ${MyExecutableLibraries})
cotire(MyExecutable)

Cotire looks at the properties of the target provided by CMake (e.g., target type, source files, compile flags, preprocessor defines, include directories, ...) and sets up custom commands that will generate a unity source file, a prefix header and a precompiled header at build time specially tailored to the target.

For the generation of the prefix header, cotire will automatically choose headers used by the target that are outside of the project directory and thus are likely to change infrequently. The precompiled prefix header is then applied to the target to speed up the compilation process.

To use an existing manually maintained prefix header instead of the automatically generated one, set the COTIRE_CXX_PREFIX_HEADER_INIT property before invoking cotire:

set_target_properties(MyExecutable PROPERTIES COTIRE_CXX_PREFIX_HEADER_INIT "stdafx.h")
cotire(MyExecutable)

As a side effect, cotire generates a new target named MyExecutable_unity, which lets you perform a unity build for the original target. The unity target inherits all build settings from the original target, including linked library dependencies.

For Makefile based generators you can then invoke a unity build that produces the same output as the original target, but does so much faster by entering:

$ make MyExecutable_unity

See the advanced usage section of the cotire manual for information on how to configure the cotire process (e.g., how to make the unity build use all available processor cores).

The directory Patches contains patch files to enable cotire for some popular open sources packages that use CMake as a build system.

speedup

Depending on factors like hardware, compiler, the number of files in the target and the complexity of the C/C++ code, the build process of targets that use a cotire generated precompiled header will be sped up from 10 to 40 percent. Using precompiled headers however is not without issues and may not work for some programs.

A unity build may be up to 90 percent faster than the one file at a time build of the original target. Single compilation unit builds however are very unlikely to work without source code modifications, because they break the use of some C and C++ language features.

Generally, modern C++ code which makes heavy use of header-only libraries will profit the most from cotiring.

This blog post discusses speedup results obtained for real-world projects.

known issues

  • CMake configure time will increase for cotired targets.
  • The size of the CMake build folder will increase, because precompiled headers are large binaries.
  • It is not possible to share precompiled headers generated by cotire between CMake targets. Multiple targets can share a generated prefix header, though (see the cotire manual).
  • Cotire is not compatible with Xoreax IncrediBuild.
Comments
  • `__STRICT_ANSI__' not defined

    `__STRICT_ANSI__' not defined

    I got this warning when compiling on Ubuntu and the whole project is built without pch as normal build:

    warning: /home/utility/cotire/IO.Utility_CXX_prefix.hxx.gch: not used because '__STRICT_ANSI__' not defined [-Winvalid-pch]

    So is there a way to fix this warning?

    I don't have any issues when compiling on Windows.

    opened by martinergb 14
  • automatic target to unity conversion possible?

    automatic target to unity conversion possible?

    I would like to know if it would be possible to simply replace a target a by a unity target, keeping names and everything just not using original cpp files but the unity cpp files for building. And this should work for any target in a directory. that would make things a lot simpler, at least for me ;-)

    Regards, Gunnar

    opened by ghost 10
  • generated file with wrong include path using clang

    generated file with wrong include path using clang

    I' m on latest manjaro using cotire 1.8. A project I cotired generates cxx files with invalid include paths when using clang like the following:

    #include "/include/c++/7.3.1/vector"
    #include "/include/c++/7.3.1/chrono"
    #include "/include/c++/7.3.1/unordered_map"
    #include "/include/c++/7.3.1/list"
    #include "/include/c++/7.3.1/thread"
    

    so it doesn' t compile.

    The same files work with GCC. And it 's working well with clang on another laptop that' s using the same latest version of manjaro (the toolchain should be the same). Do you have any suggestions on finding the reason for this error? I tried cleaning build directories with no success.

    opened by xgdgsc 8
  • Evaluation file to be written multiple times for different configurations or languages with different content

    Evaluation file to be written multiple times for different configurations or languages with different content

    As soon as I added a new dependency library to my project, CMake began to raise some errors of this kind during generation: Evaluation file to be written multiple times for different configurations or languages with different content

    This is my current situation. I have four CMake projects where everyone of them depends on another one. To be more specific, Playground (exe) depends on OgreSubstance (dll) which depends on Numen (dll) which finally depends on NumenCrypto (static lib). Every project is cotired without unity build (COTIRE_ADD_UNITY_BUILD is false).

    The issue appeared as soon as I added OgreSubstance as a dependency of Playground modifying the dependencies hierarchy chain from this to this: Playground --> Numen --> NumenCrypto Playground --> OgreSubstance --> Numen --> NumenCrypto

    And the CMake code of Playground from this to this:

    add_executable(${PROJECT_NAME} WIN32 ${PLAYGROUND_INCLUDES} ${PLAYGROUND_SOURCES} ${PLAYGROUND_RESOURCES} ${PLAYGROUND_CFGS} ${PLAYGROUND_INIS})
    
    target_include_directories(${PROJECT_NAME}
    		PUBLIC $<TARGET_PROPERTY:Numen,INCLUDE_DIRECTORIES>
    		PUBLIC ../../include/playground
    )
    
    target_link_libraries(${PROJECT_NAME}
    		Numen
    )
    
    add_executable(${PROJECT_NAME} WIN32 ${PLAYGROUND_INCLUDES} ${PLAYGROUND_SOURCES} ${PLAYGROUND_RESOURCES} ${PLAYGROUND_CFGS} ${PLAYGROUND_INIS})
    
    target_include_directories(${PROJECT_NAME}
    		PUBLIC $<TARGET_PROPERTY:OgreSubstance,INCLUDE_DIRECTORIES>
    		PUBLIC ../../include/playground
    )
    
    target_link_libraries(${PROJECT_NAME}
    		OgreSubstance
    )
    

    The only way to solve I've found so far is to NOT cotire Playground (very frustrating).

    Here the CMake configuration log (both COTIRE_DEBUG and COTIRE_VERBOSE enabled): https://pastebin.com/ZRHFr5NT Here the CMake generation log: https://pastebin.com/J3WnYq5e Digging the CMake source code, I've found that this error should be raised during file(GENERATE ...) command. See here: https://gitlab.kitware.com/cmake/cmake/commit/9e1689413fd1e54e8056b7d369cd508636987072

    I'm using the latest CMake stable version, 3.8.2 (but I've alrady tried with the latest RC version, 3.9.0-rc3), and I'm generating for Visual Studio 15 2017 Win64. Since in my scenario this is a KO error, I'm open to make any tests you need.

    opened by TaaTT4 8
  • auto-delete outdated pch

    auto-delete outdated pch

    Working on arch linux with rather frequent compiler updates i get errors about pch files created with a different compiler version. The build fails and i have to manually delete them (or clean rebuild). Is it possible to detect this and trigger a rebuild?

    opened by Optiligence 8
  • Configure time very slow

    Configure time very slow

    If I do not enable cotire for my large-ish project, cmake 3.1.3 takes about 1 minute to configure it.

    If I enable cotire (1.6.9) configure time is 45 minutes. Obviously, the compile time improvements I get are totally negated by the excessive configure time.

    This seems to be a regression, it didn't used to be like this, i.e. in the past the two configure times were the same.

    This is on Windows 7, 8, and 8.1, with cmake 3.1 to 3.1.3 (dont know about newer, cannot check older).

    What would be the best way to figure out what is going on?

    opened by jtotz 8
  • checking if PCH take effect

    checking if PCH take effect

    Hi,

    I incoporated cotire in my cmake project, I get the "gch" file created correctly. However I see no reduction in compilation time (in fact there is some increase for creating the gch).

    The verbose output shows the additional flags: -Winvalid-pch -include "7path-to/file_prefix.h" during compilation of the source files.

    My feeling is that the PCH are created but not used. How can I check if the compiler used the PCH ?

    I am using GCC 4.8.3,

    thank you in advance filiatra

    opened by filiatra 8
  • Errors with CMake 3.9

    Errors with CMake 3.9

    If one adds the following lines in example/CMakelists.txt before the cotire() call for a CMake 3.9 build generation

    target_compile_options(example
        PRIVATE
            -W
            $<$<CXX_COMPILER_ID:GNU>:-Wall -Wextra>
            $<$<CXX_COMPILER_ID:Clang>:-Weverything>
            $<$<CXX_COMPILER_ID:AppleClang>:-Weverything>
    )
    

    The CMake execution fails with the following error message

    CMake Error at CMake/cotire.cmake:2254 (file):
      Error evaluating generator expression:
    
        $<CXX_COMPILER_ID:GNU>
    
      $<CXX_COMPILER_ID> may only be used with binary targets.  It may not be
      used with add_custom_command or add_custom_target.
    Call Stack (most recent call first):
      CMake/cotire.cmake:2848 (cotire_generate_target_script)
      CMake/cotire.cmake:3254 (cotire_process_target_language)
      CMake/cotire.cmake:3431 (cotire_target)
      src/CMakeLists.txt:20 (cotire)
    
    
    CMake Error at CMake/cotire.cmake:2254 (file):
      Error evaluating generator expression:
    
        $<CXX_COMPILER_ID:GNU>
    
      $<CXX_COMPILER_ID> may only be used with binary targets.  It may not be
      used with add_custom_command or add_custom_target.
    Call Stack (most recent call first):
      CMake/cotire.cmake:2848 (cotire_generate_target_script)
      CMake/cotire.cmake:3254 (cotire_process_target_language)
      CMake/cotire.cmake:3431 (cotire_target)
      src/CMakeLists.txt:20 (cotire)
    

    I can confirm that this code compiles with CMake 3.8.x.

    opened by ssbanerje 7
  • cotire Example project with empty prefix header

    cotire Example project with empty prefix header

    Compiling the cotire Example project creates an empty example_CXX_prefix.hxx file on my machine.

    While, as written into the manual, I would expect to have a prefix header with this content:

    #pragma warning(push, 0)
    #ifdef __cplusplus
    #include "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\string"
    #include "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\algorithm"
    #include "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\iostream"
    #endif
    #pragma warning(pop)
    

    I'm using Windows 8.1, CMake 3.1.0 and Visual Studio 2013 Professional. Is it a bug or my fault?

    Thanks for the help, Raffaele.

    opened by TaaTT4 7
  • Qt project: add dependency of _automoc target only when it's actually created

    Qt project: add dependency of _automoc target only when it's actually created

    Hi sakra,

    When building Qt projects with CMake and cotire, I found CMake(the version I use is 3.5.2) will not create a separate _automoc target for small projects, even if AUTOMOC, AUTOUIC, AUTORCC are all set to ON. This will cause cotire to fail with a target-not-exist error. I suggest checking whether the _automoc target is created before the add_dependencies line:

        else()
            add_library(${_unityTargetName} ${_unityTargetSubType} EXCLUDE_FROM_ALL ${_unityTargetSources})
        endif()
    -   if (_targetAutoMoc OR _targetAutoUic OR _targetAutoRcc)
    +   if (TARGET ${_target}_automoc)
            # depend on the original target's implicity generated <targetname>_automoc target
            add_dependencies(${_unityTargetName} ${_target}_automoc)
        endif()
    

    Thanks.

    opened by wdx04 6
  • Problem using COTIRE_CXX_PREFIX_HEADER_INIT

    Problem using COTIRE_CXX_PREFIX_HEADER_INIT

    Following the instructions in the manual, I've tried to setup a simple project using a designated precomputed header with something along the lines of:

    cmake_minimum_required(VERSION 2.8.0)
    set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
    
    project(CotireTest)
    
    include(cotire)
    
    add_executable(hello_cotire precompiled.cpp main.cpp precompiled.h)
    
    set_target_properties(hello_cotire PROPERTIES COTIRE_ADD_UNITY_BUILD FALSE)
    set_target_properties(hello_cotire PROPERTIES COTIRE_ENABLE_PRECOMPILED_HEADER TRUE)
    set_target_properties(hello_cotire PROPERTIES COTIRE_CXX_PREFIX_HEADER_INIT "precompiled.h")
    
    cotire(hello_cotire)
    
    get_target_property(_prefix hello_cotire COTIRE_CXX_PREFIX_HEADER)
    get_target_property(_precompiled hello_cotire COTIRE_CXX_PRECOMPILED_HEADER)
    
    message("prefix " ${_prefix})
    message("precompiled " ${_precompiled})
    

    You can find the entire project here: http://github.com/zah/hello_cotire

    If I enable COTIRE_DEBUG and COTIRE_VERBOSE, I get this: https://gist.github.com/zah/5598251

    In the generated project files, none of the sources have the "Use Precompiled Headers" option enabled. The property COTIRE_CXX_PRECOMPILED_HEADER doesn't seem to be set to anything as shown in the log.

    My cmake version is 2.8.10.2 I've tried to generate projects for Visual Studio 2012 and Visual Studio 2008.

    opened by zah 6
  • [pkgconfig] cotire doesn't fully support cmake function FindPkgConfig

    [pkgconfig] cotire doesn't fully support cmake function FindPkgConfig

    When using pkg_check_modules, CMAKE_MINIMUM_REQUIRED_VERSION must be set greater than or equal to 3.1 to allow cmake to automatically add CMAKE_PREFIX_PATH to PKG_CONFIG_PATH so that pkg-config can be called to find .pc files. However, the minimum cmake version requirement for cotire is 2.8.12, which will cause this setting to fail.

    See code: https://github.com/Kitware/CMake/blob/master/Modules/FindPkgConfig.cmake#L185-L188 https://github.com/Kitware/CMake/blob/master/Modules/FindPkgConfig.cmake#L383-L387

    opened by JackBoosY 1
  • Same Target Had been compile Twice with different Compile flags, but the prebuild header file hadn't been recreated.

    Same Target Had been compile Twice with different Compile flags, but the prebuild header file hadn't been recreated.

    as the title , we meet this problem , below ,we will make a example to explain what i meet . In my CMakeLists, we had build three target , A , B , C both A and B with depend C .

    1. build A , C target , compile flag with -DLE ,
    2. build B , C target , compile flag with -DBG when we build A C target with -DLE had been successed , we start build B, C target with -DBG then the prebuild head file hadn't recreate , so an error had occur as below . cc1: warning: xxx_C_prefix.h.gch: not used because `LE' not defined [-Winvalid-pch]

    Is there any comman can force recreate the prebuild header file ?

    opened by lxy9527 2
  • cotire slows down the compilation of the test code

    cotire slows down the compilation of the test code

    I tried on the test code but got abnormal result:

    • using cotire, it cost me 0.7s on average
    • disabling cotire, it cost me 0.4s on average I wonder why is the result.
    opened by zhangjun-xyz 0
  • New pre-compiled headers support in CMake 3.16

    New pre-compiled headers support in CMake 3.16

    CMake 3.16 provides new support for pre-compiled headers:

    • The “target_precompile_headers()” command was added to specify a list of headers to precompile for faster compilation times.

    • The “UNITY_BUILD” target property was added to tell generators to batch include source files for faster compilation times.

    https://blog.kitware.com/cmake-3-16-0-rc1-is-ready-for-testing/

    I assume these new functions replace cotire in the future ..

    Best, Stefan

    opened by Mr-Rayman 2
  • Evaluation file to be written multiple times with different content

    Evaluation file to be written multiple times with different content

    Hi, I want to build a project that uses dlib. Here's the CMakeLists.txtfile that I used.

    cmake_minimum_required(VERSION 3.11)
    project("dlib example" LANGUAGES CXX)
    
    set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMake")
    
    include(FetchContent)
    # Fetch Dlib
    set(DLIB_TAG master)
    FetchContent_Declare(
    	dlib
    	GIT_REPOSITORY https://github.com/davisking/dlib.git
    	GIT_TAG        ${DLIB_TAG}
    )
    message("-- Fetching dlib ${DLIB_TAG}")
    FetchContent_MakeAvailable(dlib)
    include(cotire)
    add_executable(mnist build/_deps/dlib-src/examples/dnn_introduction_ex.cpp)
    target_link_libraries(mnist PRIVATE dlib::dlib)
    target_compile_options(mnist PRIVATE -Wall -Wextra -Wpedantic)
    cotire(mnist)
    

    When I run

    mkdir build && cd build
    cmake -GNinja ..
    

    I get the following error:

    CMake Error in CMakeLists.txt:
      Evaluation file to be written multiple times with different content.  This
      is generally caused by the content evaluating the configuration type,
      language, or location of object files:
    
       /home/adria/Projects/cotire/build/mnist_CXX_Release_cotire.cmake
    

    Here's the output with -DCOTIRE_DEBUG=ON

    -- cotire 1.8.0 loaded.
    -- C exclude extensions: m;mm
    -- CXX source file extensions: C;M;c++;cc;cpp;cxx;mm;CPP
    -- CXX ignore extensions: inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC
    -- CXX exclude extensions: m;mm
    -- Filtered mnist CXX sources: build/_deps/dlib-src/examples/dnn_introduction_ex.cpp
    -- CXX source file extensions: C;M;c++;cc;cpp;cxx;mm;CPP
    -- CXX ignore extensions: inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC
    -- CXX exclude extensions: m;mm
    -- Filtered mnist CXX sources: build/_deps/dlib-src/examples/dnn_introduction_ex.cpp
    -- Target mnist compile flags: -O3;-DNDEBUG;-Wall;-Wextra;-Wpedantic;-DDLIB_JPEG_SUPPORT;-DDLIB_USE_BLAS;-DDLIB_USE_LAPACK;-DDLIB_PNG_SUPPORT;-DDLIB_GIF_SUPPORT;$<$<COMPILE_LANGUAGE:CXX>:-Wreturn-type>
    -- Filter I unmatched: -O3;-DNDEBUG;-Wall;-Wextra;-Wpedantic;-DDLIB_JPEG_SUPPORT;-DDLIB_USE_BLAS;-DDLIB_USE_LAPACK;-DDLIB_PNG_SUPPORT;-DDLIB_GIF_SUPPORT;$<$<COMPILE_LANGUAGE:CXX>:-Wreturn-type>
    -- Filter isystem unmatched: -O3;-DNDEBUG;-Wall;-Wextra;-Wpedantic;-DDLIB_JPEG_SUPPORT;-DDLIB_USE_BLAS;-DDLIB_USE_LAPACK;-DDLIB_PNG_SUPPORT;-DDLIB_GIF_SUPPORT;$<$<COMPILE_LANGUAGE:CXX>:-Wreturn-type>
    -- Target mnist include dirs: $<BUILD_INTERFACE:/home/adria/Projects/cotire/build/_deps/dlib-src/dlib/..>;$<INSTALL_INTERFACE:include>
    -- Target mnist compile flags: -O3;-DNDEBUG;-Wall;-Wextra;-Wpedantic;-DDLIB_JPEG_SUPPORT;-DDLIB_USE_BLAS;-DDLIB_USE_LAPACK;-DDLIB_PNG_SUPPORT;-DDLIB_GIF_SUPPORT;$<$<COMPILE_LANGUAGE:CXX>:-Wreturn-type>
    -- Filter D matched: NDEBUG;DLIB_JPEG_SUPPORT;DLIB_USE_BLAS;DLIB_USE_LAPACK;DLIB_PNG_SUPPORT;DLIB_GIF_SUPPORT
    -- Filter D unmatched: -O3;-Wall;-Wextra;-Wpedantic;$<$<COMPILE_LANGUAGE:CXX>:-Wreturn-type>
    -- Target mnist compile definitions: NDEBUG;DLIB_JPEG_SUPPORT;DLIB_USE_BLAS;DLIB_USE_LAPACK;DLIB_PNG_SUPPORT;DLIB_GIF_SUPPORT
    -- Target mnist compile flags: -O3;-DNDEBUG;-Wall;-Wextra;-Wpedantic;-DDLIB_JPEG_SUPPORT;-DDLIB_USE_BLAS;-DDLIB_USE_LAPACK;-DDLIB_PNG_SUPPORT;-DDLIB_GIF_SUPPORT;$<$<COMPILE_LANGUAGE:CXX>:-Wreturn-type>
    -- Filter D|I|isystem matched: NDEBUG;DLIB_JPEG_SUPPORT;DLIB_USE_BLAS;DLIB_USE_LAPACK;DLIB_PNG_SUPPORT;DLIB_GIF_SUPPORT
    -- Filter D|I|isystem unmatched: -O3;-Wall;-Wextra;-Wpedantic;$<$<COMPILE_LANGUAGE:CXX>:-Wreturn-type>
    -- Target mnist compiler flags: -O3;-Wall;-Wextra;-Wpedantic;$<$<COMPILE_LANGUAGE:CXX>:-Wreturn-type>
    -- # cotire.cmake 1.8.0 generated file
    # /home/adria/Projects/cotire/build/mnist_CXX_cotire.cmake
    set (COTIRE_ADDITIONAL_PREFIX_HEADER_IGNORE_EXTENSIONS "inc;inl;ipp")
    set (COTIRE_ADDITIONAL_PREFIX_HEADER_IGNORE_PATH "")
    set (COTIRE_CLEAN_ALL_TARGET_NAME "clean_cotire")
    set (COTIRE_CLEAN_TARGET_SUFFIX "_clean_cotire")
    set (COTIRE_CMAKE_MODULE_FILE "/home/adria/Projects/cotire/CMake/cotire.cmake")
    set (COTIRE_CMAKE_MODULE_VERSION "1.8.0")
    set (COTIRE_DEBUG "ON")
    set (COTIRE_INTDIR "cotire")
    set (COTIRE_MAXIMUM_NUMBER_OF_UNITY_INCLUDES "-j")
    set (COTIRE_MINIMUM_NUMBER_OF_TARGET_SOURCES "2")
    set (COTIRE_PCH_ALL_TARGET_NAME "all_pch")
    set (COTIRE_PCH_TARGET_SUFFIX "_pch")
    set (COTIRE_PREFIX_HEADER_FILENAME_SUFFIX "_prefix")
    set (COTIRE_TARGETS_FOLDER "cotire")
    set (COTIRE_TARGET_COMPILE_DEFINITIONS_RELEASE "NDEBUG;DLIB_JPEG_SUPPORT;DLIB_USE_BLAS;DLIB_USE_LAPACK;DLIB_PNG_SUPPORT;DLIB_GIF_SUPPORT")
    set (COTIRE_TARGET_COMPILE_FLAGS_RELEASE "-O3;-Wall;-Wextra;-Wpedantic;$<$<COMPILE_LANGUAGE:CXX>:-Wreturn-type>")
    set (COTIRE_TARGET_CONFIGURATION_TYPES "Release")
    set (COTIRE_TARGET_CXX_COMPILER_LAUNCHER "COTIRE_TARGET_CXX_COMPILER_LAUNCHER-NOTFOUND")
    set (COTIRE_TARGET_IGNORE_PATH "/home/adria/Projects/cotire")
    set (COTIRE_TARGET_INCLUDE_DIRECTORIES_RELEASE "$<BUILD_INTERFACE:/home/adria/Projects/cotire/build/_deps/dlib-src/dlib/..>;$<INSTALL_INTERFACE:include>")
    set (COTIRE_TARGET_INCLUDE_PRIORITY_PATH "")
    set (COTIRE_TARGET_LANGUAGE "CXX")
    set (COTIRE_TARGET_MAXIMUM_NUMBER_OF_INCLUDES "-j")
    set (COTIRE_TARGET_POST_UNDEFS "")
    set (COTIRE_TARGET_PRE_UNDEFS "")
    set (COTIRE_TARGET_SOURCES "build/_deps/dlib-src/examples/dnn_introduction_ex.cpp")
    set (COTIRE_UNITY_BUILD_ALL_TARGET_NAME "all_unity")
    set (COTIRE_UNITY_BUILD_TARGET_SUFFIX "_unity")
    set (COTIRE_UNITY_OUTPUT_DIRECTORY "unity")
    set (COTIRE_UNITY_SOURCE_EXCLUDE_EXTENSIONS "m;mm")
    set (COTIRE_UNITY_SOURCE_FILENAME_SUFFIX "_unity")
    set (CMAKE_GENERATOR "Ninja")
    set (CMAKE_BUILD_TYPE "Release")
    set (CMAKE_CXX_COMPILER_ID "GNU")
    set (CMAKE_CXX_COMPILER_VERSION "8.3.0")
    set (CMAKE_CXX_COMPILER "/usr/bin/c++")
    set (CMAKE_CXX_COMPILER_ARG1 "")
    set (CMAKE_INCLUDE_FLAG_CXX "-I")
    set (CMAKE_INCLUDE_SYSTEM_FLAG_CXX "-isystem ")
    set (CMAKE_CXX_SOURCE_FILE_EXTENSIONS "C;M;c++;cc;cpp;cxx;mm;CPP")
    
    -- mnist unity source max includes: 1
    -- unity files: /home/adria/Projects/cotire/build/cotire/mnist_CXX_unity.cxx
    -- add_custom_command: OUTPUT /home/adria/Projects/cotire/build/cotire/mnist_CXX_unity.cxx COMMAND /usr/bin/cmake;--warn-uninitialized;-DCOTIRE_BUILD_TYPE:STRING=$<CONFIGURATION>;-P;/home/adria/Projects/cotire/CMake/cotire.cmake;unity;/home/adria/Projects/cotire/build/mnist_CXX_$<$<CONFIG:>:None>$<$<NOT:$<CONFIG:>>:$<CONFIGURATION>>_cotire.cmake;/home/adria/Projects/cotire/build/cotire/mnist_CXX_unity.cxx DEPENDS /home/adria/Projects/cotire/build/mnist_CXX_$<$<CONFIG:>:None>$<$<NOT:$<CONFIG:>>:$<CONFIGURATION>>_cotire.cmake
    -- add_custom_command: OUTPUT /home/adria/Projects/cotire/build/cotire/mnist_CXX_prefix.cxx COMMAND /usr/bin/cmake;--warn-uninitialized;-DCOTIRE_BUILD_TYPE:STRING=$<CONFIGURATION>;-P;/home/adria/Projects/cotire/CMake/cotire.cmake;prefix;/home/adria/Projects/cotire/build/mnist_CXX_$<$<CONFIG:>:None>$<$<NOT:$<CONFIG:>>:$<CONFIGURATION>>_cotire.cmake;/home/adria/Projects/cotire/build/cotire/mnist_CXX_prefix.cxx;/home/adria/Projects/cotire/build/cotire/mnist_CXX_unity.cxx DEPENDS /home/adria/Projects/cotire/build/cotire/mnist_CXX_unity.cxx  /usr/bin/c++
    -- add_custom_command: OUTPUT /home/adria/Projects/cotire/build/cotire/mnist_CXX_prefix.hxx COMMAND /usr/bin/cmake;--warn-uninitialized;-DCOTIRE_BUILD_TYPE:STRING=$<CONFIGURATION>;-P;/home/adria/Projects/cotire/CMake/cotire.cmake;combine;/home/adria/Projects/cotire/build/mnist_CXX_$<$<CONFIG:>:None>$<$<NOT:$<CONFIG:>>:$<CONFIGURATION>>_cotire.cmake;/home/adria/Projects/cotire/build/cotire/mnist_CXX_prefix.hxx;/home/adria/Projects/cotire/build/cotire/mnist_CXX_prefix.cxx DEPENDS /home/adria/Projects/cotire/build/cotire/mnist_CXX_prefix.cxx
    -- CXX source file extensions: C;M;c++;cc;cpp;cxx;mm;CPP
    -- CXX ignore extensions: inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC
    -- CXX exclude extensions: m;mm
    -- Filtered mnist CXX sources: build/_deps/dlib-src/examples/dnn_introduction_ex.cpp
    -- add target EXECUTABLE mnist_unity  EXCLUDE_FROM_ALL /home/adria/Projects/cotire/build/cotire/mnist_CXX_unity.cxx
    -- unity target mnist_unity link strategy: COPY_UNITY
    -- unity target mnist_unity link libraries: dlib::dlib
    -- Configuring done
    CMake Error in CMakeLists.txt:
      Evaluation file to be written multiple times with different content.  This
      is generally caused by the content evaluating the configuration type,
      language, or location of object files:
    
       /home/adria/Projects/cotire/build/mnist_CXX_Release_cotire.cmake
    

    Am I doing something wrong? Thanks in advance.

    opened by arrufat 0
Releases(cotire-1.8.1)
  • cotire-1.8.1(Dec 23, 2019)

  • cotire-1.8.0(Mar 18, 2018)

    • support for clang-cl.exe under Windows.
    • faster prefix header generation for Clang.
    • enable parallel compilation of unity target for MSVC.
    • CMake 3.9 and 3.10 compatibility fixes.
    • disable inclusion of timestamp in precompiled headers for Clang.
    • work around ccache reporting incorrect configuration.
    • honor MANUALLY_ADDED_DEPENDENCIES property upon generation of unity targets.
    • use default setting of 2 for COTIRE_MINIMUM_NUMBER_OF_TARGET_SOURCES.
    • drop broken support for unity building of targets with automatic CMake Qt processing turned on.
    • manual updates.
    Source code(tar.gz)
    Source code(zip)
    cotire.cmake(170.23 KB)
  • cotire-1.7.10(Jun 16, 2017)

    • CMake 3.8 compatibility.
    • CMake 3.8.0 Qt automoc support (thanks bilke).
    • fix Xcode recompiling every time builds happen (thanks gcamp).
    • disable PCH messages when -Wno-pch-messages flag exists (thanks kbinani).
    • work around ccache incompatibility with newer versions of GCC and Clang.
    • fix MinGW incompatibility with BUILD_INTERFACE generator expression.
    • fix handling of CMAKE_INCLUDE_FLAG_SEP_<LANG> variables.
    Source code(tar.gz)
    Source code(zip)
    cotire.cmake(165.17 KB)
  • cotire-1.7.9(Dec 8, 2016)

    • CMake 3.6 and 3.7 compatibility.
    • fix ccache 3.2 compatibility issues.
    • fix bugs with handling language standard related properties (e.g., CXX_STANDARD, CXX_EXTENSIONS).
    • make prefix header generation and precompiled header compilation depend on the compiler executable.
    • fix Qt automoc handling for Windows (thanks jcelerier).
    • convert Windows paths in include directories to CMake paths (thanks wdx04).
    • replace object library with corresponding unity object library when using COPY_UNITY linking strategy.
    • better error reporting from prefix header generation.
    Source code(tar.gz)
    Source code(zip)
  • cotire-1.7.8(Mar 27, 2016)

    • fix COPY_UNITY linking strategy for private link dependencies.
    • honor CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE upon handling of target usage requirements.
    • reworked setting up of LINK_LIBRARIES and INTERFACE_LINK_LIBRARIES properties for unity targets.
    Source code(tar.gz)
    Source code(zip)
  • cotire-1.7.7(Mar 20, 2016)

    • CMake 3.5 compatibility.
    • fix bugs related to handling of interface libraries.
    • output shorter log messages when using Visual Studio IDE.
    • don't disable PCH if CMAKE__COMPILER_ID is not set (thanks jcelerier).
    • add support for compiler launchers introduced in CMake 3.4 (thanks misery).
    Source code(tar.gz)
    Source code(zip)
  • cotire-1.7.6(Dec 6, 2015)

  • cotire-1.7.5(Oct 27, 2015)

    • handle visibility target properties (CXX_VISIBILITY_PRESET and VISIBILITY_INLINES_HIDDEN).
    • better handling of include directories and system include directories.
    • parse additional system include directories from target compile flags.
    • activate select CMake policies.
    Source code(tar.gz)
    Source code(zip)
  • cotire-1.7.4(Oct 10, 2015)

  • cotire-1.7.3(Jul 25, 2015)

    • handle language standard target properties (e.g., CXX_STANDARD).
    • apply user provided prefix header to unity build target.
    • remove effect of COTIRE_MINIMUM_NUMBER_OF_TARGET_SOURCES on generated unity target.
    • manual updates.
    Source code(tar.gz)
    Source code(zip)
  • cotire-1.7.2(Apr 22, 2015)

    • reduce configure time overhead.
    • fix bug with dependency checking when using Xcode.
    • remove obsolete code required for CMake versions older than 2.8.12.
    • streamline debugging output.
    Source code(tar.gz)
    Source code(zip)
  • cotire-1.7.1(Apr 6, 2015)

    • fix problem with CMake's automatic Qt processing for generated unity targets.
    • added a section on common pitfalls when using cotire to the manual.
    • remove obsolete code required for CMake versions older than 2.8.12.
    • streamline debugging output.
    • activate select CMake policies.
    Source code(tar.gz)
    Source code(zip)
  • cotire-1.7.0(Mar 29, 2015)

    • fix CMake 3.2 compatibility issues.
    • cotire now requires CMake 2.8.12 or newer.
    • copy IMPORT_PREFIX and IMPORT_SUFFIX target properties for unity targets (thanks peterhuene).
    • new property COTIRE_PREFIX_HEADER_INCLUDE_PRIORITY_PATH allows for organizing includes added to the prefix header by priority (thanks ArnaudD-FR).
    • for Visual Studio C++, increase static precompiled header memory allocation.
    • the default strategy for setting up a unity target's linked libraries is now COPY_UNITY.
    • for Qt projects, fix problem with handling of AUTOMOC in generated unity target.
    • fix problem with generating the cotire intermediate directory.
    • documentation updates.
    Source code(tar.gz)
    Source code(zip)
  • cotire-1.6.9(Mar 29, 2015)

  • cotire-1.6.8(Mar 29, 2015)

  • cotire-1.6.7(Mar 29, 2015)

    • fix CMake 3.1 compatibility issues.
    • fix ccache 3.2 compatibility issues.
    • handle COTIRE_MINIMUM_NUMBER_OF_TARGET_SOURCES correctly for mixed-language targets.
    • correctly compute absolute paths of generated source files added to the unity source file.
    • fix bug with checking unity source and prefix header dependencies under Xcode.
    • fix bug with handling of unity source file dependencies.
    • move code to determine build configurations to function of its own.
    • documentation updates.
    Source code(tar.gz)
    Source code(zip)
  • cotire-1.6.6(Mar 29, 2015)

    • fix GCC issue with prefix header generation when source files are missing.
    • fix bug where some target properties were not properly propagated to the generated unity target.
    • use target_link_libraries to set up the unity target link libraries.
    • add Qt4 and Qt5 examples to the Patches directory.
    • documentation updates.
    Source code(tar.gz)
    Source code(zip)
  • cotire-1.6.5(Mar 29, 2015)

    • correctly handle generator expressions used in compile definitions, compile flags and include directories (requires CMake 2.8.12 or newer).
    • fix -isystem includes being incorrectly passed to execute_process (thanks nickhutchinson).
    • make some error messages more verbose.
    Source code(tar.gz)
    Source code(zip)
  • cotire-1.6.4(Mar 29, 2015)

    • fix CMake 3.0 compatibility issues.
    • preserve system flag for includes when generating PCH (thanks gjasny).
    • fix bug with setting up EXPORTS symbol for shared libraries.
    Source code(tar.gz)
    Source code(zip)
  • cotire-1.6.3(Mar 29, 2015)

  • cotire-1.6.2(Mar 29, 2015)

    • don't use -w flag for pre-compiling the prefix header, because it has unwanted side effects.
    • correctly handle linked targets' INTERFACE_COMPILE_OPTIONS, INTERFACE_INCLUDE_DIRECTORIES and INTERFACE_COMPILE_DEFINITIONS properties upon pre-compiling and prefix header generation.
    • For Clang and GCC, pre-compile prefix header through indirect inclusion via a prefix source file, to make both compilers honor the system_header pragma in the prefix header correctly.
    • fix ccache incompatibility.
    Source code(tar.gz)
    Source code(zip)
  • cotire-1.6.1(Mar 29, 2015)

    • fixed bug where precompiled headers did not work with Clang (thanks to nh2 for reporting).
    • when using ccache, require that environment variable CCACHE_SLOPPINESS is set to time_macros.
    Source code(tar.gz)
    Source code(zip)
  • cotire-1.6.0(Mar 29, 2015)

    • suppress compiler warnings from precompiled headers.
    • fix Clang compatibility issue with prefix header generation.
    • use file extension .pch for precompiled headers generated with Clang.
    • manual updates.
    Source code(tar.gz)
    Source code(zip)
  • cotire-1.5.2(Mar 29, 2015)

    • honor framework includes under OS X correctly.
    • fix handling of OS X specific variables CMAKE_OSX_SYSROOT and CMAKE_OSX_DEPLOYMENT_TARGET.
    • add new examples to the Patches directory.
    Source code(tar.gz)
    Source code(zip)
  • cotire-1.5.1(Mar 29, 2015)

  • cotire-1.5.0(Mar 29, 2015)

    • CMake 2.8.12 compatibility fixes.
    • Upon generation of a unity target, cotire can now be configured to automatically copy all the linked libraries and targets from the original target. See the section on the new target property COTIRE_UNITY_LINK_LIBRARIES_INIT in the cotire manual.
    • fixed bug with copying target properties to generated unity target.
    • cotire manual updates.
    • add new examples to the Patches directory.
    • fix typos.
    Source code(tar.gz)
    Source code(zip)
  • cotire-1.4.3(Mar 29, 2015)

  • cotire-1.4.2(Mar 29, 2015)

    • CMake 2.8.11 compatibility fixes.
    • always force the inclusion of a user provided prefix header, even if the target contains too few sources to enable the use of a precompiled header.
    Source code(tar.gz)
    Source code(zip)
  • cotire-1.4.1(Mar 29, 2015)

    • fixed bug with determination of compiler version.
    • fixed bug with generation of unity source when target source files are used for multiple targets.
    • fixed bug with multi-core optimized prefix header generation.
    Source code(tar.gz)
    Source code(zip)
  • cotire-1.4.0(Mar 29, 2015)

    • one year anniversary release.
    • add support for multi-core optimized unity builds for some CMake generators.
    • add support for multi-core optimized prefix header generation.
    • add more examples to cotire manual.
    Source code(tar.gz)
    Source code(zip)
Owner
Sascha Kratky
[](){}();
Sascha Kratky
CMake module to enable code coverage easily and generate coverage reports with CMake targets.

CMake-codecov CMake module to enable code coverage easily and generate coverage reports with CMake targets. Include into your project To use Findcodec

HPC 82 Oct 25, 2022
unmaintained - CMake module to activate certain C++ standard, feature checks and appropriate automated workarounds - basically an improved version of cmake-compile-features

Compatibility This library provides an advanced target_compile_features() and write_compiler_detection_header(). The problem with those is that they a

Jonathan Müller 72 Apr 14, 2022
[CMake] [BSD-2] CMake module to find ICU

FindICU.cmake A CMake module to find International Components for Unicode (ICU) Library Note that CMake, since its version 3.7.0, includes a FindICU m

julp 29 Nov 2, 2022
Tundra is a code build system that tries to be accurate and fast for incremental builds

Tundra, a build system Tundra is a high-performance code build system designed to give the best possible incremental build times even for very large s

Andreas Fredriksson 393 Nov 19, 2022
📦 CMake's missing package manager. A small CMake script for setup-free, cross-platform, reproducible dependency management.

Setup-free CMake dependency management CPM.cmake is a CMake script that adds dependency management capabilities to CMake. It's built as a thin wrapper

CPM.cmake 1.5k Nov 25, 2022
CMake scripts for painless usage of SuiteSparse+METIS from Visual Studio and the rest of Windows/Linux/OSX IDEs supported by CMake

CMake scripts for painless usage of Tim Davis' SuiteSparse (CHOLMOD,UMFPACK,AMD,LDL,SPQR,...) and METIS from Visual Studio and the rest of Windows/Lin

Jose Luis Blanco-Claraco 394 Nov 24, 2022
cmake-font-lock - Advanced, type aware, highlight support for CMake

cmake-font-lock - Advanced, type aware, highlight support for CMake

Anders Lindgren 39 Oct 2, 2022
cmake-avr - a cmake toolchain for AVR projects

cmake-avr - a cmake toolchain for AVR projects Testing the example provided The toolchain was created and tested within the following environment: Lin

Matthias Kleemann 162 Oct 24, 2022
Make CMake less painful when trying to write Modern Flexible CMake

Izzy's eXtension Modules IXM is a CMake library for writing Modern flexible CMake. This means: Reducing the amount of CMake written Selecting reasonab

IXM 107 Sep 1, 2022
curl cmake module libcurl build with msvc x86

curl-msvc Infomation curl cmake module libcurl build with MSVC10.0 arch (x86 | i386) source from https://github.com/curl/curl tags: curl-7_79_1 Usage

Jason Payne 0 May 16, 2022
CMake module for downloading an external project's source at configure time

DownloadProject Platform Build status Linux Mac OSX Windows (VS2015) This repository contains a generalized implementation for downloading an external

Crascit Pty Ltd 433 Nov 23, 2022
CMake module for building IDL files with MIDL and generating CLR DLL using Tlbimp

FindIDL CMake module for building IDL files with MIDL and generating CLR DLL using Tlbimp. Introduction Requirements Usage find_package() add_idl() ad

Apriorit Inc. 17 Nov 6, 2022
CMake module for building Windows Installer packages with WiX toolset

FindWiX CMake module for building Windows Installer packages with WiX toolset Introduction Requirements Usage find_package() wix_add_project() WiX com

Apriorit Inc. 11 Aug 5, 2022
CMake find module for Intel Threading Building Blocks

FindTBB Module FindTBB is a CMake find package module for Intel® Threading Building Blocks (TBB). Usage The signature of the TBB find module in CMake

Justus Calvin 83 Nov 23, 2022
CMake module for Mathematica.

FindMathematica FindMathematica is a CMake module that tries to find a Wolfram Language installation and provides CMake functions for its C/C++ interf

Sascha Kratky 50 Jul 31, 2022
a small build system with a focus on speed

Ninja Ninja is a small build system with a focus on speed. https://ninja-build.org/ See the manual or doc/manual.asciidoc included in the distribution

null 8.8k Nov 25, 2022
CMake project for BL602 RISC-V processor

bl602_cmake_base CMake project for BL602 RISC-V processor How to build NOTE : This project uses a pre-compiled version of the Buffalo SDK (bl_iot_sdk)

null 9 Jan 6, 2022
A CMake toolchain file for iOS, macOS, watchOS & tvOS C/C++/Obj-C++ development

A CMake toolchain file for iOS, macOS, watchOS & tvOS C/C++/Obj-C++ development

Alexander Widerberg 1.4k Nov 29, 2022
NeoWorld is a resampler using the CMake build system

NeoWorld is a resampler using the CMake build system. It's designed for utsu, OpenUTAU, and UTAU.

null 4 Jun 24, 2022