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.
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.
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.
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.
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.CMAKE_CURRENT_SOURCE_DIR
instead ofCMAKE_SOURCE_DIR
, since ourCMAKE_SOURCE_DIR
isn't actually the mp4v2 folder. Added a similar change forCMAKE_BINARY_DIR
.target_include_directories
, instead of using the globalinclude_directories
, which affects all targets. We have many targets in our CMake build system that this would also affect.target_include_directories
, which allows our CMakeLists to simplytarget_link_libraries(target PRIVATE mp4v2)
and have CMake automatically add the correct include directories for mp4v2.