Building out-of-tree modules with dependencies

Hi,
I want to make more changes in take-off controller for use with auogyro. Because I assume it will take a long time, I want to developing it as external (out-of-tree) module. (Sure, then we’ll do PR into upstream).

However, I have some problem with out-of-tree modules and with cmake.

I copied fw_pos_control_l1 into external folder. <external>/src/modules. Then I added EXTERNAL statement into CMake in the controller folder. And added it to CMake of external module.

Then I removed this source from board (sitl) CMake file.

On: sudo make px4_sitl none_shell EXTERNAL_MODULES_LOCATION=../PX4_assets/

Now, I getting this error:
That targets from external module are not exists.

...
...
-- External modules: /home/roman/repos/tf/PX4_assets
CMake Error at /home/roman/repos/tf/PX4Firmware/cmake/px4_add_module.cmake:205 (get_target_property):
  get_target_property() called with non-existent target "l1".
Call Stack (most recent call first):
  /home/roman/repos/tf/PX4_assets/src/modules/fw_pos_control_l1/CMakeLists.txt:39 (px4_add_module)


CMake Error at /home/roman/repos/tf/PX4Firmware/cmake/px4_add_module.cmake:206 (if):
  if given arguments:

    "STREQUAL" "STATIC_LIBRARY"

  Unknown arguments specified
Call Stack (most recent call first):
  /home/roman/repos/tf/PX4_assets/src/modules/fw_pos_control_l1/CMakeLists.txt:39 (px4_add_module)


-- Configuring incomplete, errors occurred!
See also "/home/roman/repos/tf/PX4Firmware/build/px4_sitl_default/CMakeFiles/CMakeOutput.log".
Error: /home/roman/repos/tf/PX4Firmware/build/px4_sitl_default is not a directory
Makefile:224: recipe for target 'px4_sitl' failed
make: *** [px4_sitl] Error 1

My external module cmake:

include(px4_add_library)

add_subdirectory(launchdetection)
add_subdirectory(runway_takeoff)

px4_add_module(
	MODULE modules__fw_pos_control_l1
	MAIN fw_pos_control_l1
	SRCS
		FixedwingPositionControl.cpp
		FixedwingPositionControl.hpp
	DEPENDS
		l1
		launchdetection
		landing_slope
		runway_takeoff
	    tecs
    EXTERNAL
	)

Please any ideas what to do with it?

I know an out-of-tree documentation page, this How to use external module - #9 by notoriou5 thread and other.

My last question if it is possible to have multiple out-of-tree folders?

Thank you very much!