Bind include directories to library build target

This commit is contained in:
elsid 2018-11-01 00:01:10 +03:00 committed by Jakob Botsch Nielsen
parent 658b32784f
commit 2b31aa9d79
5 changed files with 31 additions and 15 deletions

View File

@ -1,19 +1,21 @@
file(GLOB SOURCES Source/*.cpp)
include_directories(../Recast/Include)
include_directories(../Detour/Include)
include_directories(../DetourTileCache/Include)
include_directories(Include)
if (RECASTNAVIGATION_STATIC)
add_library(DebugUtils STATIC ${SOURCES})
else()
add_library(DebugUtils SHARED ${SOURCES})
endif()
set(DebugUtils_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Include")
target_include_directories(DebugUtils PUBLIC
"$<BUILD_INTERFACE:${DebugUtils_INCLUDE_DIR}>"
)
target_link_libraries(DebugUtils
Recast
Detour
DetourTileCache
)
set_target_properties(DebugUtils PROPERTIES

View File

@ -1,13 +1,17 @@
file(GLOB SOURCES Source/*.cpp)
include_directories(Include)
if(RECASTNAVIGATION_STATIC)
add_library(Detour STATIC ${SOURCES})
else()
add_library(Detour SHARED ${SOURCES})
endif()
set(Detour_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Include")
target_include_directories(Detour PUBLIC
"$<BUILD_INTERFACE:${Detour_INCLUDE_DIR}>"
)
set_target_properties(Detour PROPERTIES
SOVERSION ${SOVERSION}
VERSION ${VERSION}

View File

@ -1,14 +1,17 @@
file(GLOB SOURCES Source/*.cpp)
include_directories(../Detour/Include)
include_directories(Include)
if (RECASTNAVIGATION_STATIC)
add_library(DetourCrowd STATIC ${SOURCES})
else ()
add_library(DetourCrowd SHARED ${SOURCES})
endif ()
set(DetourCrowd_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Include")
target_include_directories(DetourCrowd PUBLIC
"$<BUILD_INTERFACE:${DetourCrowd_INCLUDE_DIR}>"
)
target_link_libraries(DetourCrowd
Detour
)

View File

@ -1,14 +1,17 @@
file(GLOB SOURCES Source/*.cpp)
include_directories(../Detour/Include)
include_directories(Include)
if (RECASTNAVIGATION_STATIC)
add_library(DetourTileCache STATIC ${SOURCES})
else ()
add_library(DetourTileCache SHARED ${SOURCES})
endif ()
set(DetourTileCache_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Include")
target_include_directories(DetourTileCache PUBLIC
"$<BUILD_INTERFACE:${DetourTileCache_INCLUDE_DIR}>"
)
target_link_libraries(DetourTileCache
Detour
)

View File

@ -1,13 +1,17 @@
file(GLOB SOURCES Source/*.cpp)
include_directories(Include)
if (RECASTNAVIGATION_STATIC)
add_library(Recast STATIC ${SOURCES})
else ()
add_library(Recast SHARED ${SOURCES})
endif ()
set(Recast_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Include")
target_include_directories(Recast PUBLIC
"$<BUILD_INTERFACE:${Recast_INCLUDE_DIR}>"
)
set_target_properties(Recast PROPERTIES
SOVERSION ${SOVERSION}
VERSION ${VERSION}