[asl] 130/177: Install examples

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Thu Aug 27 09:22:48 UTC 2015


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to branch master
in repository asl.

commit 99e89de3e39c0e1ac1fbeecd148aa1e5be7ae2c4
Author: Avtech Scientific <AvtechScientific at users.noreply.github.com>
Date:   Thu Jul 30 22:54:30 2015 +0300

    Install examples
---
 CMakeLists.txt                         |  2 +-
 cmake/ASLBuildFunctions.cmake          | 14 +++++++++++++-
 examples/CMakeLists.txt                |  4 +++-
 examples/elastic/CMakeLists.txt        |  6 +++++-
 examples/flow/CMakeLists.txt           | 15 ++++++++++++++-
 examples/flow/locomotive.cc            |  2 +-
 examples/heatTransfer/CMakeLists.txt   |  2 +-
 examples/jumpingObjects/CMakeLists.txt |  2 +-
 examples/levelSet/CMakeLists.txt       |  4 +++-
 examples/massTransferSM/CMakeLists.txt |  5 ++++-
 10 files changed, 46 insertions(+), 10 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index f6b4d7c..59c2afe 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -7,7 +7,7 @@ cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR)
 # Set version number
 set(ASL_VERSION_MAJOR 0)
 set(ASL_VERSION_MINOR 1)
-set(ASL_VERSION_PATCH 4)
+set(ASL_VERSION_PATCH 5)
 
 set(ASL_VERSION ${ASL_VERSION_MAJOR}.${ASL_VERSION_MINOR}.${ASL_VERSION_PATCH})
 
diff --git a/cmake/ASLBuildFunctions.cmake b/cmake/ASLBuildFunctions.cmake
index 201effe..675602d 100644
--- a/cmake/ASLBuildFunctions.cmake
+++ b/cmake/ASLBuildFunctions.cmake
@@ -34,4 +34,16 @@ function(INSTALL_SUBLIB _SUBLIB _SUBLIB_PUBLIC_HEADERS)
 			COMPONENT Devel
 		)
 	endforeach()
-endfunction(INSTALL_SUBLIB)
\ No newline at end of file
+endfunction(INSTALL_SUBLIB)
+
+
+# Installs examples: binary and the corresponding source code (preserving source tree structure)
+function(INSTALL_EXAMPLE _TARGET _SOURCE)
+	install(TARGETS ${_TARGET} RUNTIME DESTINATION  ${CMAKE_INSTALL_BINDIR})
+
+	# Determine relative path from ${CMAKE_SOURCE_DIR} to ${_SOURCE}
+	file(RELATIVE_PATH relative_path ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/${_SOURCE})
+	# Extract directories of the relative path
+	get_filename_component(directories ${relative_path} DIRECTORY)
+	install(FILES ${_SOURCE} DESTINATION ${CMAKE_INSTALL_DOCDIR}/${directories})
+endfunction(INSTALL_EXAMPLE)
\ No newline at end of file
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index 71d400b..c89863b 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -3,4 +3,6 @@ add_subdirectory(elastic)
 add_subdirectory(levelSet)
 add_subdirectory(jumpingObjects)
 add_subdirectory(heatTransfer)
-add_subdirectory(massTransferSM)
+add_subdirectory(massTransferSM)
+
+install(DIRECTORY ${CMAKE_SOURCE_DIR}/examples/input_data DESTINATION ${CMAKE_INSTALL_DOCDIR}/examples)
diff --git a/examples/elastic/CMakeLists.txt b/examples/elastic/CMakeLists.txt
index 3c81d9c..636cea0 100644
--- a/examples/elastic/CMakeLists.txt
+++ b/examples/elastic/CMakeLists.txt
@@ -4,20 +4,24 @@ include_directories(${CMAKE_SOURCE_DIR}/src)
 add_executable(poroelastic poroelastic.cc)
 target_link_libraries(poroelastic aslnum aslvtk asl)
 set_property(TARGET poroelastic PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/poroelastic)
+INSTALL_EXAMPLE(poroelastic poroelastic.cc)
 
 add_executable(cubeIncompressibleGravity cubeIncompressibleGravity.cc)
 target_link_libraries(cubeIncompressibleGravity aslnum aslvtk asl)
 set_property(TARGET cubeIncompressibleGravity PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/cubeIncompressibleGravity)
+INSTALL_EXAMPLE(cubeIncompressibleGravity cubeIncompressibleGravity.cc)
 
 add_executable(cubePoroelasticGravity cubePoroelasticGravity.cc)
 target_link_libraries(cubePoroelasticGravity aslnum aslvtk asl)
 set_property(TARGET cubePoroelasticGravity PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/cubePoroelasticGravity)
+INSTALL_EXAMPLE(cubePoroelasticGravity cubePoroelasticGravity.cc)
 
 add_executable(cubeGravity cubeGravity.cc)
 target_link_libraries(cubeGravity aslnum aslvtk asl)
 set_property(TARGET cubeGravity PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/cubeGravity)
+INSTALL_EXAMPLE(cubeGravity cubeGravity.cc)
 
 add_executable(acousticWaves acousticWaves.cc)
 target_link_libraries(acousticWaves aslnum aslvtk asl)
 set_property(TARGET acousticWaves PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/acousticWaves)
-
+INSTALL_EXAMPLE(acousticWaves acousticWaves.cc)
\ No newline at end of file
diff --git a/examples/flow/CMakeLists.txt b/examples/flow/CMakeLists.txt
index 6005abb..8592465 100644
--- a/examples/flow/CMakeLists.txt
+++ b/examples/flow/CMakeLists.txt
@@ -4,51 +4,64 @@ include_directories(${CMAKE_SOURCE_DIR}/src)
 add_executable(flow flow.cc)
 target_link_libraries(flow aslnum aslvtk asl)
 set_property(TARGET flow PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/flow)
+INSTALL_EXAMPLE(flow flow.cc)
 
 add_executable(flow2 flow2.cc)
 target_link_libraries(flow2 aslnum aslvtk asl)
 set_property(TARGET flow2 PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/flow2)
+INSTALL_EXAMPLE(flow2 flow2.cc)
 
 add_executable(flow3 flow3.cc)
 target_link_libraries(flow3 aslnum aslvtk asl)
 set_property(TARGET flow3 PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/flow3)
+INSTALL_EXAMPLE(flow3 flow3.cc)
 
 add_executable(flowRotatingCylinders flowRotatingCylinders.cc)
 target_link_libraries(flowRotatingCylinders aslnum aslvtk asl)
 set_property(TARGET flowRotatingCylinders PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/flowRotatingCylinders)
+INSTALL_EXAMPLE(flowRotatingCylinders flowRotatingCylinders.cc)
 
 add_executable(flowKDPGrowth flowKDPGrowth.cc)
 target_link_libraries(flowKDPGrowth aslnum aslvtk asl)
 set_property(TARGET flowKDPGrowth PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/flowKDPGrowth)
+INSTALL_EXAMPLE(flowKDPGrowth flowKDPGrowth.cc)
 
 add_executable(locomotive_laminar locomotive_laminar.cc)
 target_link_libraries(locomotive_laminar aslnum aslvtk asl)
 set_property(TARGET locomotive_laminar PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/locomotive_laminar)
+INSTALL_EXAMPLE(locomotive_laminar locomotive_laminar.cc)
 
 add_executable(compressor compressor.cc)
 target_link_libraries(compressor aslnum aslvtk asl)
 set_property(TARGET compressor PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/compressor)
+INSTALL_EXAMPLE(compressor compressor.cc)
 
 add_executable(locomotive locomotive.cc)
 target_link_libraries(locomotive aslnum aslvtk asl)
 set_property(TARGET locomotive PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/locomotive)
+INSTALL_EXAMPLE(locomotive locomotive.cc)
 
 add_executable(locomotive_stability locomotive_stability.cc)
 target_link_libraries(locomotive_stability aslnum aslvtk asl)
 set_property(TARGET locomotive_stability PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/locomotive_stability)
+INSTALL_EXAMPLE(locomotive_stability locomotive_stability.cc)
 
 add_executable(bus_wind bus_wind.cc)
 target_link_libraries(bus_wind aslnum aslvtk asl)
 set_property(TARGET bus_wind PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bus_wind)
+INSTALL_EXAMPLE(bus_wind bus_wind.cc)
 
 add_executable(multiphase_flow multiphase_flow.cc)
 target_link_libraries(multiphase_flow aslnum aslvtk asl)
 set_property(TARGET multiphase_flow PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/multiphase_flow)
+INSTALL_EXAMPLE(multiphase_flow multiphase_flow.cc)
 
 add_executable(multicomponent_flow multicomponent_flow.cc)
 target_link_libraries(multicomponent_flow aslnum aslvtk asl)
 set_property(TARGET multicomponent_flow PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/multicomponent_flow)
+INSTALL_EXAMPLE(multicomponent_flow multicomponent_flow.cc)
 
 add_executable(pitot_tube_ice pitot_tube_ice.cc)
 target_link_libraries(pitot_tube_ice aslnum aslvtk asl)
-set_property(TARGET pitot_tube_ice PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/pitot_tube_ice)
+set_property(TARGET pitot_tube_ice PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/pitot_tube_ice)
+INSTALL_EXAMPLE(pitot_tube_ice pitot_tube_ice.cc)
\ No newline at end of file
diff --git a/examples/flow/locomotive.cc b/examples/flow/locomotive.cc
index 107571f..2acdfa3 100644
--- a/examples/flow/locomotive.cc
+++ b/examples/flow/locomotive.cc
@@ -100,7 +100,7 @@ int main(int argc, char* argv[])
 	asl::Parameter<FlT> dx(0.08, "dx", "space step", "m");
 	asl::Parameter<FlT> dt(1., "dt", "time step", "s");
 	asl::Parameter<FlT> nu(.001, "nu", "kinematic viscosity", "m^2/s");
