alicevision / CCTag

Detection of CCTag markers made up of concentric circles.
https://cctag.readthedocs.io
Mozilla Public License 2.0
351 stars 87 forks source link

[cmake] Fix handling of BUILD_SHARED_LIBS option #201

Closed p12tic closed 1 year ago

p12tic commented 1 year ago

BUILD_SHARED_LIBS option is declared conditionally on whether BUILD_SHARED_LIBS is defined itself. This is problematic as multiple invocations of a build runner such as ninja will cause builds to use different options. The first build will run as if BUILD_SHARED_LIBS is not defined (i.e. OFF option), the second time cmake will notice that BUILD_SHARED_LIBS was defined after all and now run build with BUILD_SHARED_LIBS set to ON. This is confusing and error prone.

To fix the problem, a top-level BUILD_SHARED_LIBS option has been added and BUILD_SHARED_LIBS option in applications subdirectory was changed to become active only if the project is standalone.

p12tic commented 1 year ago

Build fails because it does not find tbb.

simogasp commented 1 year ago

I merged the other PR. I think you need to rebase with developing so that the CI is up-to-date with the new docker image used.

p12tic commented 1 year ago

@simogasp Rebased, thanks.