Skip to content

Instantly share code, notes, and snippets.

@Fraser999
Created September 5, 2014 00:17
Show Gist options
  • Save Fraser999/e877c25649e631f99ec8 to your computer and use it in GitHub Desktop.
Save Fraser999/e877c25649e631f99ec8 to your computer and use it in GitHub Desktop.
Demo of target_include_directories(... INTERFACE ...)
cmake_minimum_required(VERSION 3.0)
project(x)
file(WRITE "${CMAKE_CURRENT_SOURCE_DIR}/include/fonts.hpp"
"#include <iostream>\ninline int Print() { std::cout << \"Running.\\n\"; return 0; }\n")
file(WRITE "${CMAKE_CURRENT_SOURCE_DIR}/test/main.cpp"
"#include \"fonts.hpp\"\nint main() { return Print(); }\n")
add_library(Fonts INTERFACE)
target_include_directories(Fonts INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/include")
add_executable(FontsTest test/main.cpp)
target_link_libraries(FontsTest Fonts)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment