I'm developing a module under Linux and I would to use CMake for
generate the makefile allowing other to compile the module correcly. I
already use CMake for compile applications and it work very well but I
can not find a right configuration for make a makefile working on
module compilation.What I would to obtain using CMake is the
"standard" makefile for compile a module like the example following:
KDIR:=/lib/modules/$(shell uname -r)/build
PWD :=$(shell pwd)
obj-m:=hello.o
default:
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
clean:
$(RM) .*.cmd *.o *.ko -r .tmp*
Someone know how to write into CMakeLists.txt file for obtain a
makefile like above?
Thank you