From: <ai...@us...> - 2009-05-12 18:39:00
|
Revision: 9972 http://plplot.svn.sourceforge.net/plplot/?rev=9972&view=rev Author: airwin Date: 2009-05-12 18:38:50 +0000 (Tue, 12 May 2009) Log Message: ----------- Add f77 and f95 to CMake-based build of installed examples. Modified Paths: -------------- trunk/bindings/f77/CMakeLists.txt trunk/bindings/f95/CMakeLists.txt trunk/examples/CMakeLists.txt_installed_examples trunk/examples/f77/CMakeLists.txt trunk/examples/f95/CMakeLists.txt trunk/examples/plplot_configure.cmake_installed_examples.in Added Paths: ----------- trunk/examples/f77/CMakeLists.txt_installed_examples_f77 trunk/examples/f95/CMakeLists.txt_installed_examples_f95 Modified: trunk/bindings/f77/CMakeLists.txt =================================================================== --- trunk/bindings/f77/CMakeLists.txt 2009-05-12 17:55:16 UTC (rev 9971) +++ trunk/bindings/f77/CMakeLists.txt 2009-05-12 18:38:50 UTC (rev 9972) @@ -20,207 +20,223 @@ if(ENABLE_f77) -## Generate source files depending on type of PLFLT -## Note: Sed will possibly fail on windows. Would this be better -## done using the cmake configure_file option eventually? -if(PL_DOUBLE) - add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/sfstubs.f - COMMAND ${CMAKE_COMMAND} - -E copy ${CMAKE_CURRENT_SOURCE_DIR}/sfstubs.fm4 ${CMAKE_CURRENT_BINARY_DIR}/sfstubs.f - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/sfstubs.fm4 - ) -else(PL_DOUBLE) - add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/sfstubs.f - COMMAND sed - -f ${CMAKE_CURRENT_SOURCE_DIR}/double2single.sed ${CMAKE_CURRENT_SOURCE_DIR}/sfstubs.fm4 > ${CMAKE_CURRENT_BINARY_DIR}/sfstubs.f - DEPENDS - ${CMAKE_CURRENT_SOURCE_DIR}/double2single.sed - ${CMAKE_CURRENT_SOURCE_DIR}/sfstubs.fm4 - ) -endif(PL_DOUBLE) + ## Generate source files depending on type of PLFLT + ## Note: Sed will possibly fail on windows. Would this be better + ## done using the cmake configure_file option eventually? + if(PL_DOUBLE) + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/sfstubs.f + COMMAND ${CMAKE_COMMAND} + -E copy ${CMAKE_CURRENT_SOURCE_DIR}/sfstubs.fm4 ${CMAKE_CURRENT_BINARY_DIR}/sfstubs.f + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/sfstubs.fm4 + ) + else(PL_DOUBLE) + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/sfstubs.f + COMMAND sed + -f ${CMAKE_CURRENT_SOURCE_DIR}/double2single.sed ${CMAKE_CURRENT_SOURCE_DIR}/sfstubs.fm4 > ${CMAKE_CURRENT_BINARY_DIR}/sfstubs.f + DEPENDS + ${CMAKE_CURRENT_SOURCE_DIR}/double2single.sed + ${CMAKE_CURRENT_SOURCE_DIR}/sfstubs.fm4 + ) + endif(PL_DOUBLE) -if(WIN32) - # Set the flags for the C compiler. The C stubs need to have the - # correction case and calling convention for the Fortran compiler - IF(TARGET_FORTRAN MATCHES "IVF") - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /DIVF") - ELSEIF(TARGET_FORTRAN MATCHES "CVF") - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /DCVF") - ENDIF(TARGET_FORTRAN MATCHES "IVF") -endif(WIN32) + if(WIN32) + # Set the flags for the C compiler. The C stubs need to have the + # correction case and calling convention for the Fortran compiler + IF(TARGET_FORTRAN MATCHES "IVF") + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /DIVF") + ELSEIF(TARGET_FORTRAN MATCHES "CVF") + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /DCVF") + ENDIF(TARGET_FORTRAN MATCHES "IVF") + endif(WIN32) -if(F77_CMD_LINE) - set(HAVE_F77PARSE_CL_FALSE C) -else(F77_CMD_LINE) - set(HAVE_F77PARSE_CL_TRUE C) -endif(F77_CMD_LINE) + if(F77_CMD_LINE) + set(HAVE_F77PARSE_CL_FALSE C) + else(F77_CMD_LINE) + set(HAVE_F77PARSE_CL_TRUE C) + endif(F77_CMD_LINE) -configure_file( -${CMAKE_CURRENT_SOURCE_DIR}/configurable.f.cmake -${CMAKE_CURRENT_BINARY_DIR}/configurable.f -) -set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/configurable.f -PROPERTIES GENERATED ON) + configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/configurable.f.cmake + ${CMAKE_CURRENT_BINARY_DIR}/configurable.f + ) + set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/configurable.f + PROPERTIES GENERATED ON) -# Set the include path -include_directories( -${CMAKE_CURRENT_SOURCE_DIR} -${CMAKE_SOURCE_DIR}/lib/qsastime -${CMAKE_SOURCE_DIR}/include -${CMAKE_BINARY_DIR} -${CMAKE_BINARY_DIR}/include -) + # Set the include path + include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/lib/qsastime + ${CMAKE_SOURCE_DIR}/include + ${CMAKE_BINARY_DIR} + ${CMAKE_BINARY_DIR}/include + ) -## Build C part of F77 bindings -set(plplotf77c${LIB_TAG}_LIB_SRCS -sc3d.c -sccont.c -scstubs.c -) + ## Build C part of F77 bindings + set(plplotf77c${LIB_TAG}_LIB_SRCS + sc3d.c + sccont.c + scstubs.c + ) -if(BUILD_SHARED_LIBS) - SET_SOURCE_FILES_PROPERTIES( ${plplotf77c${LIB_TAG}_LIB_SRCS} + if(BUILD_SHARED_LIBS) + SET_SOURCE_FILES_PROPERTIES( ${plplotf77c${LIB_TAG}_LIB_SRCS} PROPERTIES COMPILE_FLAGS "-DUSINGDLL" ) -endif(BUILD_SHARED_LIBS) + endif(BUILD_SHARED_LIBS) -add_library(plplotf77c${LIB_TAG} ${plplotf77c${LIB_TAG}_LIB_SRCS}) + add_library(plplotf77c${LIB_TAG} ${plplotf77c${LIB_TAG}_LIB_SRCS}) -target_link_libraries(plplotf77c${LIB_TAG} plplot${LIB_TAG}) + target_link_libraries(plplotf77c${LIB_TAG} plplot${LIB_TAG}) -if(USE_RPATH) - get_target_property(LIB_INSTALL_RPATH plplot${LIB_TAG} INSTALL_RPATH) - set_target_properties(plplotf77c${LIB_TAG} - PROPERTIES - SOVERSION ${plplotf77_SOVERSION} - VERSION ${plplotf77_VERSION} - INSTALL_RPATH "${LIB_INSTALL_RPATH}" - INSTALL_NAME_DIR "${LIB_DIR}" - ) -else(USE_RPATH) - set_target_properties(plplotf77c${LIB_TAG} - PROPERTIES - SOVERSION ${plplotf77_SOVERSION} - VERSION ${plplotf77_VERSION} - INSTALL_NAME_DIR "${LIB_DIR}" - ) -endif(USE_RPATH) + if(USE_RPATH) + get_target_property(LIB_INSTALL_RPATH plplot${LIB_TAG} INSTALL_RPATH) + set_target_properties(plplotf77c${LIB_TAG} + PROPERTIES + SOVERSION ${plplotf77_SOVERSION} + VERSION ${plplotf77_VERSION} + INSTALL_RPATH "${LIB_INSTALL_RPATH}" + INSTALL_NAME_DIR "${LIB_DIR}" + ) + else(USE_RPATH) + set_target_properties(plplotf77c${LIB_TAG} + PROPERTIES + SOVERSION ${plplotf77_SOVERSION} + VERSION ${plplotf77_VERSION} + INSTALL_NAME_DIR "${LIB_DIR}" + ) + endif(USE_RPATH) -# Set the path and the suffix for the (shared) libraries -if(CYGWIN) - if(BUILD_SHARED_LIBS) - set(SHLIB_DIR "${BIN_DIR}") - endif(BUILD_SHARED_LIBS) - set(VERSION_SUFFIX "-${plplotf77_VERSION}") -else(CYGWIN) - set(VERSION_SUFFIX "") -endif(CYGWIN) + # Set the path and the suffix for the (shared) libraries + if(CYGWIN) + if(BUILD_SHARED_LIBS) + set(SHLIB_DIR "${BIN_DIR}") + endif(BUILD_SHARED_LIBS) + set(VERSION_SUFFIX "-${plplotf77_VERSION}") + else(CYGWIN) + set(VERSION_SUFFIX "") + endif(CYGWIN) -install(TARGETS plplotf77c${LIB_TAG} -ARCHIVE DESTINATION ${LIB_DIR} -LIBRARY DESTINATION ${LIB_DIR} -RUNTIME DESTINATION ${BIN_DIR} -) + install(TARGETS plplotf77c${LIB_TAG} + EXPORT export_plplot + ARCHIVE DESTINATION ${LIB_DIR} + LIBRARY DESTINATION ${LIB_DIR} + RUNTIME DESTINATION ${BIN_DIR} + ) -## Build fortran part of F77 bindings -if(STATIC_OPTS) - # Put the file configurable.f in a separate static library - set(plplotf77opts${LIB_TAG}_LIB_SRCS - configurable.f - ) - set(plplotf77${LIB_TAG}_LIB_SRCS - strutil.f - sfstubs.f - ) -else(STATIC_OPTS) - set(plplotf77${LIB_TAG}_LIB_SRCS - strutil.f - sfstubs.f - configurable.f - ) -endif(STATIC_OPTS) + ## Build fortran part of F77 bindings + if(STATIC_OPTS) + # Put the file configurable.f in a separate static library + set(plplotf77opts${LIB_TAG}_LIB_SRCS + configurable.f + ) + set(plplotf77${LIB_TAG}_LIB_SRCS + strutil.f + sfstubs.f + ) + else(STATIC_OPTS) + set(plplotf77${LIB_TAG}_LIB_SRCS + strutil.f + sfstubs.f + configurable.f + ) + endif(STATIC_OPTS) -if(WIN32 AND BUILD_SHARED_LIBS AND NOT CYGWIN AND NOT MINGW) - SET(plplotf77${LIB_TAG}_LIB_SRCS ${plplotf77${LIB_TAG}_LIB_SRCS} plplotf77.def) -endif(WIN32 AND BUILD_SHARED_LIBS AND NOT CYGWIN AND NOT MINGW) + if(WIN32 AND BUILD_SHARED_LIBS AND NOT CYGWIN AND NOT MINGW) + SET(plplotf77${LIB_TAG}_LIB_SRCS ${plplotf77${LIB_TAG}_LIB_SRCS} plplotf77.def) + endif(WIN32 AND BUILD_SHARED_LIBS AND NOT CYGWIN AND NOT MINGW) -add_library(plplotf77${LIB_TAG} ${plplotf77${LIB_TAG}_LIB_SRCS}) + add_library(plplotf77${LIB_TAG} ${plplotf77${LIB_TAG}_LIB_SRCS}) -if(STATIC_OPTS) - add_library(plplotf77opts${LIB_TAG} STATIC ${plplotf77opts${LIB_TAG}_LIB_SRCS}) - target_link_libraries(plplotf77${LIB_TAG} plplotf77c${LIB_TAG}) - target_link_libraries(plplotf77opts${LIB_TAG} plplotf77${LIB_TAG} plplotf77c${LIB_TAG}) -else(STATIC_OPTS) - target_link_libraries(plplotf77${LIB_TAG} plplotf77c${LIB_TAG}) -endif(STATIC_OPTS) + if(STATIC_OPTS) + add_library(plplotf77opts${LIB_TAG} STATIC ${plplotf77opts${LIB_TAG}_LIB_SRCS}) + target_link_libraries(plplotf77${LIB_TAG} plplotf77c${LIB_TAG}) + target_link_libraries(plplotf77opts${LIB_TAG} plplotf77${LIB_TAG} plplotf77c${LIB_TAG}) + else(STATIC_OPTS) + target_link_libraries(plplotf77${LIB_TAG} plplotf77c${LIB_TAG}) + endif(STATIC_OPTS) -if(USE_RPATH) - set_target_properties(plplotf77${LIB_TAG} - PROPERTIES - SOVERSION ${plplotf77_SOVERSION} - VERSION ${plplotf77_VERSION} - INSTALL_RPATH "${LIB_INSTALL_RPATH}" - INSTALL_NAME_DIR "${LIB_DIR}" - ) -else(USE_RPATH) - set_target_properties(plplotf77${LIB_TAG} - PROPERTIES - SOVERSION ${plplotf77_SOVERSION} - VERSION ${plplotf77_VERSION} - INSTALL_NAME_DIR "${LIB_DIR}" - ) -endif(USE_RPATH) + if(USE_RPATH) + set_target_properties(plplotf77${LIB_TAG} + PROPERTIES + SOVERSION ${plplotf77_SOVERSION} + VERSION ${plplotf77_VERSION} + INSTALL_RPATH "${LIB_INSTALL_RPATH}" + INSTALL_NAME_DIR "${LIB_DIR}" + ) + else(USE_RPATH) + set_target_properties(plplotf77${LIB_TAG} + PROPERTIES + SOVERSION ${plplotf77_SOVERSION} + VERSION ${plplotf77_VERSION} + INSTALL_NAME_DIR "${LIB_DIR}" + ) + endif(USE_RPATH) -install(TARGETS plplotf77${LIB_TAG} -ARCHIVE DESTINATION ${LIB_DIR} -LIBRARY DESTINATION ${LIB_DIR} -RUNTIME DESTINATION ${BIN_DIR} -) + install(TARGETS plplotf77${LIB_TAG} + EXPORT export_plplot + ARCHIVE DESTINATION ${LIB_DIR} + LIBRARY DESTINATION ${LIB_DIR} + RUNTIME DESTINATION ${BIN_DIR} + ) -# Configure pkg-config *.pc file corresponding to libplplotf77${LIB_TAG} -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 "f77:F77:F77 bindings, :plplotf77${LIB_TAG}${VERSION_SUFFIX}") + if(STATIC_OPTS) + install(TARGETS plplotf77opts${LIB_TAG} + EXPORT export_plplot + ARCHIVE DESTINATION ${LIB_DIR} + LIBRARY DESTINATION ${LIB_DIR} + RUNTIME DESTINATION ${BIN_DIR} + ) + endif(STATIC_OPTS) - 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} -lplplotf77c${LIB_TAG}${VERSION_SUFFIX} ${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}) -endif(PKG_CONFIG_EXECUTABLE) + install(EXPORT export_plplot + DESTINATION ${DATA_DIR}/examples/cmake/modules + FILE export_plplotf77.cmake + ) + + # Configure pkg-config *.pc file corresponding to libplplotf77${LIB_TAG} + 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 "f77:F77:F77 bindings, :plplotf77${LIB_TAG}${VERSION_SUFFIX}") + + 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} -lplplotf77c${LIB_TAG}${VERSION_SUFFIX} ${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}) + endif(PKG_CONFIG_EXECUTABLE) endif(ENABLE_f77) Modified: trunk/bindings/f95/CMakeLists.txt =================================================================== --- trunk/bindings/f95/CMakeLists.txt 2009-05-12 17:55:16 UTC (rev 9971) +++ trunk/bindings/f95/CMakeLists.txt 2009-05-12 18:38:50 UTC (rev 9972) @@ -99,17 +99,17 @@ endif(USE_RPATH) install(TARGETS plplotf95c${LIB_TAG} + EXPORT export_plplot ARCHIVE DESTINATION ${LIB_DIR} LIBRARY DESTINATION ${LIB_DIR} RUNTIME DESTINATION ${BIN_DIR} ) - ## Build fortran part of F95 bindings if(STATIC_OPTS) set(plplotf95opts${LIB_TAG}_LIB_SRCS configurable.f90 - ) + ) set(plplotf95${LIB_TAG}_LIB_SRCS strutil.f90 sfstubsf95.f90 @@ -170,11 +170,26 @@ endif(CYGWIN) install(TARGETS plplotf95${LIB_TAG} + EXPORT export_plplot ARCHIVE DESTINATION ${LIB_DIR} LIBRARY DESTINATION ${LIB_DIR} RUNTIME DESTINATION ${BIN_DIR} ) + if(STATIC_OPTS) + install(TARGETS plplotf95opts${LIB_TAG} + EXPORT export_plplot + ARCHIVE DESTINATION ${LIB_DIR} + LIBRARY DESTINATION ${LIB_DIR} + RUNTIME DESTINATION ${BIN_DIR} + ) + endif(STATIC_OPTS) + + install(EXPORT export_plplot + DESTINATION ${DATA_DIR}/examples/cmake/modules + FILE export_plplotf95.cmake + ) + # For CMake-2.6.0 and above, the module files are created by # default during the library build in the bindings/f95 directory. install( Modified: trunk/examples/CMakeLists.txt_installed_examples =================================================================== --- trunk/examples/CMakeLists.txt_installed_examples 2009-05-12 17:55:16 UTC (rev 9971) +++ trunk/examples/CMakeLists.txt_installed_examples 2009-05-12 18:38:50 UTC (rev 9972) @@ -30,4 +30,20 @@ include(export_plplot) add_subdirectory(c) -add_subdirectory(c++) + +if(ENABLE_cxx) + add_subdirectory(c++) +endif(ENABLE_cxx) + +if(ENABLE_f77) + add_subdirectory(f77) +endif(ENABLE_f77) + +if(ENABLE_f95) + add_subdirectory(f95) +endif(ENABLE_f95) + +if(ENABLE_d) + add_subdirectory(d) +endif(ENABLE_d) + Modified: trunk/examples/f77/CMakeLists.txt =================================================================== --- trunk/examples/f77/CMakeLists.txt 2009-05-12 17:55:16 UTC (rev 9971) +++ trunk/examples/f77/CMakeLists.txt 2009-05-12 18:38:50 UTC (rev 9972) @@ -132,3 +132,8 @@ DESTINATION ${DATA_DIR}/examples/f77 ) +install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt_installed_examples_f77 +DESTINATION ${DATA_DIR}/examples/f77 +RENAME CMakeLists.txt +) + Added: trunk/examples/f77/CMakeLists.txt_installed_examples_f77 =================================================================== --- trunk/examples/f77/CMakeLists.txt_installed_examples_f77 (rev 0) +++ trunk/examples/f77/CMakeLists.txt_installed_examples_f77 2009-05-12 18:38:50 UTC (rev 9972) @@ -0,0 +1,64 @@ +# f77/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(f77_STRING_INDICES +"01" +"02" +"03" +"04" +"05" +"06" +"07" +"08" +"09" +"10" +"11" +"12" +"13" +"14" +"15" +"16" +"16a" +"17" +"18" +"19" +"20" +"21" +"22" +"23" +"24" +"25" +"26" +"27" +"28" +"29" +"30" +"31" +) + +include_directories(${INCLUDE_DIR}) +foreach(STRING_INDEX ${f77_STRING_INDICES}) + add_executable(x${STRING_INDEX}f ${CMAKE_CURRENT_SOURCE_DIR}/x${STRING_INDEX}f.f) + if(STATIC_OPTS) + target_link_libraries(x${STRING_INDEX}f plplotf77opts${LIB_TAG} plplotf77${LIB_TAG}) + else(STATIC_OPTS) + target_link_libraries(x${STRING_INDEX}f plplotf77${LIB_TAG}) + endif(STATIC_OPTS) +endforeach(STRING_INDEX ${f77_STRING_INDICES}) Property changes on: trunk/examples/f77/CMakeLists.txt_installed_examples_f77 ___________________________________________________________________ Added: svn:eol-style + native Modified: trunk/examples/f95/CMakeLists.txt =================================================================== --- trunk/examples/f95/CMakeLists.txt 2009-05-12 17:55:16 UTC (rev 9971) +++ trunk/examples/f95/CMakeLists.txt 2009-05-12 18:38:50 UTC (rev 9972) @@ -114,3 +114,8 @@ DESTINATION ${DATA_DIR}/examples/f95 ) +install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt_installed_examples_f95 +DESTINATION ${DATA_DIR}/examples/f95 +RENAME CMakeLists.txt +) + Added: trunk/examples/f95/CMakeLists.txt_installed_examples_f95 =================================================================== --- trunk/examples/f95/CMakeLists.txt_installed_examples_f95 (rev 0) +++ trunk/examples/f95/CMakeLists.txt_installed_examples_f95 2009-05-12 18:38:50 UTC (rev 9972) @@ -0,0 +1,69 @@ +# f77/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(f77_STRING_INDICES +"01" +"02" +"03" +"04" +"05" +"06" +"07" +"08" +"09" +"10" +"11" +"12" +"13" +"14" +"15" +"16" +"16a" +"17" +"18" +"19" +"20" +"21" +"22" +"23" +"24" +"25" +"26" +"27" +"28" +"29" +"30" +"31" +) + +include_directories(${INCLUDE_DIR} ${F95_MOD_DIR}) +foreach(STRING_INDEX ${f77_STRING_INDICES}) + # Need unique target name + add_executable(x${STRING_INDEX}f95 x${STRING_INDEX}f.f90) + set_target_properties( + x${STRING_INDEX}f95 PROPERTIES + OUTPUT_NAME x${STRING_INDEX}f + ) + if(STATIC_OPTS) + target_link_libraries(x${STRING_INDEX}f95 plplotf95opts${LIB_TAG} plplotf95${LIB_TAG}) + else(STATIC_OPTS) + target_link_libraries(x${STRING_INDEX}f95 plplotf95${LIB_TAG}) + endif(STATIC_OPTS) +endforeach(STRING_INDEX ${f77_STRING_INDICES}) Property changes on: trunk/examples/f95/CMakeLists.txt_installed_examples_f95 ___________________________________________________________________ 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 17:55:16 UTC (rev 9971) +++ trunk/examples/plplot_configure.cmake_installed_examples.in 2009-05-12 18:38:50 UTC (rev 9972) @@ -2,3 +2,14 @@ # installed examples. set(LIB_TAG "@LIB_TAG@") set(INCLUDE_DIR @INCLUDE_DIR@) +set(ENABLE_cxx @ENABLE_cxx@) +set(ENABLE_f77 @ENABLE_f77@) +set(ENABLE_f95 @ENABLE_f95@) +if(ENABLE_F77 OR ENABLE_f95) + set(STATIC_OPTS @STATIC_OPTS@) + enable_language(Fortran) +endif(ENABLE_F77 OR ENABLE_f95) +if(ENABLE_f95) + set(F95_MOD_DIR @F95_MOD_DIR@) +endif(ENABLE_f95) +#set(ENABLE_d @ENABLE_d@) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |