|
From: <ai...@us...> - 2008-07-19 20:06:27
|
Revision: 8541
http://plplot.svn.sourceforge.net/plplot/?rev=8541&view=rev
Author: airwin
Date: 2008-07-19 20:03:20 +0000 (Sat, 19 Jul 2008)
Log Message:
-----------
Configure and install pkg-config file that will help with external
applications that want to use the ocaml bindings and which will eventually
be used to help build the install-tree ocaml examples.
Modified Paths:
--------------
trunk/bindings/ocaml/CMakeLists.txt
Modified: trunk/bindings/ocaml/CMakeLists.txt
===================================================================
--- trunk/bindings/ocaml/CMakeLists.txt 2008-07-19 18:48:22 UTC (rev 8540)
+++ trunk/bindings/ocaml/CMakeLists.txt 2008-07-19 20:03:20 UTC (rev 8541)
@@ -49,8 +49,50 @@
endforeach(OCAML_FILE ${OCAML_INSTALL_FILES})
# Configure the META file
+# Configure pkg-config *.pc file corresponding to plplot.cma
+if(PKG_CONFIG_EXECUTABLE)
+ if(LIB_TAG)
+ set(PC_PRECISION "double")
+ else(LIB_TAG)
+ set(PC_PRECISION "single")
+ endif(LIB_TAG)
+ # Each list element must consist of a colon-separated string with the
+ # following fields which are parsed out in the foreach loop below and
+ # used to configure the corresponding pkg-config *.pc file.
+ # BINDING - ENABLE_${BINDING} keeps track of whether a
+ # binding has been enabled (ON) or not (OFF).
+ # Also, ${BINDING} used to determine PC_FILE_SUFFIX
+ # which helps to determine name of configured
+ # *.pc file.
+ # PC_SHORT_NAME - Used in *.pc NAME: field
+ # PC_LONG_NAME - Used in *.pc Description: field
+ # PC_LIBRARY_NAME - Used in *.pc Libs: field
+ # Also used to determine PC_LINK_FLAGS and
+ # PC_COMPILE_FLAGS used in *.pc Libs: and Cflags:
+ # fields.
+ set(PC_DATA "ocaml:::plplot${LIB_TAG}")
+
+ string(REGEX REPLACE "^(.*):.*:.*:.*$" "\\1" BINDING ${PC_DATA})
+ set(PC_FILE_SUFFIX "-${BINDING}")
+ set(PC_REQUIRES "plplot${LIB_TAG}")
+ string(REGEX REPLACE "^.*:(.*):.*:.*$" "\\1" PC_SHORT_NAME ${PC_DATA})
+ string(REGEX REPLACE "^.*:.*:(.*):.*$" "\\1" PC_LONG_NAME ${PC_DATA})
+ string(REGEX REPLACE "^.*:.*:.*:(.*)$" "\\1" PC_LIBRARY_NAME ${PC_DATA})
+ set(PC_LINK_FLAGS "${lib${PC_LIBRARY_NAME}_LINK_FLAGS}")
+ set(PC_COMPILE_FLAGS "${lib${PC_LIBRARY_NAME}_COMPILE_FLAGS}")
+ set(PC_LINK_FLAGS "-l${PC_LIBRARY_NAME} ${PC_LINK_FLAGS}")
+ set(PC_CONFIGURED_FILE
+ ${CMAKE_BINARY_DIR}/pkgcfg/plplot${LIB_TAG}${PC_FILE_SUFFIX}.pc
+ )
+ configure_file(
+ ${CMAKE_SOURCE_DIR}/pkgcfg/plplot-template.pc.cmake
+ ${PC_CONFIGURED_FILE}
+ @ONLY
+ )
+ install(FILES ${PC_CONFIGURED_FILE} DESTINATION ${PKG_CONFIG_DIR})
configure_file(META.cmake ${CMAKE_CURRENT_BINARY_DIR}/META)
-
+endif(PKG_CONFIG_EXECUTABLE)
+
# Configure the file controlling the ocamlbuild process
configure_file(myocamlbuild.ml.cmake ${CMAKE_CURRENT_BINARY_DIR}/myocamlbuild.ml)
set(DEPENDS_LIST ${GEN_SOURCE_LIST})
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|