CMake: Populate list of required include directories for library targets

PUBLIC items will populate the INTERFACE_INCLUDE_DIRECTORIES property of
<target>. This property is a list of public include directories
requirements for a library.

Targets may populate this property to publish the include directories
required to compile against the headers for the target.
This commit is contained in:
Riyyi
2022-09-28 14:05:02 +02:00
parent 6972128ad2
commit 26cd35d679
3 changed files with 5 additions and 9 deletions
+3 -5
View File
@@ -13,9 +13,7 @@ file(GLOB_RECURSE GAME_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp")
add_executable(${GAME} ${GAME_SOURCES})
target_include_directories(${GAME} PRIVATE
"src"
"${CMAKE_SOURCE_DIR}/src"
"${CMAKE_SOURCE_DIR}/vendor/ruc/src")
"src")
target_link_libraries(${GAME} ${ENGINE})
target_precompile_headers(${GAME} REUSE_FROM ${ENGINE})
@@ -25,5 +23,5 @@ target_precompile_headers(${GAME} REUSE_FROM ${ENGINE})
# Add 'make run' target
add_custom_target(run
COMMAND ${GAME}
WORKING_DIRECTORY ".."
)
WORKING_DIRECTORY "..")
add_dependencies(run ${ENGINE})