Permalink
Browse files

Added Curses, DBI, EditLine addons to CMake

  • Loading branch information...
1 parent 642114d commit f3ae2c1788005957fceea15c88604cbdfcf232b2 @jeremytregunna jeremytregunna committed May 8, 2010
View
@@ -51,10 +51,10 @@ add_subdirectory(CGI)
#add_subdirectory(Cairo)
#add_subdirectory(Clutter)
add_subdirectory(ContinuedFraction)
-#add_subdirectory(Curses)
-#add_subdirectory(DBI)
+add_subdirectory(Curses)
+add_subdirectory(DBI)
add_subdirectory(DistributedObjects)
-#add_subdirectory(EditLine)
+add_subdirectory(EditLine)
#add_subdirectory(Flux)
add_subdirectory(Fnmatch)
#add_subdirectory(Font)
@@ -0,0 +1,40 @@
+# Base Io build system
+# Written by Jeremy Tregunna <jeremy.tregunna@me.com>
+#
+# Builds the Curses addon
+
+# Find curses
+find_package(Curses)
+
+# Create the _build bundle hierarchy if needed.
+make_build_bundle(_build)
+
+# Did we find curses? if so, set up the targets and all the support
+# variables.
+if(CURSES_FOUND)
+ # Output our dynamic library to the top-level _build hierarchy
+ set(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/_build/dll)
+
+ # Additional include directories
+ include_directories(${CURSES_INCLUDE_DIR})
+
+ # Generate the IoCursesInit.c file.
+ # Argument SHOULD ALWAYS be the exact name of the addon, case is
+ # important.
+ generate_ioinit(Curses)
+
+ # Our library sources.
+ set(SRCS
+ "${CMAKE_CURRENT_SOURCE_DIR}/source/IoCurses.c"
+ "${CMAKE_CURRENT_SOURCE_DIR}/source/IoCursesInit.c"
+ )
+
+ # Now build the shared library
+ add_library(IoCurses SHARED ${SRCS})
+ add_dependencies(IoCurses iovmall)
+ target_link_libraries(IoCurses iovmall ${CURSES_LIBRARY})
+
+ # Install the addon to our global addons hierarchy.
+ install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/io/addons)
+ install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/_build DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/io/addons/Curses)
+endif(CURSES_FOUND)
View
@@ -0,0 +1,42 @@
+# Base Io build system
+# Written by Jeremy Tregunna <jeremy.tregunna@me.com>
+#
+# Builds the DBI addon
+
+# Find curses
+find_package(DBI)
+
+# Create the _build bundle hierarchy if needed.
+make_build_bundle(_build)
+
+# Did we find curses? if so, set up the targets and all the support
+# variables.
+if(DBI_FOUND)
+ # Output our dynamic library to the top-level _build hierarchy
+ set(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/_build/dll)
+
+ # Additional include directories
+ include_directories(${DBI_INCLUDE_DIR})
+
+ # Generate the IoDBIInit.c file.
+ # Argument SHOULD ALWAYS be the exact name of the addon, case is
+ # important.
+ generate_ioinit(DBI)
+
+ # Our library sources.
+ set(SRCS
+ "${CMAKE_CURRENT_SOURCE_DIR}/source/IoDBI.c"
+ "${CMAKE_CURRENT_SOURCE_DIR}/source/IoDBIConn.c"
+ "${CMAKE_CURRENT_SOURCE_DIR}/source/IoDBIResult.c"
+ "${CMAKE_CURRENT_SOURCE_DIR}/source/IoDBIInit.c"
+ )
+
+ # Now build the shared library
+ add_library(IoDBI SHARED ${SRCS})
+ add_dependencies(IoDBI iovmall)
+ target_link_libraries(IoDBI iovmall ${DBI_LIBRARY})
+
+ # Install the addon to our global addons hierarchy.
+ install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/io/addons)
+ install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/_build DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/io/addons/DBI)
+endif(DBI_FOUND)
@@ -0,0 +1,40 @@
+# Base Io build system
+# Written by Jeremy Tregunna <jeremy.tregunna@me.com>
+#
+# Builds the EditLine addon
+
+# Find curses
+find_package(EDIT)
+
+# Create the _build bundle hierarchy if needed.
+make_build_bundle(_build)
+
+# Did we find curses? if so, set up the targets and all the support
+# variables.
+if(EDIT_FOUND)
+ # Output our dynamic library to the top-level _build hierarchy
+ set(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/_build/dll)
+
+ # Additional include directories
+ include_directories(${EDIT_INCLUDE_DIR})
+
+ # Generate the IoEditLineInit.c file.
+ # Argument SHOULD ALWAYS be the exact name of the addon, case is
+ # important.
+ generate_ioinit(EditLine)
+
+ # Our library sources.
+ set(SRCS
+ "${CMAKE_CURRENT_SOURCE_DIR}/source/IoEditLine.c"
+ "${CMAKE_CURRENT_SOURCE_DIR}/source/IoEditLineInit.c"
+ )
+
+ # Now build the shared library
+ add_library(IoEditLine SHARED ${SRCS})
+ add_dependencies(IoEditLine iovmall)
+ target_link_libraries(IoEditLine iovmall ${EDIT_LIBRARY})
+
+ # Install the addon to our global addons hierarchy.
+ install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/io/addons)
+ install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/_build DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/io/addons/EditLine)
+endif(EDIT_FOUND)
View
@@ -0,0 +1,23 @@
+# Base Io build system
+# Written by Jeremy Tregunna <jeremy.tregunna@me.com>
+#
+# Find libdbi
+
+FIND_PATH(DBI_INCLUDE_DIR dbi/dbi.h)
+
+SET(DBI_NAMES ${DBI_NAMES} dbi libdbi)
+FIND_LIBRARY(DBI_LIBRARY NAMES ${DBI_NAMES} PATH)
+
+IF(DBI_INCLUDE_DIR AND DBI_LIBRARY)
+ SET(DBI_FOUND TRUE)
+ENDIF(DBI_INCLUDE_DIR AND DBI_LIBRARY)
+
+IF(DBI_FOUND)
+ IF(NOT DBI_FIND_QUIETLY)
+ MESSAGE(STATUS "Found DBI: ${DBI_LIBRARY}")
+ ENDIF (NOT DBI_FIND_QUIETLY)
+ELSE(DBI_FOUND)
+ IF(DBI_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "Could not find DBI")
+ ENDIF(DBI_FIND_REQUIRED)
+ENDIF(DBI_FOUND)
View
@@ -0,0 +1,23 @@
+# Base Io build system
+# Written by Jeremy Tregunna <jeremy.tregunna@me.com>
+#
+# Find libedit
+
+FIND_PATH(EDIT_INCLUDE_DIR histedit.h)
+
+SET(EDIT_NAMES ${EDIT_NAMES} edit libedit)
+FIND_LIBRARY(EDIT_LIBRARY NAMES ${EDIT_NAMES} PATH)
+
+IF(EDIT_INCLUDE_DIR AND EDIT_LIBRARY)
+ SET(EDIT_FOUND TRUE)
+ENDIF(EDIT_INCLUDE_DIR AND EDIT_LIBRARY)
+
+IF(EDIT_FOUND)
+ IF(NOT EDIT_FIND_QUIETLY)
+ MESSAGE(STATUS "Found EDIT: ${EDIT_LIBRARY}")
+ ENDIF (NOT EDIT_FIND_QUIETLY)
+ELSE(EDIT_FOUND)
+ IF(EDIT_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "Could not find EDIT")
+ ENDIF(EDIT_FIND_REQUIRED)
+ENDIF(EDIT_FOUND)

0 comments on commit f3ae2c1

Please sign in to comment.