<div dir="ltr">Hi,<div><br></div><div>I am trying to work with FetchContent in cmake 3.11.</div><div>I want to use the jsoncpp library and use FetchContent to get and build it.</div><div><br></div><div>I also want to configure the jsoncpp build with some cmake arguments and I can't seem to get that right.</div><div><br></div><div>My CMakeLists.txt looks like this:</div><div>**************************************************************</div><div><div>cmake_minimum_required(VERSION 3.11)</div><div>project(Foo)</div><div><br></div><div>include(FetchContent)</div><div><br></div><div>FetchContent_Declare(jsoncpp</div><div>  <span style="white-space:pre">               </span>URL "c:/project/jsoncpp-src"</div><div>   <span style="white-space:pre">           </span>CMAKE_ARGS "-DJSONCPP_WITH_CMAKE_PACKAGE=ON;-DJSONCPP_WITH_PKGCONFIG_SUPPORT=OFF"</div><div>)</div><div><br></div><div>FetchContent_Populate(jsoncpp)</div><div><br></div><div>add_executable(Foo main.cpp)</div></div><div>**************************************************************</div><div><br></div><div><br></div><div>FetchContent downloads and configures the jsoncpp as an ExternalProject.</div><div>That part looks like this:</div><div>*********************************************</div><div><div>ExternalProject_Add(jsoncpp-populate</div><div>                     "UPDATE_DISCONNECTED" "False" "URL" "c:/project/jsoncpp-src" "CMAKE_ARGS" "-DJSONCPP_WITH_CMAKE_PACKAGE=ON" "-DJSONCPP_WITH_PKGCONFIG_SUPPORT=OFF"</div><div>                    SOURCE_DIR          "C:/temp/foo/build/_deps/jsoncpp-src"</div><div>                    BINARY_DIR          "C:/temp/foo/build/_deps/jsoncpp-build"</div><div>                    CONFIGURE_COMMAND   ""</div><div>                    BUILD_COMMAND       ""</div><div>                    INSTALL_COMMAND     ""</div><div>                    TEST_COMMAND        ""</div><div>)</div></div><div>*******************************************************</div><div><br></div><div>For the external project - the CMAKE_ARGS are no longer a list, but individual arguments.</div><div><br></div><div>I have tried different things, like escaping the ; with \\; and stuff like that, and I can't get it to work.</div><div>I'm thinking there is something obvious I am missing?</div><div><br></div><div><div><div dir="ltr" class="gmail_signature"><div class="gmail_signature"><div dir="ltr"><div>Best regards,<br>Mads</div></div></div></div></div></div></div>