From: <ai...@us...> - 2009-08-05 02:00:10
|
Revision: 10212 http://plplot.svn.sourceforge.net/plplot/?rev=10212&view=rev Author: airwin Date: 2009-08-05 01:59:38 +0000 (Wed, 05 Aug 2009) Log Message: ----------- Use same CMakeLists.txt file for the core build (if BUILD_TEST=ON) and install of the Ada examples and the install-tree build of the Ada examples. Modified Paths: -------------- trunk/examples/ada/CMakeLists.txt Removed Paths: ------------- trunk/examples/ada/CMakeLists.txt_installed_examples_ada Modified: trunk/examples/ada/CMakeLists.txt =================================================================== --- trunk/examples/ada/CMakeLists.txt 2009-08-05 01:40:49 UTC (rev 10211) +++ trunk/examples/ada/CMakeLists.txt 2009-08-05 01:59:38 UTC (rev 10212) @@ -1,7 +1,7 @@ # examples/ada/CMakeLists.txt ### Process this file with cmake to produce Makefile ### -# Copyright (C) 2007 Alan W. Irwin +# Copyright (C) 2007, 2008, 2009 Alan W. Irwin # # This file is part of PLplot. # @@ -18,6 +18,12 @@ # along with PLplot; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# N.B. This file is used for both the core build (which installs the examples +# and optionally [depending on BUILD_TEST} builds them) and the installed +# examples build. The core build has BUILD_TEST OFF or ON at user option +# and CORE_BUILD always ON. The installed examples build always has +# BUILD_TEST ON and CORE_BUILD OFF. + set(ada_STRING_INDICES "01" "02" @@ -84,71 +90,86 @@ ) if(BUILD_TEST) - remove_definitions("-DHAVE_CONFIG_H") - include_directories( - ${CMAKE_BINARY_DIR}/examples/ada - ${CMAKE_BINARY_DIR}/bindings/ada - ) + if(CORE_BUILD) + remove_definitions("-DHAVE_CONFIG_H") + include_directories( + ${CMAKE_BINARY_DIR}/examples/ada + ${CMAKE_BINARY_DIR}/bindings/ada + ) + else(CORE_BUILD) + include_directories(${INCLUDE_DIR} ${ADA_INCLUDE_DIR}) + endif(CORE_BUILD) endif(BUILD_TEST) -foreach(STRING_INDEX ${ada_STRING_INDICES}) - set(TARGET_NAME x${STRING_INDEX}a) - set(SOURCE_FILE x${STRING_INDEX}a.adb) - configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/${SOURCE_FILE}.cmake - ${CMAKE_CURRENT_BINARY_DIR}/${SOURCE_FILE} - ) - # Build up list of full-path examples source names to be used (eventually - # but not until this interface has matured) for installation. - list(APPEND ada_SRCS ${CMAKE_CURRENT_BINARY_DIR}/${SOURCE_FILE}) - if(BUILD_TEST) - # 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_BINARY_DIR}/${SOURCE_FILE} - ) + +if(CORE_BUILD) + foreach(STRING_INDEX ${ada_STRING_INDICES}) + set(SOURCE_FILE x${STRING_INDEX}a.adb) + configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/${SOURCE_FILE}.cmake + ${CMAKE_CURRENT_BINARY_DIR}/${SOURCE_FILE} + ) + list(APPEND ada_SRCS ${CMAKE_CURRENT_BINARY_DIR}/${SOURCE_FILE}) + endforeach(STRING_INDEX ${ada_STRING_INDICES}) +endif(CORE_BUILD) + +if(BUILD_TEST) + # The first -aI option in adalinkflags is required to find <TARGET>.adb + # (see comment below). The second -aI option gives access to the + # libplplotada spec files. The -aL option gives access to the + # libplplotada *.ali files. (That location currently works but is + # probably not guaranteed indefinitely for future versions of + # CMake.) - # 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 libplplotada *.ali files. - # (That location currently works but is probably not guaranteed - # indefinitely for future versions of CMake.) - - set_target_properties( - ${TARGET_NAME} - PROPERTIES - LINK_FLAGS - "-aI${CMAKE_BINARY_DIR}/examples/ada -aI${CMAKE_BINARY_DIR}/bindings/ada -aL${CMAKE_BINARY_DIR}/bindings/ada/CMakeFiles/plplotada${LIB_TAG}.dir" - ) + if(CORE_BUILD) + set(adalinkflags "-aI${CMAKE_BINARY_DIR}/examples/ada -aI${CMAKE_BINARY_DIR}/bindings/ada -aL${CMAKE_BINARY_DIR}/bindings/ada/CMakeFiles/plplotada${LIB_TAG}.dir") + else(CORE_BUILD) + set(adalinkflags "-aI${CMAKE_SOURCE_DIR}/ada -aI${ADA_INCLUDE_DIR} -aL${ADA_LIB_DIR}") + endif(CORE_BUILD) + + foreach(STRING_INDEX ${ada_STRING_INDICES}) + set(TARGET_NAME x${STRING_INDEX}a) + set(SOURCE_FILE x${STRING_INDEX}a.adb) + + if(CORE_BUILD) + set(adasrcfile ${CMAKE_CURRENT_BINARY_DIR}/${SOURCE_FILE}) + else(CORE_BUILD) + set(adasrcfile ${CMAKE_CURRENT_SOURCE_DIR}/${SOURCE_FILE}) + endif(CORE_BUILD) + + # Note due to limitations of the Ada language support for CMake, + # 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 above comment of adalinkflags). + add_executable(${TARGET_NAME} ${adasrcfile}) + + set_target_properties(${TARGET_NAME} PROPERTIES LINK_FLAGS ${adalinkflags}) target_link_libraries(${TARGET_NAME} plplotada${LIB_TAG}) + set_property(GLOBAL APPEND PROPERTY TARGETS_examples_ada ${TARGET_NAME}) list(APPEND ada_extra_clean_files "${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}.o;${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}.ali") - endif(BUILD_TEST) -endforeach(STRING_INDEX ${ada_STRING_INDICES}) + endforeach(STRING_INDEX ${ada_STRING_INDICES}) -if(BUILD_TEST) -SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${ada_extra_clean_files}") + set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${ada_extra_clean_files}") endif(BUILD_TEST) -install(FILES ${ada_SRCS} DESTINATION ${DATA_DIR}/examples/ada) +if(CORE_BUILD) + install(FILES ${ada_SRCS} DESTINATION ${DATA_DIR}/examples/ada) -configure_file( -${CMAKE_CURRENT_SOURCE_DIR}/Makefile.examples.in -${CMAKE_CURRENT_BINARY_DIR}/Makefile.examples -) + configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/Makefile.examples.in + ${CMAKE_CURRENT_BINARY_DIR}/Makefile.examples + ) -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/Makefile.examples -DESTINATION ${DATA_DIR}/examples/ada -RENAME Makefile -) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/Makefile.examples + DESTINATION ${DATA_DIR}/examples/ada + RENAME Makefile + ) -install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt_installed_examples_ada -DESTINATION ${DATA_DIR}/examples/ada -RENAME CMakeLists.txt -) - + install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt + DESTINATION ${DATA_DIR}/examples/ada + ) +endif(CORE_BUILD) Deleted: trunk/examples/ada/CMakeLists.txt_installed_examples_ada =================================================================== --- trunk/examples/ada/CMakeLists.txt_installed_examples_ada 2009-08-05 01:40:49 UTC (rev 10211) +++ trunk/examples/ada/CMakeLists.txt_installed_examples_ada 2009-08-05 01:59:38 UTC (rev 10212) @@ -1,116 +0,0 @@ -# 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}) - set_property(GLOBAL APPEND PROPERTY TARGETS_examples_ada ${TARGET_NAME}) -endforeach(STRING_INDEX ${ada_STRING_INDICES}) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |