[asl] 134/177: Improving cmake configuration
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 5cb6fb27942f81294dc2d11db0951629e7c7c0ea
Author: Avtech Scientific <AvtechScientific at users.noreply.github.com>
Date: Fri Jul 31 12:21:32 2015 +0300
Improving cmake configuration
---
CMakeLists.txt | 6 ++----
NEWS.md | 2 +-
README.md | 6 +++---
cmake/ASL.pc.cmake.in | 2 +-
cmake/ASLBuildFunctions.cmake | 10 ++++++++--
cmake/ASLPaths.cmake | 3 +++
examples/CMakeLists.txt | 2 +-
examples/elastic/CMakeLists.txt | 5 -----
examples/flow/CMakeLists.txt | 13 -------------
examples/heatTransfer/CMakeLists.txt | 1 -
examples/jumpingObjects/CMakeLists.txt | 1 -
examples/levelSet/CMakeLists.txt | 3 ---
examples/massTransferSM/CMakeLists.txt | 4 ----
test/CMakeLists.txt | 2 ++
14 files changed, 21 insertions(+), 39 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 59c2afe..4e4e5a2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -21,9 +21,8 @@ endif()
# Enable supplied cmake includes and modules
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/" "${CMAKE_SOURCE_DIR}/cmake/Modules/")
-include(GNUInstallDirs)
-
-# Add ASL cmake definitions
+# Add ASL cmake definitions
+include(ASLPaths)
include(ASLBuildOptions)
include(ASLBuildFunctions)
@@ -52,7 +51,6 @@ if (WITH_TESTS)
# Performance tests are labled "Performance"
# Run them: ctest [-C Release|Debug] -L Performance
# Exclude them: ctest [-C Release|Debug] -LE Performance
- enable_testing()
add_subdirectory(test)
endif()
diff --git a/NEWS.md b/NEWS.md
index e8b6065..9a4d099 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -2,7 +2,7 @@
## 0.1.5
-- supplying cl.hpp, since not provided by OpenCL 2.0
+- supplying cl.hpp, since not provided by OpenCL 2.0 (causes harmless "deprecated" warnings)
- bug fixes
- improved tests
- improved examples
\ No newline at end of file
diff --git a/README.md b/README.md
index 279f944..b9f800c 100644
--- a/README.md
+++ b/README.md
@@ -35,8 +35,8 @@ Professional consulting, training and integration services are provided by [Avte
### Running an example
1. Go to examples: `cd examples/flow/locomotive`
-2. Run: `./locomotive --input ../../../../ASL/examples/input_data/locomotive.stl`.
-Optionally: change parameters - `./locomotive --input locomotive.stl --dx 0.1 --dt 2` or write all of them into a file for later editing/reuse - `./locomotive -g bigGrid.ini`. List all available options - `./locomotive -h`.
+2. `./asl-locomotive --input ../../../../ASL/examples/input_data/locomotive.stl`
+Optionally: change parameters `./asl-locomotive --input locomotive.stl --dx 1 --dt 2` or write all of them into a file for later editing/reuse - `./asl-locomotive -g bigGrid.ini`. List all available options - `./asl-locomotive -h`.
3. Post-processing: see [step by step example](https://github.com/AvtechScientific/ASL/wiki/User-Guide#post-processing) and `examples/input_data/locomotive.pvsm` - the ParaView state file.
### Writing your own code using ASL
@@ -54,4 +54,4 @@ find_package(ASL 0.1.4 CONFIG REQUIRED)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
add_executable(locomotive locomotive.cc)
target_link_libraries(locomotive PRIVATE ASL::aslnum ASL::aslvtk ASL::asl)
-```
\ No newline at end of file
+```
diff --git a/cmake/ASL.pc.cmake.in b/cmake/ASL.pc.cmake.in
index 84029ac..11fa955 100644
--- a/cmake/ASL.pc.cmake.in
+++ b/cmake/ASL.pc.cmake.in
@@ -1,7 +1,7 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}/@CMAKE_INSTALL_BINDIR@
libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@
-includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@/asl
+includedir=${prefix}/@ASL_INSTALL_INCLUDEDIR@
Name: @PROJECT_NAME@
Description: @CPACK_PACKAGE_DESCRIPTION_SUMMARY@
diff --git a/cmake/ASLBuildFunctions.cmake b/cmake/ASLBuildFunctions.cmake
index 675602d..1d82289 100644
--- a/cmake/ASLBuildFunctions.cmake
+++ b/cmake/ASLBuildFunctions.cmake
@@ -18,7 +18,7 @@ function(INSTALL_SUBLIB _SUBLIB _SUBLIB_PUBLIC_HEADERS)
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
- INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/asl
+ INCLUDES DESTINATION ${ASL_INSTALL_INCLUDEDIR}
)
# Install public headers preserving the source tree structure
@@ -30,7 +30,7 @@ function(INSTALL_SUBLIB _SUBLIB _SUBLIB_PUBLIC_HEADERS)
install(FILES
${header}
DESTINATION
- ${CMAKE_INSTALL_INCLUDEDIR}/asl/${directories}
+ ${ASL_INSTALL_INCLUDEDIR}/${directories}
COMPONENT Devel
)
endforeach()
@@ -38,7 +38,13 @@ endfunction(INSTALL_SUBLIB)
# Installs examples: binary and the corresponding source code (preserving source tree structure)
+# puts `asl-` preffix before binaries in order to avoid name collisions
+# creates a separate directory in the build tree to make experimenting easier
function(INSTALL_EXAMPLE _TARGET _SOURCE)
+ # Add `asl-` preffix in order to avoid name collisions
+ set_property(TARGET ${_TARGET} PROPERTY OUTPUT_NAME "asl-${_TARGET}")
+ # Create a separate directory in the build tree for each example to make experimenting easier
+ set_property(TARGET ${_TARGET} PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${_TARGET})
install(TARGETS ${_TARGET} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
# Determine relative path from ${CMAKE_SOURCE_DIR} to ${_SOURCE}
diff --git a/cmake/ASLPaths.cmake b/cmake/ASLPaths.cmake
new file mode 100644
index 0000000..da8f99f
--- /dev/null
+++ b/cmake/ASLPaths.cmake
@@ -0,0 +1,3 @@
+include(GNUInstallDirs)
+
+set(ASL_INSTALL_INCLUDEDIR "${CMAKE_INSTALL_INCLUDEDIR}/ASL")
\ No newline at end of file
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index c89863b..f990760 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -5,4 +5,4 @@ add_subdirectory(jumpingObjects)
add_subdirectory(heatTransfer)
add_subdirectory(massTransferSM)
-install(DIRECTORY ${CMAKE_SOURCE_DIR}/examples/input_data DESTINATION ${CMAKE_INSTALL_DOCDIR}/examples)
+install(DIRECTORY ${CMAKE_SOURCE_DIR}/examples/input_data DESTINATION ${CMAKE_INSTALL_DOCDIR}/examples)
\ No newline at end of file
diff --git a/examples/elastic/CMakeLists.txt b/examples/elastic/CMakeLists.txt
index 636cea0..2d5fe9a 100644
--- a/examples/elastic/CMakeLists.txt
+++ b/examples/elastic/CMakeLists.txt
@@ -3,25 +3,20 @@ 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 8592465..614aa78 100644
--- a/examples/flow/CMakeLists.txt
+++ b/examples/flow/CMakeLists.txt
@@ -3,65 +3,52 @@ 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)
INSTALL_EXAMPLE(pitot_tube_ice pitot_tube_ice.cc)
\ No newline at end of file
diff --git a/examples/heatTransfer/CMakeLists.txt b/examples/heatTransfer/CMakeLists.txt
index b5bee7a..7e85612 100644
--- a/examples/heatTransfer/CMakeLists.txt
+++ b/examples/heatTransfer/CMakeLists.txt
@@ -3,5 +3,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 f18661b..10de1bd 100644
--- a/examples/jumpingObjects/CMakeLists.txt
+++ b/examples/jumpingObjects/CMakeLists.txt
@@ -2,5 +2,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 e495844..86733d4 100644
--- a/examples/levelSet/CMakeLists.txt
+++ b/examples/levelSet/CMakeLists.txt
@@ -3,15 +3,12 @@ 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 91084e8..b82d19d 100644
--- a/examples/massTransferSM/CMakeLists.txt
+++ b/examples/massTransferSM/CMakeLists.txt
@@ -2,20 +2,16 @@ 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
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index a8b457c..a1ad2f7 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -1,3 +1,5 @@
+enable_testing()
+
add_subdirectory(testABD)
add_subdirectory(testACL)
add_subdirectory(testAGL)
--
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