gil icon indicating copy to clipboard operation
gil copied to clipboard

CMake: Dependency on Boost::filesystem is wrong

Open Neumann-A opened this issue 1 year ago • 5 comments

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.

Neumann-A avatar Mar 10 '24 14:03 Neumann-A

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).

sdebionne avatar Mar 14 '24 07:03 sdebionne

@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?

simmplecoder avatar Apr 02 '24 21:04 simmplecoder

No I don't have a test case.

Neumann-A avatar Apr 02 '24 21:04 Neumann-A

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.

simmplecoder avatar Apr 12 '24 21:04 simmplecoder

@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.

mloskot avatar Apr 16 '24 07:04 mloskot