File tree Expand file tree Collapse file tree 1 file changed +11
-25
lines changed Expand file tree Collapse file tree 1 file changed +11
-25
lines changed Original file line number Diff line number Diff line change 1
1
cmake_minimum_required (VERSION 2.8.5)
2
2
project (patchrom C)
3
- set (CMAKE_C_FLAGS "-g" )
4
- set (CMAKE_RUNTIME_OUTPUT_DIRECTORY "bin/" )
5
- add_definitions ("-Wall" )
3
+ set (CMAKE_C_FLAGS "-g -Wall" )
6
4
7
- add_executable (patchrom
8
- main.c
9
- )
10
-
11
- install (PROGRAMS bin/patchrom
12
- DESTINATION bin)
13
-
14
- set (CMAKE_BUILD_TYPE Release)
5
+ add_executable (patchrom main.c)
15
6
16
- ADD_CUSTOM_TARGET (man ALL )
7
+ install (PROGRAMS ${CMAKE_BINARY_DIR} /patchrom DESTINATION bin )
17
8
18
- ADD_CUSTOM_COMMAND (
19
- TARGET man
20
- SOURCE ${CMAKE_CURRENT_SOURCE_DIR} /patchrom.1.txt
21
- COMMAND a2x --no -xmllint --doctype manpage --format manpage ${CMAKE_CURRENT_SOURCE_DIR} /patchrom.1.txt
22
- OUTPUTS ${CMAKE_CURRENT_BINARY_DIR} /patchrom.1
23
- )
9
+ if (NOT DEFINED CMAKE_BUILD_TYPE )
10
+ set (CMAKE_BUILD_TYPE Release CACHE STRING "Build type (Debug or Release)" FORCE)
11
+ endif ()
24
12
25
13
ADD_CUSTOM_COMMAND (
26
- TARGET man
27
- SOURCE man
28
- DEPENDS ${CMAKE_CURRENT_BINARY_DIR} /patchrom.1
14
+ TARGET patchrom
15
+ DEPENDS ${CMAKE_SOURCE_DIR} /patchrom.1.txt
16
+ COMMAND a2x --no -xmllint --doctype manpage --format manpage ${CMAKE_SOURCE_DIR} /patchrom.1.txt -D ${CMAKE_BINARY_DIR} -v
17
+ OUTPUTS ${CMAKE_BINARY_DIR} /patchrom.1
29
18
)
30
19
31
- INSTALL (
32
- FILES ${CMAKE_CURRENT_BINARY_DIR} /patchrom.1
33
- DESTINATION ${CMAKE_INSTALL_PREFIX} /man/man1
34
- )
20
+ INSTALL (FILES ${CMAKE_BINARY_DIR} /patchrom.1 DESTINATION man/man1)
You can’t perform that action at this time.
0 commit comments