summaryrefslogtreecommitdiff
path: root/driver/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'driver/CMakeLists.txt')
-rw-r--r--driver/CMakeLists.txt18
1 files changed, 18 insertions, 0 deletions
diff --git a/driver/CMakeLists.txt b/driver/CMakeLists.txt
new file mode 100644
index 0000000..e9d511a
--- /dev/null
+++ b/driver/CMakeLists.txt
@@ -0,0 +1,18 @@
+if (NOT DEFINED KDIR)
+ set(KDIR "/usr/src/linux")
+endif (NOT DEFINED KDIR)
+
+ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/driver/pptp.ko
+ COMMAND mkdir ${CMAKE_CURRENT_BINARY_DIR}/driver &> /dev/null
+ COMMAND ln -sf ${CMAKE_CURRENT_SOURCE_DIR}/* ${CMAKE_CURRENT_BINARY_DIR}/driver
+ COMMAND make -C ${KDIR} M=${CMAKE_CURRENT_BINARY_DIR}/driver modules
+# COMMAND cp ${CMAKE_CURRENT_SOURCE_DIR}/pptp.ko ${CMAKE_CURRENT_BINARY_DIR}/pptp.ko
+# COMMAND make -C ${KDIR} M=${CMAKE_CURRENT_SOURCE_DIR} clean
+)
+
+ADD_CUSTOM_TARGET(pptp_drv ALL
+ DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/driver/pptp.ko
+)
+
+INSTALL(CODE "EXECUTE_PROCESS(COMMAND make -C ${KDIR} M=${CMAKE_CURRENT_BINARY_DIR}/driver modules_install)")
+