From 4012ac1c507d87effa458d3407ecba4266821d63 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Mon, 8 Oct 2018 12:02:47 -0700 Subject: build system: work around strange cmake issue On both Mac and Linux cmake 3.12 complained that there were "no sources given to target" for the Subsurface-mobile target, which made no sense at all (easy enough to add debug output to ensure there were, in fact, sources given in the call to add_executable()). But splitting this across two lines like this seems to make it work both for older and newer cmake versions. Signed-off-by: Dirk Hohndel --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 040531621..40578870a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -304,7 +304,11 @@ if(${SUBSURFACE_TARGET_EXECUTABLE} MATCHES "MobileExecutable") if(ANDROID) add_library(${SUBSURFACE_TARGET} SHARED ${SUBSURFACE_PKG} ${MOBILE_SRC} ${SUBSURFACE_RESOURCES} ${MOBILE_RESOURCES}) else() - add_executable(${SUBSURFACE_TARGET} MACOSX_BUNDLE WIN32 ${SUBSURFACE_PKG} ${MOBILE_SRC} ${SUBSURFACE_RESOURCES} ${MOBILE_RESOURCES}) + # the following is split across two commands since in cmake 3.12 this would result + # in a non-sensical "no sources given to target" error if done all as one set of + # arguments to the add_executable() call + add_executable(${SUBSURFACE_TARGET} ${SUBSURFACE_PKG} ${SUBSURFACE_RESOURCES}) + target_sources(${SUBSURFACE_TARGET} PUBLIC ${MOBILE_SRC} ${MOBILE_RESOURCES}) endif() target_link_libraries( ${SUBSURFACE_TARGET} -- cgit v1.2.3-70-g09d2