@@ -11,8 +11,15 @@ function(of_addon ADDON_NAME)
1111 of_check_of_root_path ()
1212 of_set_global_os_vars ()
1313
14+ if ("${ADDON_NAME} " STREQUAL "" )
15+ message (WARNING "of_addon name is EMPTY!! Not adding." )
16+ return ()
17+ endif ()
18+
1419 set (ADDON_ROOT "${OF_ROOT_DIRECTORY} /addons/${ADDON_NAME} " )
1520
21+
22+
1623 #TODO: If the addon does not exist, maybe we could use fetch content?
1724 if (EXISTS "${ADDON_ROOT} " )
1825
@@ -40,6 +47,13 @@ function(of_addon ADDON_NAME)
4047 list (APPEND PARSED_INCLUDES_ABS "${ADDON_ROOT} /src" )
4148 endif ()
4249
50+ # account for addons that aren't structured according to the libs they are meant to include
51+ # ie. ofxXmlSettings and ofxVectorGraphics
52+ if ( EXISTS "${ADDON_ROOT} /libs" )
53+ # of_get_subdirs_recursive("${ADDON_ROOT}/src" PARSED_INCLUDES_ABS)
54+ list (APPEND PARSED_INCLUDES_ABS "${ADDON_ROOT} /libs" )
55+ endif ()
56+
4357 # message(VERBOSE "of_addon ${ADDON_NAME}: Going to parse addon includes via directories")
4458 # of_get_all_header_files(${ADDON_ROOT} PARSED_ADDON_HEADERS )
4559
@@ -79,6 +93,7 @@ function(of_addon ADDON_NAME)
7993 file (GLOB TMP_ADDON_LIBS_LIB_DIRECTORIES CONFIGURE_DEPENDS "${lib_dir} /*" )
8094 list (TRANSFORM TMP_ADDON_LIBS_LIB_DIRECTORIES REPLACE "\\\\ " "/" ) # CMake 3.16 OK
8195 # don't consider listing directories named lib or license
96+ # it would probably be fine, but adds so many extra paths to a project, ie. Xcode
8297 list (FILTER TMP_ADDON_LIBS_LIB_DIRECTORIES EXCLUDE REGEX "(^|/)(lib|license)/?$" )
8398 foreach (lib_lib_dir ${TMP_ADDON_LIBS_LIB_DIRECTORIES} )
8499 if (IS_DIRECTORY "${lib_lib_dir} " )
0 commit comments