-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
76 lines (65 loc) · 2.56 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
cmake_minimum_required (VERSION 3.22.1)
set (HAVE_CMAKE true)
project (vramsteg)
set (PROJECT_VERSION "1.0.1")
SET (VRAMSTEG_MAN1DIR share/man/man1 CACHE STRING "Installation directory for man pages, section 1")
SET (VRAMSTEG_DOCDIR share/doc/vramsteg CACHE STRING "Installation directory for doc files")
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set (LINUX true)
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set (DARWIN true)
elseif (${CMAKE_SYSTEM_NAME} MATCHES "kFreeBSD")
set (KFREEBSD true)
elseif (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
set (FREEBSD true)
elseif (${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD")
set (OPENBSD true)
elseif (${CMAKE_SYSTEM_NAME} MATCHES "NetBSD")
set (NETBSD true)
elseif (${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
set (SOLARIS true)
elseif (${CMAKE_SYSTEM_NAME} STREQUAL "GNU")
set (GNUHURD true)
else (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set (UNKNOWN true)
endif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
message ("-- Looking for SHA1 references")
if (EXISTS ${CMAKE_SOURCE_DIR}/.git/index)
set (HAVE_COMMIT true)
execute_process (COMMAND git log -1 --pretty=format:%h
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE COMMIT)
configure_file ( ${CMAKE_SOURCE_DIR}/commit.h.in
${CMAKE_SOURCE_DIR}/commit.h)
message ("-- Found SHA1 reference: ${COMMIT}")
endif (EXISTS ${CMAKE_SOURCE_DIR}/.git/index)
set (PACKAGE "${PROJECT_NAME}")
set (VERSION "${PROJECT_VERSION}")
set (PACKAGE_BUGREPORT "[email protected]")
set (PACKAGE_NAME "${PACKAGE}")
set (PACKAGE_TARNAME "${PACKAGE}")
set (PACKAGE_VERSION "${VERSION}")
set (PACKAGE_STRING "${PACKAGE} ${VERSION}")
message ("-- Configuring cmake.h")
configure_file (
${CMAKE_SOURCE_DIR}/cmake.h.in
${CMAKE_SOURCE_DIR}/cmake.h)
add_subdirectory (src)
add_subdirectory (doc)
add_subdirectory (examples)
if (EXISTS test)
add_subdirectory (test EXCLUDE_FROM_ALL)
endif (EXISTS test)
set (doc_FILES NEWS ChangeLog README INSTALL AUTHORS COPYING)
foreach (doc_FILE ${doc_FILES})
install (FILES ${doc_FILE} DESTINATION ${VRAMSTEG_DOCDIR})
endforeach (doc_FILE)
# ---
set (CPACK_SOURCE_GENERATOR "TGZ")
set (CPACK_SOURCE_PACKAGE_FILE_NAME ${PACKAGE_NAME}-${PACKAGE_VERSION})
set (CPACK_SOURCE_IGNORE_FILES "CMakeCache" "CMakeFiles" "CPackConfig" "CPackSourceConfig"
"_CPack_Packages" "cmake_install" "install_manifest"
"Makefile$" "test" "demo"
"src/vramsteg$"
"/\\\\.gitignore" "/\\\\.git/" "swp$")
include (CPack)