From: <ai...@us...> - 2009-05-23 19:53:12
|
Revision: 9993 http://plplot.svn.sourceforge.net/plplot/?rev=9993&view=rev Author: airwin Date: 2009-05-23 19:53:06 +0000 (Sat, 23 May 2009) Log Message: ----------- Build and test ocaml examples with new CMake-based build system for the installed examples tree. Modified Paths: -------------- trunk/examples/CMakeLists.txt_installed_examples trunk/examples/ocaml/CMakeLists.txt trunk/examples/plplot_configure.cmake_installed_examples.in Added Paths: ----------- trunk/examples/ocaml/CMakeLists.txt_installed_examples_ocaml Modified: trunk/examples/CMakeLists.txt_installed_examples =================================================================== --- trunk/examples/CMakeLists.txt_installed_examples 2009-05-23 19:03:07 UTC (rev 9992) +++ trunk/examples/CMakeLists.txt_installed_examples 2009-05-23 19:53:06 UTC (rev 9993) @@ -71,10 +71,16 @@ if(ENABLE_lua) add_subdirectory(lua) - get_property(targets_examples_java GLOBAL PROPERTY TARGETS_examples_lua) + get_property(targets_examples_lua GLOBAL PROPERTY TARGETS_examples_lua) list(APPEND language_info_LIST lua:lua) endif(ENABLE_lua) +if(ENABLE_ocaml) + add_subdirectory(ocaml) + get_property(targets_examples_ocaml GLOBAL PROPERTY TARGETS_examples_ocaml) + list(APPEND language_info_LIST ocaml:ocaml) +endif(ENABLE_ocaml) + if(ENABLE_pdl) list(APPEND language_info_LIST perl:pdl) endif(ENABLE_pdl) Modified: trunk/examples/ocaml/CMakeLists.txt =================================================================== --- trunk/examples/ocaml/CMakeLists.txt 2009-05-23 19:03:07 UTC (rev 9992) +++ trunk/examples/ocaml/CMakeLists.txt 2009-05-23 19:53:06 UTC (rev 9993) @@ -105,3 +105,9 @@ DESTINATION ${DATA_DIR}/examples/ocaml RENAME Makefile ) + +install(FILES CMakeLists.txt_installed_examples_ocaml + DESTINATION ${DATA_DIR}/examples/ocaml + RENAME CMakeLists.txt + ) + Added: trunk/examples/ocaml/CMakeLists.txt_installed_examples_ocaml =================================================================== --- trunk/examples/ocaml/CMakeLists.txt_installed_examples_ocaml (rev 0) +++ trunk/examples/ocaml/CMakeLists.txt_installed_examples_ocaml 2009-05-23 19:53:06 UTC (rev 9993) @@ -0,0 +1,86 @@ +# -*- mode: cmake -*- +# ocaml/CMakeLists.txt for installed PLplot examples +### Process this file with cmake to produce Makefile +# +# +# Copyright (C) 2009 Alan W. Irwin +# +# This file is part of PLplot. +# +# PLplot is free software; you can redistribute it and/or modify +# it under the terms of the GNU Library General Public License as published +# by the Free Software Foundation; version 2 of the License. +# +# PLplot is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Library General Public License for more details. +# +# You should have received a copy of the GNU Library General Public License +# along with PLplot; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +set(ocaml_STRING_INDICES + "01" + "02" + "03" + "04" + "05" + "06" + "07" + "08" + "09" + "10" + "11" + "12" + "13" + "14" + "15" + "16" + "17" + "18" + "19" + "20" + "21" + "22" + "23" + "24" + "25" + "26" + "27" + "28" + "29" + "30" + "31" + ) + +foreach(STRING_INDEX ${ocaml_STRING_INDICES}) + set(EXECUTABLE_NAME x${STRING_INDEX}ocaml) + set(SOURCE_FILE x${STRING_INDEX}.ml) + # Copy source code to build tree since ocamlc is a bit broken and will + # otherwise litter the source tree with intermediate files + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${SOURCE_FILE} + COMMAND ${CMAKE_COMMAND} + -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/${SOURCE_FILE} ${CMAKE_CURRENT_BINARY_DIR}/${SOURCE_FILE} + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${SOURCE_FILE} + ) + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${EXECUTABLE_NAME} + COMMAND ${OCAMLC} + -g + -I ${OCAML_INSTALL_DIR}/plplot + -ccopt "-L ${CMAKE_INSTALL_LIBDIR} -Wl,-rpath -Wl,${CMAKE_INSTALL_LIBDIR} " + plplot.cma + -o ${CMAKE_CURRENT_BINARY_DIR}/${EXECUTABLE_NAME} + ${CMAKE_CURRENT_BINARY_DIR}/${SOURCE_FILE} + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${SOURCE_FILE} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + VERBATIM + ) + add_custom_target( + target_${EXECUTABLE_NAME} ALL + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${EXECUTABLE_NAME} + ) + set_property(GLOBAL APPEND PROPERTY TARGETS_examples_ocaml target_${EXECUTABLE_NAME}) +endforeach(STRING_INDEX ${ocaml_STRING_INDICES}) Property changes on: trunk/examples/ocaml/CMakeLists.txt_installed_examples_ocaml ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/examples/plplot_configure.cmake_installed_examples.in =================================================================== --- trunk/examples/plplot_configure.cmake_installed_examples.in 2009-05-23 19:03:07 UTC (rev 9992) +++ trunk/examples/plplot_configure.cmake_installed_examples.in 2009-05-23 19:53:06 UTC (rev 9993) @@ -12,6 +12,7 @@ set(ENABLE_f95 @ENABLE_f95@) set(ENABLE_java @ENABLE_java@) set(ENABLE_lua @ENABLE_lua@) +set(ENABLE_ocaml @ENABLE_ocaml@) set(ENABLE_pdl @ENABLE_pdl@) # Always enable C language. @@ -46,3 +47,8 @@ set(JAR_DIR @JAR_DIR@) endif(ENABLE_java) +if(ENABLE_ocaml) + set(OCAMLC @OCAMLC@) + set(CMAKE_INSTALL_LIBDIR @CMAKE_INSTALL_LIBDIR@) + set(OCAML_INSTALL_DIR @OCAML_INSTALL_DIR@) +endif(ENABLE_ocaml) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |