@@ -122,6 +122,9 @@ function( godotcpp_options )
122122 option ( GODOT_SYSTEM_HEADERS "Expose headers as SYSTEM."  OFF  )
123123 option ( GODOT_WARNING_AS_ERROR "Treat warnings as errors"  OFF  )
124124
125+  # Enable Testing 
126+  option ( GODOT_ENABLE_TESTING "Enable the godot-cpp-test target for integration testing"  OFF  )
127+ 
125128 # Run options commands on the following to populate cache for all 
126129 # platforms. This type of thing is typically done conditionally But as 
127130 # scons shows all options so shall we. 
@@ -231,17 +234,18 @@ function( godotcpp_generate )
231234 endif ()
232235
233236 ### Define our godot-cpp library targets 
234-  foreach  ( TARGET_NAME template_debug template_release editor )
237+  foreach  ( TARGET_ALIAS template_debug template_release editor )
238+  set ( TARGET_NAME "godot-cpp.${TARGET_ALIAS} "  )
235239
236240 # Useful genex snippits used in subsequent genex's 
237-  set ( IS_RELEASE "$<STREQUAL:${TARGET_NAME } ,template_release>" )
241+  set ( IS_RELEASE "$<STREQUAL:${TARGET_ALIAS } ,template_release>" )
238242 set ( IS_DEV "$<BOOL:${GODOT_DEV_BUILD} >" )
239-  set ( DEBUG_FEATURES "$<OR:$<STREQUAL:${TARGET_NAME } ,template_debug>,$<STREQUAL:${TARGET_NAME } ,editor>>"  )
243+  set ( DEBUG_FEATURES "$<OR:$<STREQUAL:${TARGET_ALIAS } ,template_debug>,$<STREQUAL:${TARGET_ALIAS } ,editor>>"  )
240244 set ( HOT_RELOAD "$<IF:${HOT_RELOAD-UNSET},$<NOT:${IS_RELEASE} >,$<BOOL:${GODOT_USE_HOT_RELOAD} >>"  )
241245
242246 # the godot-cpp.* library targets 
243247 add_library ( ${TARGET_NAME}  STATIC  ${EXCLUDE}  )
244-  add_library ( godot-cpp::${TARGET_NAME }  ALIAS ${TARGET_NAME}  )
248+  add_library ( godot-cpp::${TARGET_ALIAS }  ALIAS ${TARGET_NAME}  )
245249
246250 file ( GLOB_RECURSE GODOTCPP_SOURCES LIST_DIRECTORIES NO  CONFIGURE_DEPENDS src/*.cpp )
247251
@@ -268,27 +272,30 @@ function( godotcpp_generate )
268272 BUILD_RPATH_USE_ORIGIN ON 
269273
270274 PREFIX  lib
271-  OUTPUT_NAME  "${PROJECT_NAME} .${SYSTEM_NAME} .${TARGET_NAME } .${SYSTEM_ARCH} " 
275+  OUTPUT_NAME  "${PROJECT_NAME} .${SYSTEM_NAME} .${TARGET_ALIAS } .${SYSTEM_ARCH} " 
272276 ARCHIVE_OUTPUT_DIRECTORY  "$<1:${CMAKE_BINARY_DIR} /bin>" 
273277
274278 # Things that are handy to know for dependent targets 
275279 GODOT_PLATFORM "${SYSTEM_NAME} " 
276-  GODOT_TARGET "${TARGET_NAME } " 
280+  GODOT_TARGET "${TARGET_ALIAS } " 
277281 GODOT_ARCH "${SYSTEM_ARCH} " 
282+ 
283+  # Some IDE's respect this property to logically group targets 
284+  FOLDER  "godot-cpp" 
278285 )
279286
280287 if ( CMAKE_SYSTEM_NAME  STREQUAL  Android )
281-  android_generate(  ${TARGET_NAME}   )
288+  android_generate()
282289 elseif  ( CMAKE_SYSTEM_NAME  STREQUAL  iOS )
283-  ios_generate(  ${TARGET_NAME}   )
290+  ios_generate()
284291 elseif  ( CMAKE_SYSTEM_NAME  STREQUAL  Linux )
285-  linux_generate(  ${TARGET_NAME}   )
292+  linux_generate()
286293 elseif  ( CMAKE_SYSTEM_NAME  STREQUAL  Darwin )
287-  macos_generate(  ${TARGET_NAME}   )
294+  macos_generate()
288295 elseif  ( CMAKE_SYSTEM_NAME  STREQUAL  Emscripten )
289-  web_generate(  ${TARGET_NAME}   )
296+  web_generate()
290297 elseif  ( CMAKE_SYSTEM_NAME  STREQUAL  Windows )
291-  windows_generate(  ${TARGET_NAME}   )
298+  windows_generate()
292299 endif  ()
293300
294301 endforeach  ()
0 commit comments