aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2018-10-08 12:02:47 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-10-09 10:03:38 -0700
commit4012ac1c507d87effa458d3407ecba4266821d63 (patch)
tree476d960c9ed13519932d0294d28dad514b67c26b
parenta95e6589469a0998fba4d5248556a8c9337f22b0 (diff)
downloadsubsurface-4012ac1c507d87effa458d3407ecba4266821d63.tar.gz
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 <dirk@hohndel.org>
-rw-r--r--CMakeLists.txt6
1 files changed, 5 insertions, 1 deletions
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}