diff options
author | Sumedha Widyadharma <s-fairphone@wdya.de> | 2016-10-23 15:56:18 +0200 |
---|---|---|
committer | Sumedha Widyadharma <s-fairphone@wdya.de> | 2016-10-23 15:56:18 +0200 |
commit | f58f553e9804fa9422de79f5e1607d8e366de7be (patch) | |
tree | 6afe702d9f05b0cb3ac0071a550decc1ed84af25 | |
parent | 017e5dc5510b6a462f1f6df05137fc43d4be61be (diff) |
Set build_interface directories for integrated builds
This makes it very easy to integrate entityx into a build.
I.e:
add_subdirectories(3rdparty/entityx)
target_link_libraries(my_target entityx[_shared])
This makes #include entityx/entityx.h just work.
-rw-r--r-- | CMakeLists.txt | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 116b137..ba38a87 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -143,11 +143,15 @@ if (ENTITYX_BUILD_SHARED) VERSION ${ENTITYX_VERSION} SOVERSION ${ENTITYX_MAJOR_VERSION} FOLDER entityx) - set(install_libs entityx_shared) + set(install_libs entityx_shared) + set_property(TARGET entityx_shared APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>) else() add_library(entityx STATIC ${sources}) set_target_properties(entityx PROPERTIES DEBUG_POSTFIX -d FOLDER entityx) set(install_libs entityx) + set_property(TARGET entityx APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>) endif (ENTITYX_BUILD_SHARED) if (ENTITYX_BUILD_TESTING) |