@@ -142,6 +142,9 @@ function( godotcpp_options )
142142 option ( GODOT_SYSTEM_HEADERS "Expose headers as SYSTEM." OFF )
143143 option ( GODOT_WARNING_AS_ERROR "Treat warnings as errors" OFF )
144144
145+ # Enable Testing
146+ option ( GODOT_ENABLE_TESTING "Enable the godot-cpp.test.<target> integration testing targets" OFF )
147+
145148 #[[ Target Platform Options ]]
146149 android_options()
147150 ios_options()
@@ -228,7 +231,7 @@ function( godotcpp_generate )
228231 ### Platform is derived from the toolchain target
229232 # See GeneratorExpressions PLATFORM_ID and CMAKE_SYSTEM_NAME
230233 set ( SYSTEM_NAME
231- $<$<PLATFORM_ID:Android>:android. ${ANDROID_ABI} >
234+ $<$<PLATFORM_ID:Android>:android>
232235 $<$<PLATFORM_ID:iOS>:ios>
233236 $<$<PLATFORM_ID:Linux>:linux>
234237 $<$<PLATFORM_ID:Darwin>:macos>
@@ -263,15 +266,16 @@ function( godotcpp_generate )
263266 set ( DEV_TAG "$<${IS_DEV_BUILD} :.dev>" )
264267
265268 ### Define our godot-cpp library targets
266- foreach ( TARGET_NAME template_debug template_release editor )
269+ foreach ( TARGET_ALIAS template_debug template_release editor )
270+ set ( TARGET_NAME "godot-cpp.${TARGET_ALIAS} " )
267271
268272 # Generator Expressions that rely on the target
269273 set ( DEBUG_FEATURES "$<NOT:$<STREQUAL:${TARGET_NAME} ,template_release>>" )
270274 set ( HOT_RELOAD "$<IF:${HOT_RELOAD-UNSET},${DEBUG_FEATURES} ,$<BOOL:${GODOT_USE_HOT_RELOAD} >>" )
271275
272276 # the godot-cpp.* library targets
273277 add_library ( ${TARGET_NAME} STATIC EXCLUDE_FROM_ALL )
274- add_library ( godot-cpp::${TARGET_NAME } ALIAS ${TARGET_NAME} )
278+ add_library ( godot-cpp::${TARGET_ALIAS } ALIAS ${TARGET_NAME} )
275279
276280 file ( GLOB_RECURSE GODOTCPP_SOURCES LIST_DIRECTORIES NO CONFIGURE_DEPENDS src/*.cpp )
277281
@@ -298,33 +302,36 @@ function( godotcpp_generate )
298302 BUILD_RPATH_USE_ORIGIN ON
299303
300304 PREFIX lib
301- OUTPUT_NAME "${PROJECT_NAME} .${SYSTEM_NAME} .${TARGET_NAME }${DEV_TAG} .${SYSTEM_ARCH} "
305+ OUTPUT_NAME "${PROJECT_NAME} .${SYSTEM_NAME} .${TARGET_ALIAS }${DEV_TAG} .${SYSTEM_ARCH} "
302306 ARCHIVE_OUTPUT_DIRECTORY "$<1:${CMAKE_BINARY_DIR} /bin>"
303307
304308 # Things that are handy to know for dependent targets
305309 GODOT_PLATFORM "${SYSTEM_NAME} "
306- GODOT_TARGET "${TARGET_NAME } "
310+ GODOT_TARGET "${TARGET_ALIAS } "
307311 GODOT_ARCH "${SYSTEM_ARCH} "
312+
313+ # Some IDE's respect this property to logically group targets
314+ FOLDER "godot-cpp"
308315 )
309316
310317 if ( CMAKE_SYSTEM_NAME STREQUAL Android )
311- android_generate( ${TARGET_NAME} )
318+ android_generate()
312319 elseif ( CMAKE_SYSTEM_NAME STREQUAL iOS )
313- ios_generate( ${TARGET_NAME} )
320+ ios_generate()
314321 elseif ( CMAKE_SYSTEM_NAME STREQUAL Linux )
315- linux_generate( ${TARGET_NAME} )
322+ linux_generate()
316323 elseif ( CMAKE_SYSTEM_NAME STREQUAL Darwin )
317- macos_generate( ${TARGET_NAME} )
324+ macos_generate()
318325 elseif ( CMAKE_SYSTEM_NAME STREQUAL Emscripten )
319- web_generate( ${TARGET_NAME} )
326+ web_generate()
320327 elseif ( CMAKE_SYSTEM_NAME STREQUAL Windows )
321- windows_generate( ${TARGET_NAME} )
328+ windows_generate()
322329 endif ()
323330
324331 endforeach ()
325332
326333 # Added for backwards compatibility with prior cmake solution so that builds dont immediately break
327334 # from a missing target.
328- add_library ( godot::cpp ALIAS template_debug )
335+ add_library ( godot::cpp ALIAS godot-cpp. template_debug )
329336
330337endfunction ()
0 commit comments