mirror of
https://github.com/wjwwood/serial.git
synced 2026-01-22 11:44:53 +08:00
Added a Findserial.cmake file to be instaleld to help with finding the library. Also, added an uninstall target.
This commit is contained in:
parent
4eb3e51aa2
commit
dbb6dcca50
@ -47,4 +47,20 @@ INSTALL(TARGETS serial
|
||||
|
||||
INSTALL(FILES include/serial.h DESTINATION include)
|
||||
|
||||
# INSTALL(FILES ../Findserial.cmake DESTINATION ${CMAKE_ROOT}/Modules/)
|
||||
INSTALL(FILES Findserial.cmake DESTINATION ${CMAKE_ROOT}/Modules/)
|
||||
|
||||
ADD_CUSTOM_TARGET (uninstall @echo uninstall package)
|
||||
|
||||
IF (UNIX)
|
||||
ADD_CUSTOM_COMMAND(
|
||||
COMMENT "uninstall package"
|
||||
COMMAND xargs ARGS rm < install_manifest.txt
|
||||
|
||||
TARGET uninstall
|
||||
)
|
||||
ELSE(UNIX)
|
||||
ADD_CUSTOM_COMMAND(
|
||||
COMMENT "uninstall only implemented in unix"
|
||||
TARGET uninstall
|
||||
)
|
||||
ENDIF(UNIX)
|
||||
13
Findserial.cmake
Normal file
13
Findserial.cmake
Normal file
@ -0,0 +1,13 @@
|
||||
find_path(serial_INCLUDE_DIRS serial.h /usr/include "$ENV{NAMER_ROOT}")
|
||||
|
||||
find_library(serial_LIBRARIES serial /usr/lib "$ENV{NAMER_ROOT}")
|
||||
|
||||
set(serial_FOUND TRUE)
|
||||
|
||||
if (NOT serial_INCLUDE_DIRS)
|
||||
set(serial_FOUND FALSE)
|
||||
endif (NOT serial_INCLUDE_DIRS)
|
||||
|
||||
if (NOT serial_LIBRARIES)
|
||||
set(serial_FOUND FALSE)
|
||||
endif (NOT serial_LIBRARIES)
|
||||
Loading…
x
Reference in New Issue
Block a user