blob: e9d511a96ab47e7cccf10862a1bfb2c307feb6fd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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)")
|