Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Cmake map files

  • Loading branch information...
commit df9c82f9c7519590e51d6cb3d2df535f8bf5e276 1 parent f7a38a5
@pjotrp pjotrp authored
View
26 cmake_modules/FindASciLib.cmake → cmake_modules/FindMap.cmake
@@ -1,9 +1,9 @@
-# - Find ASCILIB settings
+# - Find MAPPING settings
#
-# ---- Get ASCILIB root
-get_filename_component(ASCILIB_ROOT ${CMAKE_MODULE_PATH} PATH)
-SET(ASCILIB_CLIBS_PATH ${ASCILIB_ROOT}/src/clibs)
+# ---- Get MAP root
+get_filename_component(MAP_ROOT ${CMAKE_MODULE_PATH} PATH)
+SET(MAP_CLIBS_PATH ${MAP_ROOT}/src/clibs)
# ---- Get info from ./VERSION file
SET(cat_prog cat)
@@ -13,10 +13,10 @@ IF(WIN32)
ENDIF(NOT UNIX)
ENDIF(WIN32)
-EXEC_PROGRAM(${cat_prog} ARGS ${ASCILIB_ROOT}/VERSION OUTPUT_VARIABLE ASCILIB_VERSION)
+EXEC_PROGRAM(${cat_prog} ARGS ${MAP_ROOT}/VERSION OUTPUT_VARIABLE MAP_VERSION)
# ---- Add a predefinde build variable
-add_definitions(-DASCILIB_BUILD)
+add_definitions(-DMAP_BUILD)
# ---- Set default installation prefix
@@ -42,17 +42,17 @@ SET(CMAKE_INSTALL_RPATH "#{CMAKE_INSTALL_PREFIX}/lib")
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE)
MESSAGE("CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}")
-MESSAGE("ASCILIB_ROOT=${ASCILIB_ROOT}")
-MESSAGE("ASCILIB_CLIBS_PATH=${ASCILIB_CLIBS_PATH}")
-MESSAGE("ASCILIB_VERSION=${ASCILIB_VERSION}")
+MESSAGE("MAP_ROOT=${MAP_ROOT}")
+MESSAGE("MAP_CLIBS_PATH=${MAP_CLIBS_PATH}")
+MESSAGE("MAP_VERSION=${MAP_VERSION}")
# 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(xRLibs DEFAULT_MSG ASCILIB_VERSION)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(xRLibs DEFAULT_MSG MAP_VERSION)
MARK_AS_ADVANCED(
- ASCILIB_ROOT
- ASCILIB_CLIBS_PATH
- ASCILIB_VERSION
+ MAP_ROOT
+ MAP_CLIBS_PATH
+ MAP_VERSION
)
View
38 cmake_modules/FindMapLibraries.cmake
@@ -0,0 +1,38 @@
+# CMake script to locate external libraries for BioLib
+#
+# Using
+#
+# USE_RLIB
+# USE_ZLIB
+# USE_BIOLIBCORE
+#
+
+# ---- Using libraries
+
+IF(USE_RLIB)
+ SET (USE_BIOLIBCORE TRUE)
+ FIND_PACKAGE(RLibs)
+ENDIF(USE_RLIB)
+
+IF(USE_ZLIB)
+ SET (USE_BIOLIBCORE TRUE)
+ FIND_PACKAGE(ZLIB)
+ENDIF(USE_ZLIB)
+
+IF(USE_BIOLIBCORE)
+ add_definitions(-DBIOLIB)
+ INCLUDE_DIRECTORIES(${BIOLIB_CLIBS_PATH}/biolib_core/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}")
+ endif(NOT BUILD_LIBS)
+ENDIF(USE_BIOLIBCORE)
+
+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)
+ENDIF(USE_RLIB)
+
+
View
51 cmake_modules/FindMapModule.cmake
@@ -0,0 +1,51 @@
+# This CMake script tries to locate the clib module and shared library
+# in the source tree and
+#
+# It uses
+#
+# M_NAME
+# M_VERSION
+# USE_INCLUDE_PATH
+#
+# to return
+#
+# MODULE_SOURCE_PATH
+# MODULE_LIBRARY
+
+SET (MODULE_NAME ${M_NAME})
+
+IF(M_VERSION)
+ SET (MODULE_NAME ${M_NAME}-${M_VERSION})
+ENDIF(M_VERSION)
+
+# ---- Find the shared library include and lib path
+SET (MODULE_SOURCE_PATH ${BIOLIB_CLIBS_PATH}/${MODULE_NAME})
+
+message("MODULE_SOURCE_PATH=${MODULE_SOURCE_PATH}")
+
+IF(NOT IS_DIRECTORY ${MODULE_SOURCE_PATH})
+ MESSAGE(FATAL_ERROR "${MODULE_SOURCE_PATH} does not exist")
+ENDIF(NOT IS_DIRECTORY ${MODULE_SOURCE_PATH})
+
+MESSAGE("Looking for libbiolib_${M_NAME}-${BIOLIB_VERSION}.so")
+IF(BUILD_LIBS)
+ # This section gets run when cmake is invoked from the top level dir
+ SET(MODULE_LIBRARY biolib_${M_NAME}-${BIOLIB_VERSION})
+ELSE(BUILD_LIBS)
+ # This section gets run when CMake is invoked from a node - it needs
+ # an explicit path as is has been pre-built and CMake is not aware...
+ FIND_LIBRARY(MODULE_LIBRARY NAMES libbiolib_${M_NAME}-${BIOLIB_VERSION}.so PATHS ${MODULE_SOURCE_PATH} ${MODULE_SOURCE_PATH}/build ${MODULE_SOURCE_PATH}/src)
+ENDIF(BUILD_LIBS)
+message("MODULE_LIBRARY=${MODULE_LIBRARY}")
+INCLUDE_DIRECTORIES(${MODULE_SOURCE_PATH}/include)
+INCLUDE_DIRECTORIES(${MODULE_SOURCE_PATH}/src)
+INCLUDE_DIRECTORIES(${MODULE_SOURCE_PATH})
+IF(USE_INCLUDEPATH)
+ INCLUDE_DIRECTORIES(${MODULE_SOURCE_PATH}/${USE_INCLUDEPATH})
+ENDIF(USE_INCLUDEPATH)
+
+MARK_AS_ADVANCED(
+ MODULE_SOURCE_PATH
+ MODULE_LIBRARY
+)
+
View
33 cmake_modules/FindMapPerl.cmake
@@ -0,0 +1,33 @@
+# - Find ASCILIB for Perl settings
+#
+# Expects M_NAME, M_VERSION to be set!
+#
+# Special parameters are:
+#
+# USE_INCLUDEPATH - find module include files here
+# USE_SWIG_INCLUDEALL - tell SWIG to parse all include files for
+# info (not recommended as all C headers are pulled in too)
+# USE_RLIB - link the R libraries
+# USE_ZLIB - link Zlib
+# USE_ASCILIBCORE - link the core lib
+
+SET (M_MODULE ${M_NAME})
+
+message("Creating Perl module ${M_MODULE} (${M_VERSION})")
+FIND_PACKAGE(MapLib REQUIRED)
+FIND_PACKAGE(PerlLibs REQUIRED)
+
+# ---- Setting the default Perl include path
+INCLUDE_DIRECTORIES(${PERL_INCLUDE_PATH})
+
+FIND_PACKAGE(MapModule REQUIRED)
+FIND_PACKAGE(MapLibraries REQUIRED)
+
+SET (USE_LANGUAGE "perl")
+SET (USE_LANGUAGE_LIBRARY ${PERL_LIBRARY})
+
+FIND_PACKAGE(ASciLibSWIG REQUIRED)
+
+MARK_AS_ADVANCED (
+ USE_LANGUAGE_LIBRARY
+ )
View
35 cmake_modules/FindMapPython.cmake
@@ -0,0 +1,35 @@
+# - Find BioLib for PYTHON settings
+#
+# Expects M_NAME, M_VERSION to be set!
+#
+# Special parameters are:
+#
+# USE_INCLUDEPATH - find module include files here
+# USE_SWIG_INCLUDEALL - tell SWIG to parse all include files for
+# info (not recommended as all C headers are pulled in too)
+# USE_RLIB - link the R libraries
+# USE_ZLIB - link Zlib
+# USE_BIOLIBCORE - link the core lib
+
+SET (M_MODULE ${M_NAME})
+
+message("Creating Python module ${M_MODULE} (${M_VERSION})")
+message("CMAKE_MODULE_PATH=" ${CMAKE_MODULE_PATH})
+FIND_PACKAGE(BioLib REQUIRED)
+FIND_PACKAGE(PythonLibs REQUIRED)
+
+# ---- Setting the default PYTHON include path
+INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})
+# SET (PYTHON_LIB_PATH ${PYTHON_LIBRARY})
+
+FIND_PACKAGE(BioLibModule REQUIRED)
+FIND_PACKAGE(BioLibLibraries REQUIRED)
+
+SET (USE_LANGUAGE "Python")
+SET (USE_LANGUAGE_LIBRARY ${PYTHON_LIBRARY})
+# SET (USE_SWIG_FLAGS ";-prefix;'biolib::'")
+
+FIND_PACKAGE(BioLibSWIG REQUIRED)
+
+MESSAGE( STATUS "PYTHON_LIB_PATH=${PYTHON_LIB_PATH}")
+
View
34 cmake_modules/FindMapRuby.cmake
@@ -0,0 +1,34 @@
+# - Find BioLib for Ruby settings
+#
+# Expects M_NAME, M_VERSION to be set!
+#
+# Special parameters are:
+#
+# USE_INCLUDEPATH - find module include files here
+# USE_SWIG_INCLUDEALL - tell SWIG to parse all include files for
+# info (not recommended as all C headers are pulled in too)
+# USE_RLIB - link the R libraries
+# USE_ZLIB - link Zlib
+# USE_BIOLIBCORE - link the core lib
+
+SET (M_MODULE ${M_NAME})
+
+message("Creating Ruby module ${M_MODULE} (${M_VERSION})")
+FIND_PACKAGE(BioLib REQUIRED)
+FIND_PACKAGE(Ruby REQUIRED)
+
+# ---- Setting the default Ruby include path
+INCLUDE_DIRECTORIES(${RUBY_INCLUDE_PATH})
+SET (RUBY_LIB_PATH ${RUBY_INCLUDE_PATH})
+
+FIND_PACKAGE(BioLibModule REQUIRED)
+FIND_PACKAGE(BioLibLibraries REQUIRED)
+
+SET (USE_LANGUAGE "ruby")
+SET (USE_LANGUAGE_LIBRARY ${RUBY_LIBRARY})
+SET (USE_SWIG_FLAGS ";-prefix;'biolib::'")
+
+FIND_PACKAGE(BioLibSWIG REQUIRED)
+
+MESSAGE( STATUS "RUBY_LIB_PATH=${RUBY_LIB_PATH}")
+
View
51 cmake_modules/FindMapSWIG.cmake
@@ -0,0 +1,51 @@
+# CMake file for BioLib SWIG configuration
+#
+# Using
+#
+# USE_LANGUAGE=ruby|perl
+# USE_LANGUAGE_LIBRARY=(RUBY|PERL|PYTHON)_LIBRARY
+# USE_SWIG_FLAGS=";-prefix;'biolib::'"
+
+# ---- SWIG
+
+message(STATUS "USE_LANGUAGE=${USE_LANGUAGE}")
+message(STATUS "USE_LANGUAGE_LIBRARY=${USE_LANGUAGE_LIBRARY}")
+message(STATUS "USE_SWIG_FLAGS=${USE_SWIG_FLAGS}")
+
+FIND_PACKAGE(SWIG REQUIRED)
+INCLUDE(${SWIG_USE_FILE})
+
+SET_SOURCE_FILES_PROPERTIES(${INTERFACE} PROPERTIES CPLUSPLUS ON)
+
+if (USE_C_LINKAGE)
+ SET_SOURCE_FILES_PROPERTIES(${INTERFACE} PROPERTIES CPLUSPLUS OFF)
+endif (USE_C_LINKAGE)
+
+if (USE_SWIG_INCLUDEALL)
+ SET_SOURCE_FILES_PROPERTIES(${INTERFACE} PROPERTIES SWIG_FLAGS "-includeall${USE_SWIG_FLAGS}'")
+else (USE_SWIG_INCLUDEALL)
+ SET_SOURCE_FILES_PROPERTIES(${INTERFACE} PROPERTIES SWIG_FLAGS "${USE_SWIG_FLAGS}")
+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})
+
+# TARGET_LINK_LIBRARIES(${M_MODULE} ${USE_LANGUAGE_LIBRARY})
+
+# this is used when searching for include files e.g. using the FIND_PATH() command.
+MESSAGE( STATUS "CMAKE_INCLUDE_PATH=" ${CMAKE_INCLUDE_PATH} )
+# this is used when searching for libraries e.g. using the FIND_LIBRARY() command.
+MESSAGE( STATUS "CMAKE_LIBRARY_PATH=" ${CMAKE_LIBRARY_PATH} )
+
+IF(APPLE)
+ # Hack!
+ SET(CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS
+ "${CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS} -Wl,-flat_namespace -Wl,-undefined -Wl,warning")
+ENDIF(APPLE)
+
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS("all SWIG prerequisites for ${USE_LANGUAGE}" DEFAULT_MSG USE_LANGUAGE USE_LANGUAGE_LIBRARY)
+
+
View
2  src/mappings/swig/perl/gsl/CMakeLists.txt
@@ -15,7 +15,7 @@ ENDIF(NOT BUILD_LIBS)
# INCLUDE(CMakeBackwardCompatibilityC)
-FIND_PACKAGE(ascilibPerl REQUIRED)
+FIND_PACKAGE(ASciLibPerl REQUIRED)
ADD_CUSTOM_COMMAND(
TARGET ${M_MODULE}

0 comments on commit df9c82f

Please sign in to comment.
Something went wrong with that request. Please try again.