![]() |
CMake and very platform specific Makefiles
Not sure if this goes in General Programming as it has implications across platforms or in Linux as my problem is currently about that.
I'm working on a project that uses CMake for building. There's a directory of the source tree that includes drivers for the various target platforms. I've figured out how to make a CMakeLists.txt that can generate a Makefile to use the Kbuild system for the Linux drivers, but that's not what I would rather do. The source directory containing the Linux kernel modules has a Makefile that uses Kbuild. The build process only gets to this directory if the platform is Linux. So, if the build process reaches that point, I know that the Makefile is compatible enough with the system. Is there a way that, once I get down to this directory, I can use the module's own Makefile instead of having CMake generate one for me? |
there is a execute_process (in older versions it was exec_program) command for cmake
maybe this is what you are looking for |
I finally did decide to have cmake generate the Makefile instead of using the existing one. If anyone is curious, this is how I solved it:
CMakeLists.txt in the module source directory. Code:
SET( MODULE_NAMECode:
obj-m := ${MODULE_NAME}.o |
| All times are GMT -5. The time now is 01:09 AM. |