Permalink
Browse files

Refactoring cmake files

  • Loading branch information...
1 parent 92b31b8 commit 7b37821243707fdff9cdc78b4930ef37dde52c7b @pjotrp pjotrp committed Apr 5, 2009
@@ -17,6 +17,7 @@ EXEC_PROGRAM(${cat_prog} ARGS ${MAP_ROOT}/VERSION OUTPUT_VARIABLE MAP_VERSION)
EXEC_PROGRAM(${cat_prog} ARGS ${MAP_ROOT}/PROJECTNAME OUTPUT_VARIABLE MAP_PROJECTNAME)
string(TOLOWER ${MAP_PROJECTNAME} MAP_projectname)
+string(TOUPPER ${MAP_PROJECTNAME} MAP_PROJECTNAME_UPPER)
# ---- Add a predefined build variable
add_definitions(-DMAP_BUILD)
@@ -1,38 +1,41 @@
-# CMake script to locate external libraries for BioLib
+# CMake script to locate external libraries
#
# Using
#
# USE_RLIB
# USE_ZLIB
-# USE_BIOLIBCORE
+# USE_CORE
#
# ---- Using libraries
IF(USE_RLIB)
- SET (USE_BIOLIBCORE TRUE)
+ SET (USE_CORE TRUE)
FIND_PACKAGE(RLibs)
ENDIF(USE_RLIB)
IF(USE_ZLIB)
- SET (USE_BIOLIBCORE TRUE)
+ SET (USE_CORE TRUE)
FIND_PACKAGE(ZLIB)
ENDIF(USE_ZLIB)
-IF(USE_BIOLIBCORE)
- add_definitions(-DBIOLIB)
- INCLUDE_DIRECTORIES(${BIOLIB_CLIBS_PATH}/biolib_core/include)
+IF(USE_CORE)
+ SET(_LIBNAME ${MAP_projectname}_core)
+ add_definitions(-D${MAP_PROJECTNAME_UPPER})
+ INCLUDE_DIRECTORIES(${MAP_CLIBS_PATH}/${_LIBNAME}/include)
if(NOT BUILD_LIBS)
- FIND_LIBRARY(BIOLIB_LIBRARY NAMES libbiolib_core-${BIOLIB_VERSION}.so PATHS ${BIOLIB_CLIBS_PATH}/biolib_core/build)
- message("Found ${BIOLIB_LIBRARY}")
+ FIND_LIBRARY(CORE_LIBRARY NAMES lib${_LIBNAME}-${MAP_VERSION}.so PATHS ${MAP_CLIBS_PATH}/${_LIBNAME}/build)
+ message("Found ${CORE_LIBRARY}")
endif(NOT BUILD_LIBS)
-ENDIF(USE_BIOLIBCORE)
+ # UNSET(_LIBNAME)
+ SET(_LIBNAME 'unknown')
+ENDIF(USE_CORE)
IF(USE_RLIB)
# handle the QUIETLY and REQUIRED arguments and set RLIBS_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
- FIND_PACKAGE_HANDLE_STANDARD_ARGS(RLibs DEFAULT_MSG BIOLIB_VERSION)
+ FIND_PACKAGE_HANDLE_STANDARD_ARGS(RLibs DEFAULT_MSG MAP_VERSION)
ENDIF(USE_RLIB)
@@ -47,6 +47,7 @@ IF(USE_INCLUDEPATH)
ENDIF(USE_INCLUDEPATH)
# UNSET(_LIBNAME)
+SET(_LIBNAME 'unknown')
MARK_AS_ADVANCED(
MODULE_SOURCE_PATH
@@ -1,4 +1,4 @@
-# - Find ASCILIB for Perl settings
+# - Find Perl settings
#
# Expects M_NAME, M_VERSION to be set!
#
@@ -1,10 +1,10 @@
-# CMake file for BioLib SWIG configuration
+# CMake file for SWIG configuration
#
# Using
#
# USE_LANGUAGE=ruby|perl
# USE_LANGUAGE_LIBRARY=(RUBY|PERL|PYTHON)_LIBRARY
-# USE_SWIG_FLAGS=";-prefix;'biolib::'"
+# USE_SWIG_FLAGS=";-prefix;'prefix::'"
# ---- SWIG
@@ -30,7 +30,7 @@ endif (USE_SWIG_INCLUDEALL)
message(STATUS "SWIG M_MODULE=${M_MODULE}")
SWIG_ADD_MODULE(${M_MODULE} ${USE_LANGUAGE} ${INTERFACE} ${SOURCES} )
-SWIG_LINK_LIBRARIES(${M_MODULE} ${MODULE_LIBRARY} ${USE_LANGUAGE_LIBRARY} ${BIOLIB_LIBRARY} ${R_LIBRARY} ${ZLIB_LIBRARY})
+SWIG_LINK_LIBRARIES(${M_MODULE} ${MODULE_LIBRARY} ${USE_LANGUAGE_LIBRARY} ${CORE_LIBRARY} ${R_LIBRARY} ${ZLIB_LIBRARY})
# TARGET_LINK_LIBRARIES(${M_MODULE} ${USE_LANGUAGE_LIBRARY})

0 comments on commit 7b37821

Please sign in to comment.