Skip to content

Commit

Permalink
Added Curses, DBI, EditLine addons to CMake
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremytregunna committed May 8, 2010
1 parent 642114d commit f3ae2c1
Show file tree
Hide file tree
Showing 6 changed files with 171 additions and 3 deletions.
6 changes: 3 additions & 3 deletions addons/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
40 changes: 40 additions & 0 deletions addons/Curses/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
42 changes: 42 additions & 0 deletions addons/DBI/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
40 changes: 40 additions & 0 deletions addons/EditLine/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
23 changes: 23 additions & 0 deletions modules/FindDBI.cmake
Original file line number Diff line number Diff line change
@@ -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)
23 changes: 23 additions & 0 deletions modules/FindEdit.cmake
Original file line number Diff line number Diff line change
@@ -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.