Permalink
Browse files

Moving CMake scripts into shared repository for BioLib and Ascilib

  • Loading branch information...
pjotrp committed Apr 26, 2009
1 parent bb0e4a7 commit bf7c707a35432f580ab0a1f5561826854e63f171
View
@@ -4,3 +4,6 @@
[submodule "src/mappings/swig/contrib/math--gsl"]
path = src/mappings/swig/contrib/math--gsl
url = git://github.com/pjotrp/math--gsl.git
+[submodule "tools/cmake-support"]
+ path = tools/cmake-support
+ url = git@github.com:pjotrp/cmake-support.git
@@ -1,63 +0,0 @@
-# Global MAPPING settings
-#
-
-# ---- Get MAP source root directory
-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)
-IF(WIN32)
- IF(NOT UNIX)
- SET(cat_prog type)
- ENDIF(NOT UNIX)
-ENDIF(WIN32)
-
-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)
-
-# ---- Set default installation prefix
-
-IF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
- SET(CMAKE_INSTALL_PREFIX /usr)
-ENDIF(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
-message("PREFIX: ${CMAKE_INSTALL_PREFIX}")
-
-# ---- RPATH handling
-
-# use, i.e. don't skip the full RPATH for the build tree
-SET(CMAKE_SKIP_BUILD_RPATH FALSE)
-
-# when building, don't use the install RPATH already
-# (but later on when installing)
-SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
-
-# the RPATH to be used when installing
-SET(CMAKE_INSTALL_RPATH "#{CMAKE_INSTALL_PREFIX}/lib")
-
-# don't add the automatically determined parts of the RPATH
-# which point to directories outside the build tree to the install RPATH
-SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH FALSE)
-
-MESSAGE("CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}")
-MESSAGE("MAP_ROOT=${MAP_ROOT}")
-MESSAGE("MAP_CLIBS_PATH=${MAP_CLIBS_PATH}")
-MESSAGE("MAP_PROJECTNAME=${MAP_projectname}")
-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 MAP_VERSION MAP_projectname)
-
-MARK_AS_ADVANCED(
- MAP_ROOT
- MAP_CLIBS_PATH
- MAP_VERSION
- )
@@ -1,41 +0,0 @@
-# CMake script to locate external libraries
-#
-# Using
-#
-# USE_RLIB
-# USE_ZLIB
-# USE_CORE
-#
-
-# ---- Using libraries
-
-IF(USE_RLIB)
- SET (USE_CORE TRUE)
- FIND_PACKAGE(RLibs)
-ENDIF(USE_RLIB)
-
-IF(USE_ZLIB)
- SET (USE_CORE TRUE)
- FIND_PACKAGE(ZLIB)
-ENDIF(USE_ZLIB)
-
-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(CORE_LIBRARY NAMES lib${_LIBNAME}-${MAP_VERSION}.so PATHS ${MAP_CLIBS_PATH}/${_LIBNAME}/build)
- message("Found ${CORE_LIBRARY}")
- endif(NOT BUILD_LIBS)
- # 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 MAP_VERSION)
-ENDIF(USE_RLIB)
-
-
@@ -1,56 +0,0 @@
-# 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 ${MAP_CLIBS_PATH}/${MODULE_NAME})
-
-message("PROJECT=${PROJECT_LABEL}")
-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})
-
-SET(_LIBNAME ${MAP_projectname}_${M_NAME}-${MAP_VERSION})
-MESSAGE("Looking for lib${_LIBNAME}.so")
-IF(BUILD_LIBS)
- # This section gets run when cmake is invoked from the top level dir
- SET(MODULE_LIBRARY ${_LIBNAME})
-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 lib${_LIBNAME}.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)
-
-# UNSET(_LIBNAME)
-SET(_LIBNAME 'unknown')
-
-MARK_AS_ADVANCED(
- MODULE_SOURCE_PATH
- MODULE_LIBRARY
-)
-
@@ -1,33 +0,0 @@
-# - Find 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_CORE - link the core lib
-
-SET (M_MODULE ${M_NAME})
-
-message("Creating Perl module ${M_MODULE} (${M_VERSION})")
-FIND_PACKAGE(Map 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(MapSWIG REQUIRED)
-
-MARK_AS_ADVANCED (
- USE_LANGUAGE_LIBRARY
- )
@@ -1,35 +0,0 @@
-# - Find 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_CORE - 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(Map REQUIRED)
-FIND_PACKAGE(PythonLibs REQUIRED)
-
-# ---- Setting the default PYTHON include path
-INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})
-# SET (PYTHON_LIB_PATH ${PYTHON_LIBRARY})
-
-FIND_PACKAGE(MapModule REQUIRED)
-FIND_PACKAGE(MapLibraries REQUIRED)
-
-SET (USE_LANGUAGE "Python")
-SET (USE_LANGUAGE_LIBRARY ${PYTHON_LIBRARY})
-# SET (USE_SWIG_FLAGS ";-prefix;'${MAP_projectname}::'")
-
-FIND_PACKAGE(MapSWIG REQUIRED)
-
-MESSAGE( STATUS "PYTHON_LIB_PATH=${PYTHON_LIB_PATH}")
-
@@ -1,34 +0,0 @@
-# - Find 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_CORE - link the core lib
-
-SET (M_MODULE ${M_NAME})
-
-message("Creating Ruby module ${M_MODULE} (${M_VERSION})")
-FIND_PACKAGE(Map 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(MapModule REQUIRED)
-FIND_PACKAGE(MapLibraries REQUIRED)
-
-SET (USE_LANGUAGE "ruby")
-SET (USE_LANGUAGE_LIBRARY ${RUBY_LIBRARY})
-SET (USE_SWIG_FLAGS "-prefix;'${MAP_projectname}::';${USE_SWIG_FLAGS}")
-
-FIND_PACKAGE(MapSWIG REQUIRED)
-
-MESSAGE( STATUS "RUBY_LIB_PATH=${RUBY_LIB_PATH}")
-
@@ -1,58 +0,0 @@
-# CMake file for SWIG configuration
-#
-# Using
-#
-# USE_LANGUAGE=ruby|perl
-# USE_LANGUAGE_LIBRARY=(RUBY|PERL|PYTHON)_LIBRARY
-# USE_SWIG_FLAGS="-prefix;'prefix::'"
-# USE_SWIG_INCLUDEPATH="path"
-
-# ---- SWIG
-
-message(STATUS "USE_LANGUAGE=${USE_LANGUAGE}")
-message(STATUS "USE_LANGUAGE_LIBRARY=${USE_LANGUAGE_LIBRARY}")
-message(STATUS "USE_SWIG_FLAGS=${USE_SWIG_FLAGS}")
-message(STATUS "USE_SWIG_INCLUDEPATH=${USE_SWIG_INCLUDEPATH}")
-
-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)
-if (USE_SWIG_INCLUDEPATH)
- SET_SOURCE_FILES_PROPERTIES(${INTERFACE} PROPERTIES SWIG_FLAGS "-I${USE_SWIG_INCLUDEPATH};${USE_SWIG_FLAGS}")
-endif (USE_SWIG_INCLUDEPATH)
-
-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} ${CORE_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} )
-
-SET(CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS "${CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS} -DHAVE_INLINE")
-
-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)
-
-
Oops, something went wrong.

0 comments on commit bf7c707

Please sign in to comment.