Skip to content

Commit

Permalink
libvarnam is ready to use. added install target too.
Browse files Browse the repository at this point in the history
  • Loading branch information
Navaneeth committed Nov 20, 2010
1 parent f59e072 commit 93da05f
Show file tree
Hide file tree
Showing 17 changed files with 160 additions and 1,686 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ src/tests/#CMakeLists.txt#
src/tests/tests
build/
*.vst
*.so
*.so
*.so.*
42 changes: 27 additions & 15 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ cmake_minimum_required (VERSION 2.6)
project(varnam)

set(VARNAM_LIBRARY_NAME "varnam")
set(SEXPR_LIBRARY_NAME "sexpr")
set(FOREIGN_LIBRARY_NAME "foreign-functions")

set(VARNAM_VERSION_MAJOR 1)
set(VARNAM_VERSION_MINOR 0)
set(VARNAM_VERSION_PATCH 1)

IF(CMAKE_COMPILER_IS_GNUCC)
set(CMAKE_C_FLAGS "-g -Wall -ansi -pedantic -Wconversion -Wformat=2 -Wshadow -Wcast-qual -Wwrite-strings")
ENDIF()
Expand All @@ -21,32 +24,41 @@ add_definitions(-DHAVE_SNPRINTF -DPREFER_PORTABLE_SNPRINTF)

# Append the source files here
list (APPEND VARNAM_SOURCES
compile.c
util.c
trie.c
strbuf.c
lex.c
parser.c
vstgen.c
tl.c
varnam-util.c
varnam-trie.c
varnam-strbuf.c
varnam-tl.c
varnam.c
)

# Append the header files here. this will get copied to include directory
list (APPEND VARNAM_INCLUDE_FILES
varnam.h
varnam-result-codes.h
varnam-trie.h
varnam-types.h
varnam-util.h
)

# Build foreign functions
add_subdirectory(foreign)

# Create a shared library libvarnam
add_library (${VARNAM_LIBRARY_NAME} SHARED ${VARNAM_SOURCES})

# Build the sexpr library
add_subdirectory(sexpr)
SET_TARGET_PROPERTIES(${VARNAM_LIBRARY_NAME} PROPERTIES
VERSION ${VARNAM_VERSION_MAJOR}.${VARNAM_VERSION_MINOR}.${VARNAM_VERSION_PATCH}
SOVERSION ${VARNAM_VERSION_MAJOR})

# Create a shared library libvarnam
add_library (${VARNAM_LIBRARY_NAME} SHARED ${VARNAM_SOURCES})
INSTALL ( TARGETS ${VARNAM_LIBRARY_NAME} DESTINATION lib)
INSTALL ( FILES ${VARNAM_INCLUDE_FILES} DESTINATION include/lib${VARNAM_LIBRARY_NAME})

IF(CMAKE_COMPILER_IS_GNUCC)
# sqlite requires pthread and dl
target_link_libraries(${VARNAM_LIBRARY_NAME} ${SEXPR_LIBRARY_NAME} ${FOREIGN_LIBRARY_NAME} pthread dl)
target_link_libraries(${VARNAM_LIBRARY_NAME} ${FOREIGN_LIBRARY_NAME} pthread dl)
ENDIF()

IF(MSVC)
target_link_libraries(${VARNAM_LIBRARY_NAME} ${SEXPR_LIBRARY_NAME} ${FOREIGN_LIBRARY_NAME})
target_link_libraries(${VARNAM_LIBRARY_NAME} ${FOREIGN_LIBRARY_NAME})
ENDIF()

143 changes: 0 additions & 143 deletions compile.c

This file was deleted.

Loading

0 comments on commit 93da05f

Please sign in to comment.