From: <ai...@us...> - 2009-05-12 22:50:57
|
Revision: 9976 http://plplot.svn.sourceforge.net/plplot/?rev=9976&view=rev Author: airwin Date: 2009-05-12 22:50:43 +0000 (Tue, 12 May 2009) Log Message: ----------- Add Ada examples to new CMake-based build system for installed examples. Modified Paths: -------------- trunk/bindings/ada/CMakeLists.txt trunk/examples/CMakeLists.txt_installed_examples trunk/examples/ada/CMakeLists.txt trunk/examples/plplot_configure.cmake_installed_examples.in Added Paths: ----------- trunk/examples/ada/CMakeLists.txt_installed_examples_ada Modified: trunk/bindings/ada/CMakeLists.txt =================================================================== --- trunk/bindings/ada/CMakeLists.txt 2009-05-12 21:52:53 UTC (rev 9975) +++ trunk/bindings/ada/CMakeLists.txt 2009-05-12 22:50:43 UTC (rev 9976) @@ -21,15 +21,15 @@ if(ENABLE_ada) set(SOURCE_LIST - plplot.adb - plplot.ads - plplot_thin.adb - plplot_thin.ads - plplot_traditional.adb - plplot_traditional.ads - plplot_auxiliary.adb - plplot_auxiliary.ads - ) + plplot.adb + plplot.ads + plplot_thin.adb + plplot_thin.ads + plplot_traditional.adb + plplot_traditional.ads + plplot_auxiliary.adb + plplot_auxiliary.ads + ) # These are Ada library information files built by gnat. I am not # sure whether the name suffixes correspond to the *.adb or *.ads files @@ -38,67 +38,73 @@ # N.B. the absolute location prefix of these files may have to be changed # in the future since this is a CMake internal. set(ALI_PREFIX - ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/plplotada${LIB_TAG}.dir - ) + ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/plplotada${LIB_TAG}.dir + ) set(ALI_LIST - ${ALI_PREFIX}/plplot.ali - ${ALI_PREFIX}/plplot_thin.ali - ${ALI_PREFIX}/plplot_traditional.ali - ${ALI_PREFIX}/plplot_auxiliary.ali - ) + ${ALI_PREFIX}/plplot.ali + ${ALI_PREFIX}/plplot_thin.ali + ${ALI_PREFIX}/plplot_traditional.ali + ${ALI_PREFIX}/plplot_auxiliary.ali + ) set(plplotada${LIB_TAG}_LIB_SRCS) foreach(SOURCE_FILE ${SOURCE_LIST}) configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/${SOURCE_FILE}.cmake - ${CMAKE_CURRENT_BINARY_DIR}/${SOURCE_FILE} - ) + ${CMAKE_CURRENT_SOURCE_DIR}/${SOURCE_FILE}.cmake + ${CMAKE_CURRENT_BINARY_DIR}/${SOURCE_FILE} + ) list(APPEND plplotada${LIB_TAG}_LIB_SRCS - ${CMAKE_CURRENT_BINARY_DIR}/${SOURCE_FILE} - ) + ${CMAKE_CURRENT_BINARY_DIR}/${SOURCE_FILE} + ) endforeach(SOURCE_FILE ${SOURCE_LIST}) add_library(plplotada${LIB_TAG} ${plplotada${LIB_TAG}_LIB_SRCS}) target_link_libraries(plplotada${LIB_TAG} - plplot${LIB_TAG} ${GNAT_LIB} - ) + plplot${LIB_TAG} ${GNAT_LIB} + ) if(USE_RPATH) get_target_property(LIB_INSTALL_RPATH plplot${LIB_TAG} INSTALL_RPATH) set_target_properties(plplotada${LIB_TAG} - PROPERTIES - SOVERSION ${plplotada_SOVERSION} - VERSION ${plplotada_VERSION} - INSTALL_RPATH "${LIB_INSTALL_RPATH}" - INSTALL_NAME_DIR "${LIB_DIR}" - ) + PROPERTIES + SOVERSION ${plplotada_SOVERSION} + VERSION ${plplotada_VERSION} + INSTALL_RPATH "${LIB_INSTALL_RPATH}" + INSTALL_NAME_DIR "${LIB_DIR}" + ) else(USE_RPATH) set_target_properties(plplotada${LIB_TAG} - PROPERTIES - SOVERSION ${plplotada_SOVERSION} - VERSION ${plplotada_VERSION} - INSTALL_NAME_DIR "${LIB_DIR}" - ) + PROPERTIES + SOVERSION ${plplotada_SOVERSION} + VERSION ${plplotada_VERSION} + INSTALL_NAME_DIR "${LIB_DIR}" + ) endif(USE_RPATH) install(FILES ${plplotada${LIB_TAG}_LIB_SRCS} - DESTINATION ${ADA_INCLUDE_DIR} - ) + DESTINATION ${ADA_INCLUDE_DIR} + ) # Permissions of *.ali files in accordance with # http://www.ada-france.org/debian/debian-ada-policy.html install(FILES ${ALI_LIST} - DESTINATION ${ADA_LIB_DIR} - PERMISSIONS OWNER_READ GROUP_READ WORLD_READ - ) + DESTINATION ${ADA_LIB_DIR} + PERMISSIONS OWNER_READ GROUP_READ WORLD_READ + ) install(TARGETS plplotada${LIB_TAG} - ARCHIVE DESTINATION ${LIB_DIR} - LIBRARY DESTINATION ${LIB_DIR} - RUNTIME DESTINATION ${BIN_DIR} - ) + EXPORT export_plplot + ARCHIVE DESTINATION ${LIB_DIR} + LIBRARY DESTINATION ${LIB_DIR} + RUNTIME DESTINATION ${BIN_DIR} + ) + install(EXPORT export_plplot + DESTINATION ${DATA_DIR}/examples/cmake/modules + FILE export_plplotada.cmake + ) + # Configure pkg-config *.pc file corresponding to libplplotada${LIB_TAG} if(PKG_CONFIG_EXECUTABLE) if(LIB_TAG) @@ -121,7 +127,7 @@ # PC_COMPILE_FLAGS used in *.pc Libs: and Cflags: # fields. set(PC_DATA "ada:Ada:Ada bindings, :plplotada${LIB_TAG}") - + string(REGEX REPLACE "^(.*):.*:.*:.*$" "\\1" BINDING ${PC_DATA}) set(PC_FILE_SUFFIX "-${BINDING}") set(PC_REQUIRES "plplot${LIB_TAG}") @@ -132,13 +138,13 @@ 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 - ) + ${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 - ) + ${CMAKE_SOURCE_DIR}/pkgcfg/plplot-template.pc.cmake + ${PC_CONFIGURED_FILE} + @ONLY + ) install(FILES ${PC_CONFIGURED_FILE} DESTINATION ${PKG_CONFIG_DIR}) endif(PKG_CONFIG_EXECUTABLE) Modified: trunk/examples/CMakeLists.txt_installed_examples =================================================================== --- trunk/examples/CMakeLists.txt_installed_examples 2009-05-12 21:52:53 UTC (rev 9975) +++ trunk/examples/CMakeLists.txt_installed_examples 2009-05-12 22:50:43 UTC (rev 9976) @@ -47,3 +47,7 @@ add_subdirectory(d) endif(ENABLE_d) +if(ENABLE_ada) + add_subdirectory(ada) +endif(ENABLE_ada) + Modified: trunk/examples/ada/CMakeLists.txt =================================================================== --- trunk/examples/ada/CMakeLists.txt 2009-05-12 21:52:53 UTC (rev 9975) +++ trunk/examples/ada/CMakeLists.txt 2009-05-12 22:50:43 UTC (rev 9976) @@ -147,3 +147,8 @@ RENAME Makefile ) +install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt_installed_examples_ada +DESTINATION ${DATA_DIR}/examples/ada +RENAME CMakeLists.txt +) + Added: trunk/examples/ada/CMakeLists.txt_installed_examples_ada =================================================================== --- trunk/examples/ada/CMakeLists.txt_installed_examples_ada (rev 0) +++ trunk/examples/ada/CMakeLists.txt_installed_examples_ada 2009-05-12 22:50:43 UTC (rev 9976) @@ -0,0 +1,115 @@ +# ada/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(ada_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" + "thick01" + "thick02" + "thick03" + "thick04" + "thick05" + "thick06" + "thick07" + "thick08" + "thick09" + "thick10" + "thick11" + "thick12" + "thick13" + "thick14" + "thick15" + "thick16" + "thick17" + "thick18" + "thick19" + "thick20" + "thick21" + "thick22" + "thick23" + "thick24" + "thick25" + "thick26" + "thick27" + "thick28" + "thick29" + "thick30" + "thick31" + ) + +include_directories(${INCLUDE_DIR} ${ADA_INCLUDE_DIR}) +foreach(STRING_INDEX ${ada_STRING_INDICES}) + set(TARGET_NAME x${STRING_INDEX}a) + set(SOURCE_FILE x${STRING_INDEX}a.adb) + # Note due to limitations of the Ada language support for CMake, the the + # nominal source file for add_executable is compiled (which is why a + # real file has to be specified), but otherwise it is ignored except for + # its .adb suffix which identifies the Ada language. The actual source + # file name for the internal gnatmake command that creates the + # executable is constructed from <TARGET>.adb. Since no directory can + # be specified from this construction (don't ask), you must specify the + # directory of <TARGET>.adb with a -aI option (see below). + add_executable( + ${TARGET_NAME} + ${CMAKE_CURRENT_SOURCE_DIR}/${SOURCE_FILE} + ) + + # The first -aI option is required to find <TARGET>.adb (see above + # comment). The second -aI option gives access to the libplplotada spec + # files. The -aL option gives access to the installed libplplotada + # *.ali files. + + set_target_properties( + ${TARGET_NAME} + PROPERTIES + LINK_FLAGS + "-aI${CMAKE_SOURCE_DIR}/ada -aI${ADA_INCLUDE_DIR} -aL${ADA_LIB_DIR}" + ) + target_link_libraries(${TARGET_NAME} plplotada${LIB_TAG}) +endforeach(STRING_INDEX ${ada_STRING_INDICES}) Property changes on: trunk/examples/ada/CMakeLists.txt_installed_examples_ada ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/examples/plplot_configure.cmake_installed_examples.in =================================================================== --- trunk/examples/plplot_configure.cmake_installed_examples.in 2009-05-12 21:52:53 UTC (rev 9975) +++ trunk/examples/plplot_configure.cmake_installed_examples.in 2009-05-12 22:50:43 UTC (rev 9976) @@ -2,6 +2,7 @@ # installed examples. set(LIB_TAG "@LIB_TAG@") set(INCLUDE_DIR @INCLUDE_DIR@) +set(MATH_LIB @MATH_LIB@) set(ENABLE_cxx @ENABLE_cxx@) set(ENABLE_f77 @ENABLE_f77@) set(ENABLE_f95 @ENABLE_f95@) @@ -16,3 +17,9 @@ if(ENABLE_d) enable_language(D) endif(ENABLE_d) +set(ENABLE_ada @ENABLE_ada@) +if(ENABLE_ada) + enable_language(Ada) + set(ADA_INCLUDE_DIR @ADA_INCLUDE_DIR@) + set(ADA_LIB_DIR @ADA_LIB_DIR@) +endif(ENABLE_ada) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |