Skip to content
This repository was archived by the owner on Apr 2, 2025. It is now read-only.
This repository was archived by the owner on Apr 2, 2025. It is now read-only.

target_include_directories(... SYSTEM ...) does not work with cotire #105

@jcelerier

Description

@jcelerier

Given this code:

cmake_minimum_required(VERSION 3.6)
project(foo)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}")

include(cotire)

add_library(foo a.cpp b.cpp c.cpp)
add_library(bar a.cpp b.cpp c.cpp)

target_include_directories(foo PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty)
target_include_directories(bar SYSTEM PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty)

set_property(TARGET foo PROPERTY COTIRE_CXX_PREFIX_HEADER_INIT "${CMAKE_CURRENT_SOURCE_DIR}/prefix.hpp")
set_property(TARGET bar PROPERTY COTIRE_CXX_PREFIX_HEADER_INIT "${CMAKE_CURRENT_SOURCE_DIR}/prefix.hpp")

cotire(foo)
cotire(bar)

foo can build, but bar cannot if the prefix header contains files that should be found through the include directories list.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions