diff -up mathgl-2.4.2/examples/CMakeLists.txt.examples mathgl-2.4.2/examples/CMakeLists.txt --- mathgl-2.4.2/examples/CMakeLists.txt.examples 2018-03-21 10:48:20.000000000 -0600 +++ mathgl-2.4.2/examples/CMakeLists.txt 2018-11-07 21:44:54.705927586 -0700 @@ -4,6 +4,7 @@ file(COPY ${CMAKE_SOURCE_DIR}/examples/s file(COPY ${CMAKE_SOURCE_DIR}/examples/wnd_samples.cpp DESTINATION ${CMAKE_BINARY_DIR}/examples) add_executable(mgl_example wnd_samples.cpp full_test.cpp samples.cpp) target_link_libraries(mgl_example mgl-static ${getopt_lib-static}) +SET(MGL_INSTALL_EXAMPLES_LIST mgl_example) if(CMAKE_BUILD_TYPE STREQUAL "Debug" AND CMAKE_COMPILER_IS_GNUCXX AND enable-lcov) setup_target_for_coverage( NAME mgl_coverage @@ -16,17 +17,20 @@ if(MGL_HAVE_FLTK) include_directories(${FLTK_INCLUDE_DIR}) add_executable(mgl_fltk_example wnd_samples.cpp fltk_example.cpp) target_link_libraries(mgl_fltk_example mgl-fltk) + SET(MGL_INSTALL_EXAMPLES_LIST ${MGL_INSTALL_EXAMPLES_LIST} mgl_fltk_example) endif(MGL_HAVE_FLTK) if(MGL_HAVE_GLUT) add_executable(mgl_glut_example wnd_samples.cpp glut_example.cpp) target_link_libraries(mgl_glut_example mgl-glut) + SET(MGL_INSTALL_EXAMPLES_LIST ${MGL_INSTALL_EXAMPLES_LIST} mgl_glut_example) endif(MGL_HAVE_GLUT) if(MGL_HAVE_WX) include(${wxWidgets_USE_FILE}) add_executable(mgl_wx_example wnd_samples.cpp wx_example.cpp) target_link_libraries(mgl_wx_example mgl-wx) + SET(MGL_INSTALL_EXAMPLES_LIST ${MGL_INSTALL_EXAMPLES_LIST} mgl_wx_example) endif(MGL_HAVE_WX) if(QT_ENABLED) @@ -46,7 +50,9 @@ if(QT_ENABLED) else(enable-qt5) target_link_libraries(mgl_qgl_example mgl ${MGL_QT4_LIBS}) endif(enable-qt5) + SET(MGL_INSTALL_EXAMPLES_LIST ${MGL_INSTALL_EXAMPLES_LIST} mgl_qgl_example) endif(MGL_HAVE_OPENGL) + SET(MGL_INSTALL_EXAMPLES_LIST ${MGL_INSTALL_EXAMPLES_LIST} mgl_qt_example) endif(QT_ENABLED) if(MGL_HAVE_LTDL) @@ -59,3 +65,8 @@ if(MGL_HAVE_MPI) target_link_libraries(mgl_mpi_example mgl-mpi mgl ${MPI_LIBRARIES}) target_include_directories(mgl_mpi_example SYSTEM PUBLIC ${MPI_CXX_INCLUDE_PATH}) endif(MGL_HAVE_MPI) + +install( + TARGETS ${MGL_INSTALL_EXAMPLES_LIST} + RUNTIME DESTINATION bin +)