Browse files

Revert "remove CMAKE crap"

This reverts commit 36574f7.
  • Loading branch information...
1 parent 12c12f6 commit e004d3962cb121c627ff1f459a0486cf672a0f93 @nsf committed Jun 21, 2012
Showing with 52 additions and 0 deletions.
  1. +29 −0 CMakeLists.txt
  2. +17 −0 src/CMakeLists.txt
  3. +6 −0 src/demo/CMakeLists.txt
View
29 CMakeLists.txt
@@ -0,0 +1,29 @@
+#################################################################
+# Termbox - A ncurses alternative
+#
+# Author: nsf - no.smile.face@gmail.com
+# Website: http://code.google.com/p/termbox/
+#
+# Termbox library is a simple and clean ncurses alternative.
+# Of course everything has it's own price.
+# In this case it's portability and stability.
+#
+# Modified by: ykj - youngkevinjonas@gmail.com
+# On: May 5th 2012
+# I have completely reorganized the project
+# while leaving most of the code intact (fixed
+# a couple of warnings). Now you can either use
+# it as a dependency for a C/C++ project by employing
+# CMake, or you can install it as a Python package
+# by using Python distutils and Cython.
+#
+# This file constitutes the CMake build.
+#################################################################
+
+CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
+
+PROJECT(TERMBOX C)
+
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -std=gnu99")
+
+ADD_SUBDIRECTORY(src)
View
17 src/CMakeLists.txt
@@ -0,0 +1,17 @@
+SET(TERMBOX_LIB_SRC
+ ${CMAKE_CURRENT_SOURCE_DIR}/input.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/ringbuffer.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/term.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/termbox.c
+ ${CMAKE_CURRENT_SOURCE_DIR}/utf8.c
+)
+
+ADD_LIBRARY(termbox STATIC ${TERMBOX_LIB_SRC})
+
+OPTION(TERMBOX_SHARED "Build static library for use in shared libraries (uses fPIC)" OFF)
+
+IF(TERMBOX_SHARED)
+ SET_TARGET_PROPERTIES(termbox PROPERTIES COMPILE_FLAGS -fPIC)
+ENDIF(TERMBOX_SHARED)
+
+ADD_SUBDIRECTORY(demo)
View
6 src/demo/CMakeLists.txt
@@ -0,0 +1,6 @@
+SET(KEYBOARD_SRC
+ ${CMAKE_CURRENT_SOURCE_DIR}/keyboard.c
+)
+
+ADD_EXECUTABLE(keyboard ${KEYBOARD_SRC})
+TARGET_LINK_LIBRARIES(keyboard termbox)

0 comments on commit e004d39

Please sign in to comment.