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) file(GLOB SOURCES Source/*.cpp)
include_directories(../Recast/Include)
include_directories(../Detour/Include)
include_directories(../DetourTileCache/Include)
include_directories(Include)
if (RECASTNAVIGATION_STATIC) if (RECASTNAVIGATION_STATIC)
add_library(DebugUtils STATIC ${SOURCES}) add_library(DebugUtils STATIC ${SOURCES})
else() else()
add_library(DebugUtils SHARED ${SOURCES}) add_library(DebugUtils SHARED ${SOURCES})
endif() endif()
set(DebugUtils_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Include")
target_include_directories(DebugUtils PUBLIC
"$<BUILD_INTERFACE:${DebugUtils_INCLUDE_DIR}>"
)
target_link_libraries(DebugUtils target_link_libraries(DebugUtils
Recast Recast
Detour Detour
DetourTileCache
) )
set_target_properties(DebugUtils PROPERTIES set_target_properties(DebugUtils PROPERTIES

View File

@ -1,13 +1,17 @@
file(GLOB SOURCES Source/*.cpp) file(GLOB SOURCES Source/*.cpp)
include_directories(Include)
if(RECASTNAVIGATION_STATIC) if(RECASTNAVIGATION_STATIC)
add_library(Detour STATIC ${SOURCES}) add_library(Detour STATIC ${SOURCES})
else() else()
add_library(Detour SHARED ${SOURCES}) add_library(Detour SHARED ${SOURCES})
endif() 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 set_target_properties(Detour PROPERTIES
SOVERSION ${SOVERSION} SOVERSION ${SOVERSION}
VERSION ${VERSION} VERSION ${VERSION}

View File

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

View File

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

View File

@ -1,13 +1,17 @@
file(GLOB SOURCES Source/*.cpp) file(GLOB SOURCES Source/*.cpp)
include_directories(Include)
if (RECASTNAVIGATION_STATIC) if (RECASTNAVIGATION_STATIC)
add_library(Recast STATIC ${SOURCES}) add_library(Recast STATIC ${SOURCES})
else () else ()
add_library(Recast SHARED ${SOURCES}) add_library(Recast SHARED ${SOURCES})
endif () 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 set_target_properties(Recast PROPERTIES
SOVERSION ${SOVERSION} SOVERSION ${SOVERSION}
VERSION ${VERSION} VERSION ${VERSION}