alecthomas / entityx

EntityX - A fast, type-safe C++ Entity-Component system
MIT License
2.22k stars 295 forks source link

Set build_interface directories for integrated builds #156

Closed asmw closed 8 years ago

asmw commented 8 years ago

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.

alecthomas commented 8 years ago

CMAKE MAGIC!

davidnorthetal commented 6 years ago

Well that still doesn't include the headers file from the entityx subproject no? - So just doing

add_subdirectories(3rdparty/entityx)
target_link_libraries(my_target entityx[_shared])

shouldn't AFAIS, and on my end doesn't, include_directories entityx.

../src/main.cc:28:10: fatal error: entityx/entityx.h: No such file or directory
 #include <entityx/entityx.h>

so there's something missing here.

davidnorthetal commented 6 years ago

Actually nvm. it took me a while to realize that entityx[_shared] is actually not valid cmake-syntax and that asmw just intended to say: entityx or entityx_shared.

asmw commented 6 years ago

@davidnorthetal true. I'll try to make snippets copy-pastable (or obviously non-working) the next time :)