forked from rbmj/wpilib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
50 lines (45 loc) · 1.35 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
cmake_minimum_required(VERSION 2.8)
project(WPILib)
set(CMAKE_CXX_FLAGS "-g -Og -std=c++11 -Wall")
set(HEADER_DIR include/WPILib)
set(LIB_NAME wpilib)
set(LIB_DIR lib)
set(VERSION "2013.4")
configure_file(WPILibConfig.cmake.in ${PROJECT_BINARY_DIR}/WPILibConfig.cmake @ONLY)
configure_file(WPILibConfigVersion.cmake.in ${PROJECT_BINARY_DIR}/WPILibConfigVersion.cmake @ONLY)
file(GLOB_RECURSE WPI_SOURCES *.cpp)
set(WPI_INCLUDES ${CMAKE_SOURCE_DIR})
set(WPI_LIBS "")
add_library(${LIB_NAME} ${WPI_SOURCES})
include_directories(${WPI_INCLUDES})
target_link_libraries(${LIB_NAME} ${WPI_LIBS})
install(TARGETS ${LIB_NAME}
LIBRARY DESTINATION ${LIB_DIR}
ARCHIVE DESTINATION ${LIB_DIR}
RUNTIME DESTINATION bin
)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/
DESTINATION ${HEADER_DIR}
FILES_MATCHING
PATTERN *.h
PATTERN ".git" EXCLUDE
PATTERN ".settings" EXCLUDE
#prevent infinite recursion if DESTDIR is subdir of SRCDIR
PATTERN "${HEADER_DIR}" EXCLUDE
PATTERN share/WPILib/src EXCLUDE
)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/
DESTINATION share/WPILib/src
FILES_MATCHING
PATTERN *.h
PATTERN *.cpp
PATTERN ".git" EXCLUDE
PATTERN ".settings" EXCLUDE
PATTERN "${HEADER_DIR}" EXCLUDE
PATTERN share/WPILib/src EXCLUDE
)
install(FILES
"${PROJECT_BINARY_DIR}/WPILibConfig.cmake"
"${PROJECT_BINARY_DIR}/WPILibConfigVersion.cmake"
DESTINATION "share/WPILib/cmake"
)