-	asl::Parameter<unsigned int> iterations(20001, "iterations", "iterations number");
+	asl::Parameter<unsigned int> iterations(10001, "iterations", "iterations number");
 	asl::Parameter<string> input("input", "path to the geometry input file");
 
 	/* Load previously declared Parameters from command line and/or
diff --git a/examples/heatTransfer/CMakeLists.txt b/examples/heatTransfer/CMakeLists.txt
index 428d0f2..b5bee7a 100644
--- a/examples/heatTransfer/CMakeLists.txt
+++ b/examples/heatTransfer/CMakeLists.txt
@@ -4,4 +4,4 @@ include_directories(${CMAKE_SOURCE_DIR}/src)
 add_executable(surfaceFlux surfaceFlux.cc)
 target_link_libraries(surfaceFlux aslnum aslvtk asl)
 set_property(TARGET surfaceFlux PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/surfaceFlux)
-
+INSTALL_EXAMPLE(surfaceFlux surfaceFlux.cc)
\ No newline at end of file
diff --git a/examples/jumpingObjects/CMakeLists.txt b/examples/jumpingObjects/CMakeLists.txt
index b3d5656..f18661b 100644
--- a/examples/jumpingObjects/CMakeLists.txt
+++ b/examples/jumpingObjects/CMakeLists.txt
@@ -3,4 +3,4 @@ include_directories(${CMAKE_SOURCE_DIR}/src)
 add_executable(jumpingBox jumpingBox.cc)
 target_link_libraries(jumpingBox aslnum aslvtk asl)
 set_property(TARGET jumpingBox PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/jumpingBox)
-
+INSTALL_EXAMPLE(jumpingBox jumpingBox.cc)
\ No newline at end of file
diff --git a/examples/levelSet/CMakeLists.txt b/examples/levelSet/CMakeLists.txt
index b449115..e495844 100644
--- a/examples/levelSet/CMakeLists.txt
+++ b/examples/levelSet/CMakeLists.txt
@@ -4,12 +4,14 @@ include_directories(${CMAKE_SOURCE_DIR}/src)
 add_executable(levelSetBasic levelSetBasic.cc)
 target_link_libraries(levelSetBasic aslnum aslvtk asl)
 set_property(TARGET levelSetBasic PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/levelSetBasic)
+INSTALL_EXAMPLE(levelSetBasic levelSetBasic.cc)
 
 add_executable(levelSetNormalGrowth levelSetNormalGrowth.cc)
 target_link_libraries(levelSetNormalGrowth aslnum aslvtk asl)
 set_property(TARGET levelSetNormalGrowth PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/levelSetNormalGrowth)
+INSTALL_EXAMPLE(levelSetNormalGrowth levelSetNormalGrowth.cc)
 
 add_executable(levelSetFacetedGrowth levelSetFacetedGrowth.cc)
 target_link_libraries(levelSetFacetedGrowth aslnum aslvtk asl)
 set_property(TARGET levelSetFacetedGrowth PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/levelSetFacetedGrowth)
-
+INSTALL_EXAMPLE(levelSetFacetedGrowth levelSetFacetedGrowth.cc)
\ No newline at end of file
diff --git a/examples/massTransferSM/CMakeLists.txt b/examples/massTransferSM/CMakeLists.txt
index 5e84170..91084e8 100644
--- a/examples/massTransferSM/CMakeLists.txt
+++ b/examples/massTransferSM/CMakeLists.txt
@@ -3,16 +3,19 @@ include_directories(${CMAKE_SOURCE_DIR}/src)
 add_executable(testSMDiff testSMDiff.cc)
 target_link_libraries(testSMDiff aslnum aslvtk asl)
 set_property(TARGET testSMDiff PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/testSMDiff)
+INSTALL_EXAMPLE(testSMDiff testSMDiff.cc)
 
 add_executable(testSMDiff3C testSMDiff3C.cc)
 target_link_libraries(testSMDiff3C aslnum aslvtk asl)
 set_property(TARGET testSMDiff3C PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/testSMDiff3C)
+INSTALL_EXAMPLE(testSMDiff3C testSMDiff3C.cc)
 
 add_executable(testSMPhi testSMPhi.cc)
 target_link_libraries(testSMPhi aslnum aslvtk asl)
 set_property(TARGET testSMPhi PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/testSMPhi)
+INSTALL_EXAMPLE(testSMPhi testSMPhi.cc)
 
 add_executable(testSMPhiBV testSMPhiBV.cc)
 target_link_libraries(testSMPhiBV aslnum aslvtk asl)
 set_property(TARGET testSMPhiBV PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/testSMPhiBV)
-
+INSTALL_EXAMPLE(testSMPhiBV testSMPhiBV.cc)
\ No newline at end of file

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/asl.git



More information about the debian-science-commits mailing list