criptych / physfs-old

UNOFFICIAL Git mirror of PhysicsFS Mercurial repository. The official repository has also moved to GitHub; this one will no longer be updated. Official website:

Home Page:https://icculus.org/physfs/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CMake target_include_directories

Epixu opened this issue · comments

Hi, I had a problem linking against PhysFS while building it as an external project, along with all my stuff. Linking to a target in the same build tree did not provide the required interface headers along, so I added the following code to your main CMakeLists.txt

...
    add_library(physfs SHARED ${PHYSFS_SRCS})
#new code begins
    target_include_directories(physfs INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>) 
#new code ends
    set_target_properties(physfs PROPERTIES MACOSX_RPATH 1)
...

Now I can neatly just do:
target_link_libraries(MyLib PRIVATE physfs)
and bring all the required header locations along.

That might improve the build process a bit.

Wish you all the best!

This is a mirror of the official repository; I am not the original developer and can't do much to address issues here. Please see https://icculus.org/physfs/ for information on submitting patches to the official repository.

Some good news on that front: the official repository has recently moved to GitHub. Note that the commit hashes are different, so you will need to rebase your local branches.