Build external module with external library (Unknown CMake command "px4_add_library".)

I am trying to build a simple external module (px4_test) with a simple external library (transformations). I think this should be a simple mistake, but i am unable to figure it out.

-Testing
 |- src
   |- CMakeLists.txt
   |- src
     |- modules
       |- px4_test
       |- transformations

The CMakeLists.txt in src contains:

add_subdirectory(modules/transformations)
 
 set(config_module_list_external
    modules/px4_test
    PARENT_SCOPE
    )

The CMakeLists.txt in px4_test contains:

px4_add_module(
	MODULE examples__px4_simple
	MAIN px4_simple
	SRCS
		px4_simple.cpp
	DEPENDS
	#	transformations
	EXTERNAL
	)

The CMakeLists.txt in transformations contains:

px4_add_library(transformations
  transformation.cpp
)

I am building with make px4_sitl EXTERNAL_MODULES_LOCATION=~/Testing/

UPDATE 1:
I think i narrowed the problem down. No libraries are built (.a files) even when i put a new library file.
Where do i have to add the new library in cmake so that it gets built? (in cmake?)

UPDATE 2:
so for the libraries to be built, DEPENDS has to be filled with the lib in the module, however since i have an external module, the lib is not found via DEPENDS and says

get_target_property() called with non-existent target

Do i need to specify a relative path or add subdirectory with relative path?

UPDATE 3: I think i found it: I have to include

include(px4_add_library)
add_subdirectory(modules/transformations)

in the upmost CMakeLists.txt

and then

	DEPENDS
	    transformations
	EXTERNAL

works and compiles to external_modules