Skip to content

Commit

Permalink
Bind include directories to library build target
Browse files Browse the repository at this point in the history
  • Loading branch information
elsid authored and jakobbotsch committed Oct 31, 2018
1 parent 658b327 commit 2b31aa9
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 15 deletions.
12 changes: 7 additions & 5 deletions DebugUtils/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 6 additions & 2 deletions Detour/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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}
Expand Down
9 changes: 6 additions & 3 deletions DetourCrowd/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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
)
Expand Down
9 changes: 6 additions & 3 deletions DetourTileCache/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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
)
Expand Down
8 changes: 6 additions & 2 deletions Recast/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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}
Expand Down

0 comments on commit 2b31aa9

Please sign in to comment.