-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathCMakeLists.txt
58 lines (48 loc) · 1.46 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
cmake_minimum_required(VERSION 2.6)
PROJECT(map-icons)
AUX_SOURCE_DIRECTORY(${CMAKE_SOURCE_DIR} ALL_SRC)
message(STATUS "ALL_SRC: ${ALL_SRC}")
# Find Compile Command
FIND_PACKAGE(Perl REQUIRED)
FIND_PROGRAM(COMPILE_EXECUTABLE
NAMES compile_icons.pl
PATHS tools ${CMAKE_SOURCE_DIR}/tools
)
message(STATUS "Compile Command: ${COMPILE_EXECUTABLE}")
# ---------------------- Set Variables
IF (NOT APPLICATION_NAME)
MESSAGE(STATUS "${PROJECT_NAME} is used as APPLICATION_NAME")
SET(APPLICATION_NAME ${PROJECT_NAME})
ENDIF (NOT APPLICATION_NAME)
message(STATUS "CMAKE_INSTALL_PREFIX: ${CMAKE_INSTALL_PREFIX}")
SET(SHARE_INSTALL_PREFIX
"${CMAKE_INSTALL_PREFIX}/share"
CACHE PATH "Base directory for files which go to share/"
FORCE
)
SET(ICON_INSTALL_DIR
"${SHARE_INSTALL_PREFIX}/icons/map-icons"
CACHE PATH "The icon install dir (default data/map-icons/)"
FORCE
)
# ---------------------- README
configure_file(README ${CMAKE_CURRENT_BINARY_DIR}/README COPYONLY)
configure_file(README.icons ${CMAKE_CURRENT_BINARY_DIR}/README.icons COPYONLY)
install(
FILES
${CMAKE_CURRENT_BINARY_DIR}/README
DESTINATION
${ICON_INSTALL_DIR}
)
install(
FILES
${CMAKE_CURRENT_BINARY_DIR}/README.icons
DESTINATION
${ICON_INSTALL_DIR}
)
# ---------------------- compile-build
ADD_CUSTOM_TARGET(all
COMMAND ${PERL_EXECUTABLE} ${COMPILE_EXECUTABLE} --src-dir=${CMAKE_SOURCE_DIR} --dst-dir=${CMAKE_CURRENT_BINARY_DIR}
COMMENT "compile Map-Icons"
VERBATIM
)