boostorg / gil

Boost.GIL - Generic Image Library | Requires C++14 since Boost 1.80
https://boostorg.github.io/gil
Boost Software License 1.0
178 stars 164 forks source link

CMake: Dependency on Boost::filesystem is wrong #742

Open Neumann-A opened 5 months ago

Neumann-A commented 5 months ago

The CMake files for boost-gil declare a dependency on Boost::filesystem. However, that dependency is guarded by BOOST_GIL_IO_USE_BOOST_FILESYSTEM in the headers and there is no code in the CMake files which ever sets that preprocessor define. As such the dependency on Boost::filesystem is wrong or there needs to be a cmake option adding that dependency and the preprocessor define.

sdebionne commented 5 months ago

Thank you for reporting this. Indeed we could add a CMake option (which default value would depend on the cpp standard) to remove a dependency that is not really needed in C++17 (unless BOOST_GIL_IO_USE_BOOST_FILESYSTEM is defined).

simmplecoder commented 5 months ago

@Neumann-A I will try to get a commit in this week, next week it should be implemented. Do you have some easy test case I could throw into the commit or should I try to write my own?

Neumann-A commented 5 months ago

No I don't have a test case.

simmplecoder commented 4 months ago

Sorry last days at work were very hectic. I have created a draft PR https://github.com/boostorg/gil/pull/743, I am a bit unsure how to create a test for it yet, but after I figure it out I will request a review. If you would like to test it out, you can pull my branch and set the following:

-DBOOST_GIL_USE_BOOST_FILESYSTEM=OFF
-DCMAKE_CXX_STANDARD=17 

C++ standard can be anything equal or higher to 17.

mloskot commented 4 months ago

@simmplecoder I wouldn't worry about testing this with the already cases-overloaded CI. It would be great if one two people could try it out and confirm though.