22 lines
753 B
CMake
22 lines
753 B
CMake
|
cmake_minimum_required(VERSION 3.0)
|
||
|
|
||
|
Set( DRIVER_FILE pulseblaster.ko )
|
||
|
#
|
||
|
#Set( DRIVER_BIN_FILE ../pulseblaster.ko )
|
||
|
Set( KERNEL_DIR "/lib/modules/${CMAKE_SYSTEM_VERSION}/build" )
|
||
|
Set( KBUILD_CMD ${CMAKE_MAKE_PROGRAM}
|
||
|
-C ${KERNEL_DIR}
|
||
|
M=${CMAKE_CURRENT_SOURCE_DIR} modules)
|
||
|
|
||
|
add_custom_command( OUTPUT ${DRIVER_FILE}
|
||
|
COMMAND ${KBUILD_CMD}
|
||
|
# COMMAND cp -f ${DRIVER_FILE} ${DRIVER_BIN_FILE}
|
||
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||
|
DEPENDS ${src} Kbuild VERBATIM )
|
||
|
|
||
|
add_custom_target ( driver DEPENDS ${DRIVER_FILE} )
|
||
|
|
||
|
#include_directories(..)
|
||
|
add_library(PB STATIC SpinCore-PulseBlaster.cpp)
|
||
|
add_library(PB_PROG STATIC PulseBlasterProgram.cpp)
|