Permalink
Browse files

Making cmake modules generic

  • Loading branch information...
1 parent df9c82f commit 92b31b8696a8270180babc5854c09f4a8f26246a @pjotrp pjotrp committed Apr 5, 2009
View
1 PROJECTNAME
@@ -0,0 +1 @@
+ASciLib
View
12 cmake_modules/FindMap.cmake
@@ -1,7 +1,7 @@
-# - Find MAPPING settings
+# Global MAPPING settings
#
-# ---- Get MAP root
+# ---- Get MAP source root directory
get_filename_component(MAP_ROOT ${CMAKE_MODULE_PATH} PATH)
SET(MAP_CLIBS_PATH ${MAP_ROOT}/src/clibs)
@@ -14,8 +14,11 @@ IF(WIN32)
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)
-# ---- Add a predefinde build variable
+string(TOLOWER ${MAP_PROJECTNAME} MAP_projectname)
+
+# ---- Add a predefined build variable
add_definitions(-DMAP_BUILD)
# ---- Set default installation prefix
@@ -44,12 +47,13 @@ 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)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(xRLibs DEFAULT_MSG MAP_VERSION MAP_projectname)
MARK_AS_ADVANCED(
MAP_ROOT
View
12 cmake_modules/FindMapModule.cmake
@@ -19,22 +19,24 @@ IF(M_VERSION)
ENDIF(M_VERSION)
# ---- Find the shared library include and lib path
-SET (MODULE_SOURCE_PATH ${BIOLIB_CLIBS_PATH}/${MODULE_NAME})
+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})
-MESSAGE("Looking for libbiolib_${M_NAME}-${BIOLIB_VERSION}.so")
+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 biolib_${M_NAME}-${BIOLIB_VERSION})
+ 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 libbiolib_${M_NAME}-${BIOLIB_VERSION}.so PATHS ${MODULE_SOURCE_PATH} ${MODULE_SOURCE_PATH}/build ${MODULE_SOURCE_PATH}/src)
+ 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)
@@ -44,6 +46,8 @@ IF(USE_INCLUDEPATH)
INCLUDE_DIRECTORIES(${MODULE_SOURCE_PATH}/${USE_INCLUDEPATH})
ENDIF(USE_INCLUDEPATH)
+# UNSET(_LIBNAME)
+
MARK_AS_ADVANCED(
MODULE_SOURCE_PATH
MODULE_LIBRARY
View
6 cmake_modules/FindMapPerl.cmake
@@ -9,12 +9,12 @@
# 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
+# USE_CORE - link the core lib
SET (M_MODULE ${M_NAME})
message("Creating Perl module ${M_MODULE} (${M_VERSION})")
-FIND_PACKAGE(MapLib REQUIRED)
+FIND_PACKAGE(Map REQUIRED)
FIND_PACKAGE(PerlLibs REQUIRED)
# ---- Setting the default Perl include path
@@ -26,7 +26,7 @@ FIND_PACKAGE(MapLibraries REQUIRED)
SET (USE_LANGUAGE "perl")
SET (USE_LANGUAGE_LIBRARY ${PERL_LIBRARY})
-FIND_PACKAGE(ASciLibSWIG REQUIRED)
+FIND_PACKAGE(MapSWIG REQUIRED)
MARK_AS_ADVANCED (
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(MapPerl REQUIRED)
ADD_CUSTOM_COMMAND(
TARGET ${M_MODULE}

0 comments on commit 92b31b8

Please sign in to comment.