enzo1982 / mp4v2

Reviving the MP4v2 project...
https://mp4v2.org
Other
140 stars 52 forks source link

Some CMakeLists.txt cleanup #5

Closed dchengTSC closed 2 years ago

dchengTSC commented 2 years ago

This PR makes a few improvements to the CMakeLists.txt to make it work in our dev environment. We have mp4v2 as a submodule and use add_subdirectory(mp4v2) to make mp4v2 available to our CMake-based build system.

  1. Use CMAKE_CURRENT_SOURCE_DIR instead of CMAKE_SOURCE_DIR, since our CMAKE_SOURCE_DIR isn't actually the mp4v2 folder. Added a similar change for CMAKE_BINARY_DIR.
  2. Switched to target_include_directories, instead of using the global include_directories, which affects all targets. We have many targets in our CMake build system that this would also affect.
  3. Adding PUBLIC and PRIVATE to the target_include_directories, which allows our CMakeLists to simply target_link_libraries(target PRIVATE mp4v2) and have CMake automatically add the correct include directories for mp4v2.
enzo1982 commented 2 years ago

Looks good to me. Merged.

Thank you for this PR!