Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Allow "installation" of the examples in buld system.

  • Loading branch information...
commit b1a397a9fc942386e2e41ebe9b09d0cdc1c4ac10 1 parent 57d4994
@jtappin jtappin authored
Showing with 63 additions and 0 deletions.
  1. +9 −0 INSTALL
  2. +42 −0 examples/CMakeLists.txt
  3. +12 −0 plplot/CMakeLists.txt
View
9 INSTALL
@@ -18,6 +18,15 @@ cmake variables are set by using -D<variable>=<value>
for example to change the default install directory from /usr/local to /usr:
cmake -DCMAKE_INSTALL_DIR=/usr ..
+Useful variables that are specific to gtk-fortran are:
+ EXCLUDE_PLPLOT -- set this to disable building the plplot
+ integration even if plplot is found
+ INSTALL_EXAMPLES -- set this to install the source code of the
+ examples into
+ ${CMAKE_INSTALL_DATAROOTDIR/gtk-fortran/examples<gtkversion>,
+ this would for example be useful if you were making a binary
+ package of gtk-fortran.
+
To interactively control the build, use 'ccmake' in place of 'cmake'
**************************************************************************
View
42 examples/CMakeLists.txt
@@ -180,3 +180,45 @@ add_test(notebooks ./notebooks)
add_executable(tests "tests.f90")
target_link_libraries(tests gtk-fortran_static ${GTK_LIBRARIES})
add_test(tests ./tests)
+
+# If the INSTALL_EXAMPLES variable is set, then copy the examples
+# to ${CMAKE_INSTALL_DATAROOTDIR/gtk-fortran/examples<gtkversion>
+# useful (e.g.) for building binary packages.
+if (INSTALL_EXAMPLES)
+ install(FILES
+ "${CMAKE_CURRENT_SOURCE_DIR}/bazaar.f90"
+ "${CMAKE_CURRENT_SOURCE_DIR}/cairo-tests.f90"
+ "${CMAKE_CURRENT_SOURCE_DIR}/cairo-basics.f90"
+ "${CMAKE_CURRENT_SOURCE_DIR}/cairo-basics-click.f90"
+ "${CMAKE_CURRENT_SOURCE_DIR}/gtkhello2.f90"
+ "${CMAKE_CURRENT_SOURCE_DIR}/gtkbuilder.f90"
+ "${CMAKE_CURRENT_SOURCE_DIR}/gtkbuilder2.f90"
+ "${CMAKE_CURRENT_SOURCE_DIR}/gtkbuilder.glade"
+ "${CMAKE_CURRENT_SOURCE_DIR}/hl_cairo1.f90"
+ "${CMAKE_CURRENT_SOURCE_DIR}/hl_cairo_clock.f90"
+ "${CMAKE_CURRENT_SOURCE_DIR}/hl_choosers.f90"
+ "${CMAKE_CURRENT_SOURCE_DIR}/hl_combo.f90"
+ "${CMAKE_CURRENT_SOURCE_DIR}/hl_containers.f90"
+ "${CMAKE_CURRENT_SOURCE_DIR}/hl_dialog.f90"
+ "${CMAKE_CURRENT_SOURCE_DIR}/hl_list1.f90"
+ "${CMAKE_CURRENT_SOURCE_DIR}/hl_list_n.f90"
+ "${CMAKE_CURRENT_SOURCE_DIR}/hl_list_renderers.f90"
+ "${CMAKE_CURRENT_SOURCE_DIR}/hl_menu.f90"
+ "${CMAKE_CURRENT_SOURCE_DIR}/hl_pbar.f90"
+ "${CMAKE_CURRENT_SOURCE_DIR}/hl_pbar_p.f90"
+ "${CMAKE_CURRENT_SOURCE_DIR}/hl_radio.f90"
+ "${CMAKE_CURRENT_SOURCE_DIR}/hl_sliders.f90"
+ "${CMAKE_CURRENT_SOURCE_DIR}/hl_sliders2.f90"
+ "${CMAKE_CURRENT_SOURCE_DIR}/hl_textview.f90"
+ "${CMAKE_CURRENT_SOURCE_DIR}/hl_tree.f90"
+ "${CMAKE_CURRENT_SOURCE_DIR}/hl_infobar.f90"
+ "${CMAKE_CURRENT_SOURCE_DIR}/julia_pixbuf.f90"
+ "${CMAKE_CURRENT_SOURCE_DIR}/list_demo.f90"
+ "${CMAKE_CURRENT_SOURCE_DIR}/mandelbrot_pixbuf.f90"
+ "${CMAKE_CURRENT_SOURCE_DIR}/mandelbrot_pixbuf_zoom.f90"
+ "${CMAKE_CURRENT_SOURCE_DIR}/mandelbrot.f90"
+ "${CMAKE_CURRENT_SOURCE_DIR}/menu.f90"
+ "${CMAKE_CURRENT_SOURCE_DIR}/notebooks.f90"
+ "${CMAKE_CURRENT_SOURCE_DIR}/tests.f90"
+ DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/gtk-fortran/examples2)
+endif(INSTALL_EXAMPLES)
View
12 plplot/CMakeLists.txt
@@ -67,3 +67,15 @@ add_dependencies(hl_plplot30e plplot_extra_module)
target_link_libraries(hl_plplot30e gtk-fortran_static ${GTK_LIBRARIES} ${PLPLOT_LIBRARIES})
add_test(hl_plplot30e ./hl_plplot30e)
+# If the INSTALL_EXAMPLES variable is set, then copy the examples
+# to ${CMAKE_INSTALL_DATAROOTDIR/gtk-fortran/examples<gtkversion>
+# useful (e.g.) for building binary packages.
+if (INSTALL_EXAMPLES)
+ install(FILES
+ "${CMAKE_CURRENT_SOURCE_DIR}/hl_plplot1e.f90"
+ "${CMAKE_CURRENT_SOURCE_DIR}/hl_plplot4e.f90"
+ "${CMAKE_CURRENT_SOURCE_DIR}/hl_plplot8e.f90"
+ "${CMAKE_CURRENT_SOURCE_DIR}/hl_plplot17e.f90"
+ "${CMAKE_CURRENT_SOURCE_DIR}/hl_plplot30e.f90"
+ DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/gtk-fortran/examples2)
+endif(INSTALL_EXAMPLES)
Please sign in to comment.
Something went wrong with that request. Please try again.