-
-
Notifications
You must be signed in to change notification settings - Fork 431
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add support to build with CMake (a meta build system)
use like this: mkdir -p build cd build cmake .. # or #cmake -DCMAKE_INSTALL_PREFIX=/usr .. make
- Loading branch information
Showing
4 changed files
with
69 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/build | ||
config.h | ||
Makefile | ||
stamp-h | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# CMake build system for CMatrix | ||
|
||
cmake_minimum_required(VERSION 2.8) | ||
|
||
project(CMatrix LANGUAGES C) | ||
set(VERSION "1.2") | ||
|
||
# These are relative to CMAKE_INSTALL_PREFIX | ||
# which by default is "/usr/local" | ||
set(CONSOLE_FONTS_DIRS "share/consolefonts" "lib/kbd/consolefonts") | ||
set(X_FONTS_DIRS "lib/X11/fonts/misc" "X11R6/lib/X11/fonts/misc" "share/fonts/X11/misc") | ||
|
||
set(MKFONTDIR "/usr/bin/mkfontdir") | ||
|
||
add_definitions(-DEXCLUDE_CONFIG_H) | ||
add_definitions(-DVERSION="${VERSION}") | ||
add_definitions(-DHAVE_SYS_IOCTL_H) | ||
add_definitions(-DHAVE_UNISTD_H) | ||
add_definitions(-DHAVE_TERMIOS_H) | ||
add_definitions(-DHAVE_TERMIO_H) | ||
|
||
Set(CURSES_NEED_NCURSES TRUE) | ||
find_package(Curses) | ||
include_directories(${CURSES_INCLUDE_DIR}) | ||
add_definitions(-DHAVE_NCURSES_H) | ||
|
||
add_executable(cmatrix cmatrix.c) | ||
|
||
target_link_libraries(cmatrix ${CURSES_LIBRARIES}) | ||
|
||
install(TARGETS cmatrix DESTINATION bin) | ||
|
||
if (UNIX) | ||
foreach (CONSOLE_FONTS_DIR ${CONSOLE_FONTS_DIRS}) | ||
if (IS_DIRECTORY "${CMAKE_INSTALL_PREFIX}/${CONSOLE_FONTS_DIR}") | ||
message(STATUS "Installing matrix console fonts to ${CMAKE_INSTALL_PREFIX}/${CONSOLE_FONTS_DIR}") | ||
install(FILES | ||
"${CMAKE_SOURCE_DIR}/matrix.fnt" | ||
"${CMAKE_SOURCE_DIR}/matrix.psf.gz" | ||
DESTINATION "${CONSOLE_FONTS_DIR}") | ||
endif () | ||
endforeach () | ||
foreach (X_FONTS_DIR ${X_FONTS_DIRS}) | ||
if (IS_DIRECTORY "${CMAKE_INSTALL_PREFIX}/${X_FONTS_DIR}") | ||
message(STATUS "Installing matrix X window fonts to ${CMAKE_INSTALL_PREFIX}/${X_FONTS_DIR}") | ||
install(FILES | ||
"${CMAKE_SOURCE_DIR}/mtx.pcf" | ||
DESTINATION "${X_FONTS_DIR}") | ||
install(CODE | ||
"message(STATUS \"Running mkfontdir ${CMAKE_INSTALL_PREFIX}/${X_FONTS_DIR} ...\")") | ||
install(CODE | ||
"execute_process(COMMAND \"${MKFONTDIR}\" \"${CMAKE_INSTALL_PREFIX}/${X_FONTS_DIR}\")") | ||
install(CODE | ||
"message(STATUS \"If this is the first time you have installed CMatrix you will probably have to restart X window in order to use the mtx.pcf font.\")") | ||
endif () | ||
endforeach () | ||
endif () | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters