0

I am trying to add zmq as a third party library with FetchContent. However, I am uninterested on the warnings meant for devs. As I have taken the tag for a verified release, it should be working without any errors or warnings ideally.

I do not want to have -Wno-dev for my whole CMake project configuration- only for my 3rd party libraries. I have not found a way to do it inside the CMakeLists.txt.

My code for FetchContent is:

FetchContent_Declare(
  libzmq
  GIT_REPOSITORY https://github.com/zeromq/libzmq.git
  GIT_TAG        v4.3.4
  OVERRIDE_FIND_PACKAGE
)

FetchContent_MakeAvailable(libzmq)

I also didn't find a version that have no warnings since v4.2.2 I have tested with BUILD_COMMAND or CONFIGURE_COMMAND but I found no solution through reading the documentation of CMake nor FetchContent

starball
  • 20,030
  • 7
  • 43
  • 238
Kikadass
  • 314
  • 1
  • 3
  • 14

1 Answers1

0

I think you might be out of luck. From the FetchContent docs:

The <contentOptions> can be any of the download, update or patch options that the ExternalProject_Add() command understands.

Notice how configure and build options are not on that list (Ex. CMAKE_ARGS, CONFIGURE_COMMAND).

I looked through the list of CMake variables for one with "dev" and "warn" (usually when looking for directory-scoped overrides for these kinds of things, that's what you should do), and didn't find what you're looking for. There was CMAKE_WARN_DEPRECATED, but that's not the same (it's for the -Wno-deprecated/-Wdeprecated flags).

starball
  • 20,030
  • 7
  • 43
  • 238
  • I had already seen the CMAKE_WARN_DEPRECATED but that doesn't seem to affect the FetchContent either :S I also think I am out of luck with this one. Just hoping if anyone does have a solution ;) Thanks anw – Kikadass Apr 26 '23 at 05:40
  • Is there a better way to add 3rdparty libraries? gitsubmodules is another approach I was checking, as well as the ExternalProject_Add directly, but I thought FetchContent seemed to be the best. – Kikadass Apr 26 '23 at 05:41
  • 1
    @Kikadass it depends what kind of control you want / need. ExternalProject gives you more control than FetchContent at the cost of having to... well- take control. – starball Apr 26 '23 at 05:58