From c098fa3c182dae787d1bdd6836b6b8e3e788f07a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Val=C3=A8s?= <7755128+stvales@users.noreply.github.com> Date: Wed, 16 Sep 2020 15:25:46 +0200 Subject: [PATCH] Problem: using targets in CMakeLists.txt creates a corrupted xcode project with cmake (#4041) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * use sources instead of objects only when generating an xcode project Co-authored-by: Stéphane Valès Co-authored-by: stephane vales --- CMakeLists.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a7276f81..e08b388f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1382,8 +1382,13 @@ else() add_library(libzmq-static STATIC ${sources} ${public_headers} ${html-docs} ${readme-docs} ${zmq-pkgconfig} ${CMAKE_CURRENT_BINARY_DIR}/version.rc) else() - add_library(libzmq-static STATIC $ ${public_headers} ${html-docs} ${readme-docs} - ${zmq-pkgconfig} ${CMAKE_CURRENT_BINARY_DIR}/version.rc) + if (CMAKE_GENERATOR STREQUAL "Xcode") + add_library(libzmq-static STATIC ${sources} ${public_headers} ${html-docs} ${readme-docs} + ${zmq-pkgconfig} ${CMAKE_CURRENT_BINARY_DIR}/version.rc) + else() + add_library(libzmq-static STATIC $ ${public_headers} ${html-docs} ${readme-docs} + ${zmq-pkgconfig} ${CMAKE_CURRENT_BINARY_DIR}/version.rc) + endif() endif() if(CMAKE_SYSTEM_NAME MATCHES "QNX") target_link_libraries(libzmq-static m)