Created
September 5, 2014 00:17
-
-
Save Fraser999/e877c25649e631f99ec8 to your computer and use it in GitHub Desktop.
Demo of target_include_directories(... INTERFACE ...)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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