-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
42 lines (31 loc) · 1.39 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
cmake_minimum_required(VERSION 3.5)
#cmake_minimum_required(VERSION 2.6)
#set(CMAKE_C_COMPILER "gcc-4.2")
#set(CMAKE_CXX_COMPILER "/usr/bin/g++-4.2")
project(list-apt-installs)
# binary
add_executable(list-apt-installs source/list-apt-installs.c)
install(TARGETS list-apt-installs DESTINATION bin)
# alias links
macro(install_symlink filepath sympath)
install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ${filepath} ${sympath})")
install(CODE "message(\"-- Created symlink: ${sympath} -> ${filepath}\")")
endmacro(install_symlink)
install_symlink(${CMAKE_PROJECT_NAME} lai)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/lai DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
# manual
install(FILES man/list-apt-installs.1 DESTINATION /usr/local/share/man/man1)
# opt files
install(FILES README.md DESTINATION /usr/share/doc/${CMAKE_PROJECT_NAME})
install(FILES COPYING DESTINATION /usr/share/doc/${CMAKE_PROJECT_NAME})
install(FILES LICENSE DESTINATION /usr/share/doc/${CMAKE_PROJECT_NAME})
install(FILES INSTALL DESTINATION /usr/share/doc/${CMAKE_PROJECT_NAME})
# uninstall target
if(NOT TARGET uninstall)
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY)
add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
endif()