Skip to content

Commit c94c11f

Browse files
authored
Merge pull request #3 from pixelherodev/master
Update CMakeLists.txt
2 parents 60031e1 + 65c9cd9 commit c94c11f

File tree

1 file changed

+11
-25
lines changed

1 file changed

+11
-25
lines changed

CMakeLists.txt

Lines changed: 11 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,20 @@
11
cmake_minimum_required(VERSION 2.8.5)
22
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")
64

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)
156

16-
ADD_CUSTOM_TARGET(man ALL)
7+
install(PROGRAMS ${CMAKE_BINARY_DIR}/patchrom DESTINATION bin)
178

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()
2412

2513
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
2918
)
3019

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)

0 commit comments

Comments
 (0)