[asl] 66/177: Adding pkgconfig
Ghislain Vaillant
ghisvail-guest at moszumanska.debian.org
Thu Aug 27 09:22:42 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 c2303da7d35ceeddc9d6df4a944f528aacacc732
Author: Avtech Scientific <AvtechScientific at users.noreply.github.com>
Date: Sun Jul 5 14:23:12 2015 +0300
Adding pkgconfig
---
CMakeLists.txt | 69 +++++++++++++++++++++++------------
README.md | 2 +-
cmake/ASL.pc.cmake.in | 11 ++++++
cmake/DefineFunctions.cmake | 4 ++
doc/CMakeLists.txt | 2 +-
examples/flow/locomotive_in_tunnel.cc | 4 +-
src/CMakeLists.txt | 2 +-
7 files changed, 65 insertions(+), 29 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5055d5d..dfab8f6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -20,7 +20,7 @@ endif()
# Enable supplied cmake includes and modules
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/" "${CMAKE_SOURCE_DIR}/cmake/Modules/")
-
+
# Add definitions
include(DefineOptions)
include(DefineFunctions)
@@ -39,8 +39,35 @@ add_subdirectory(src)
add_subdirectory(test)
add_subdirectory(examples)
add_subdirectory(doc)
+
+# Packaging
+set(CPACK_GENERATOR "TGZ")
+set(CPACK_SOURCE_GENERATOR "TGZ")
+set(CPACK_PACKAGE_VERSION_MAJOR ${ASL_VERSION_MAJOR})
+set(CPACK_PACKAGE_VERSION_MINOR ${ASL_VERSION_MINOR})
+set(CPACK_PACKAGE_VERSION_PATCH ${ASL_VERSION_PATCH})
+set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE")
+set(CPACK_RESOURCE_FILE_README "${PROJECT_SOURCE_DIR}/README.md")
+set(CPACK_PACKAGE_DESCRIPTION "Advanced Simulation Library (ASL) is a free and open source multiphysics simulation software package. Its computational engine is based, among others, on the Lattice Boltzmann Methods and is written in OpenCL which enable extraordinarily efficient deployment on a variety of massively parallel architectures, ranging from inexpensive FPGAs, DSPs and GPUs up to heterogeneous clusters and supercomputers. The engine is hidden entirely behind C++ classes, so that [...]
+set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Advanced Simulation Library is a free and open source OpenCL-based multiphysics simulation software package.")
+set(CPACK_PACKAGE_VENDOR "Avtech Scientific")
+set(CPACK_PACKAGE_CONTACT "http://avtechscientific.com/contact")
+
+# .deb-specific
+set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "http://asl.org.il")
+
+# .rpm-specific
+set(CPACK_RPM_PACKAGE_URL "http://asl.org.il")
+
+# NSIS-specific
+set(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\asl.org.il")
+
+include(CPack)
+
+# Config (after package definitions, because CPACK_PACKAGE_DESCRIPTION_SUMMARY
+# is used for pkgconfig.
-# Config
+## ASLConfig.cmake
include(CMakePackageConfigHelpers)
# ASL conforms to Semantic Versioning scheme <http://semver.org/>
@@ -60,7 +87,7 @@ export(EXPORT ASLTargets
set(ConfigPackageLocation ${CMAKE_INSTALL_LIBDIR}/cmake/ASL)
configure_package_config_file(
- cmake/ASLConfig.cmake.in
+ ${CMAKE_SOURCE_DIR}/cmake/ASLConfig.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/ASLConfig.cmake
INSTALL_DESTINATION ${ConfigPackageLocation}
PATH_VARS CMAKE_INSTALL_INCLUDEDIR
@@ -83,27 +110,21 @@ install(FILES
COMPONENT
Devel
)
-
-# Packaging
-set(CPACK_GENERATOR "TGZ")
-set(CPACK_SOURCE_GENERATOR "TGZ")
-set(CPACK_PACKAGE_VERSION_MAJOR ${ASL_VERSION_MAJOR})
-set(CPACK_PACKAGE_VERSION_MINOR ${ASL_VERSION_MINOR})
-set(CPACK_PACKAGE_VERSION_PATCH ${ASL_VERSION_PATCH})
-set(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE")
-set(CPACK_RESOURCE_FILE_README "${PROJECT_SOURCE_DIR}/README.md")
-set(CPACK_PACKAGE_DESCRIPTION "Advanced Simulation Library (ASL) is a free and open source multiphysics simulation software package. Its computational engine is based, among others, on the Lattice Boltzmann Methods and is written in OpenCL which enable extraordinarily efficient deployment on a variety of massively parallel architectures, ranging from inexpensive FPGAs, DSPs and GPUs up to heterogeneous clusters and supercomputers. The engine is hidden entirely behind C++ classes, so that [...]
-set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Advanced Simulation Library is an OpenCL-based multiphysics simulation software package.")
-set(CPACK_PACKAGE_VENDOR "Avtech Scientific")
-set(CPACK_PACKAGE_CONTACT "http://avtechscientific.com/contact")
-# .deb-specific
-set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "http://asl.org.il")
-# .rpm-specific
-set(CPACK_RPM_PACKAGE_URL "http://asl.org.il")
+## ASL.pc
-# NSIS-specific
-set(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\asl.org.il")
-
-include(CPack)
\ No newline at end of file
+### Read the composed list of all sublibs from the ASL_SUBLIBS_GLOBAL_PROPERTY
+get_property(ASL_SUBLIBS GLOBAL PROPERTY ASL_SUBLIBS_GLOBAL_PROPERTY)
+
+configure_file(
+ ${CMAKE_SOURCE_DIR}/cmake/ASL.pc.cmake.in
+ ${CMAKE_CURRENT_BINARY_DIR}/ASL.pc
+ @ONLY
+)
+
+install(FILES
+ ${CMAKE_CURRENT_BINARY_DIR}/ASL.pc
+ DESTINATION
+ ${CMAKE_INSTALL_LIBDIR}/pkgconfig
+)
\ No newline at end of file
diff --git a/README.md b/README.md
index 85c76bd..8db8b4e 100644
--- a/README.md
+++ b/README.md
@@ -25,7 +25,7 @@ ASL is distributed under the free GNU Affero General Public License (AGPLv3) wit
### Running an example
-1. Go to tests: `cd examples/flow/locomotive_in_tunnel`
+1. Go to examples: `cd examples/flow/locomotive_in_tunnel`
2. Copy the .stl input file: `cp ../../../../ASL/examples/input_data/locomotive.stl .`
3. Run: `./locomotive_in_tunnel`. Optionally: change some parameters - `./locomotive_in_tunnel --dx 0.1 --dt 2` or write all of them into a file for later editing/reuse - `./locomotive_in_tunnel -g bigGrid.ini`. List all available options - `locomotive_in_tunnel -h`.
4. Post-processing: [step by step example](https://github.com/AvtechScientific/ASL/wiki/User-Guide#post-processing).
diff --git a/cmake/ASL.pc.cmake.in b/cmake/ASL.pc.cmake.in
new file mode 100644
index 0000000..0be1430
--- /dev/null
+++ b/cmake/ASL.pc.cmake.in
@@ -0,0 +1,11 @@
+prefix=@CMAKE_INSTALL_PREFIX@
+exec_prefix=${prefix}/@CMAKE_INSTALL_BINDIR@
+libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@
+includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@/asl
+
+Name: @PROJECT_NAME@
+Desription: @CPACK_PACKAGE_DESCRIPTION_SUMMARY@
+URL: http://asl.org.il
+Version: @ASL_VERSION@
+Libs: -L${libdir}@ASL_SUBLIBS@
+Cflags: -I${includedir}
\ No newline at end of file
diff --git a/cmake/DefineFunctions.cmake b/cmake/DefineFunctions.cmake
index 44a3f5f..201effe 100644
--- a/cmake/DefineFunctions.cmake
+++ b/cmake/DefineFunctions.cmake
@@ -2,6 +2,10 @@
# (preserving source tree structure)
function(INSTALL_SUBLIB _SUBLIB _SUBLIB_PUBLIC_HEADERS)
+ # Add current sublibrary to the list of all sublibs for inclusion in ASL.pc
+ # using global property ASL_SUBLIBS_GLOBAL_PROPERTY
+ set_property(GLOBAL APPEND_STRING PROPERTY ASL_SUBLIBS_GLOBAL_PROPERTY " -l${_SUBLIB}")
+
set_target_properties(
${_SUBLIB} PROPERTIES VERSION ${ASL_VERSION}
SOVERSION ${ASL_VERSION_MAJOR}
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
index 1a08fe3..093d2a3 100644
--- a/doc/CMakeLists.txt
+++ b/doc/CMakeLists.txt
@@ -5,7 +5,7 @@ if (WITH_INTERNAL_DOC)
set(DOXYGEN_HAVE_DOT "YES")
else (DOXYGEN_DOT_FOUND)
set(DOXYGEN_HAVE_DOT "NO")
- message(WARNING "Graphviz dot was not found! Class inheritance diagrams generation will be limited.")
+ message(WARNING "Graphviz dot was not found! Class inheritance diagrams in the generated documentation will be limited.")
endif (DOXYGEN_DOT_FOUND)
# Configure Doxyfile
diff --git a/examples/flow/locomotive_in_tunnel.cc b/examples/flow/locomotive_in_tunnel.cc
index 845fd0c..7f35017 100644
--- a/examples/flow/locomotive_in_tunnel.cc
+++ b/examples/flow/locomotive_in_tunnel.cc
@@ -73,7 +73,7 @@ int main(int argc, char* argv[])
/* Convenience facility to manage simulation parameters (and also
hardware parameters - platform/device to run the application on)
through command line and/or parameters file.
- Run `locomotive_in_tunnel -h` for more information */
+ See `locomotive_in_tunnel -h` for more information */
asl::ApplicationParametersManager appParamsManager("locomotive_in_tunnel",
"1.0");
@@ -177,7 +177,7 @@ int main(int argc, char* argv[])
<< timer.getClockTime() << "; load="
<< timer.getProcessorLoad() * 100 << "%" << endl;
- std::cout << "Output...";
+ std::cout << "Output... ";
std::cout << "Finished" << endl;
std::cout << "Ok" << endl;
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index b391fc6..989697f 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,7 +1,7 @@
# ToDo: recheck here and everywhere whether all listed
# _PUBLIC_HEADERS are indeed needed and if not move them
# to the _SOURCES (or _PRIVATE_HEADERS?)
-
+
add_subdirectory(acl)
add_subdirectory(data)
add_subdirectory(math)
--
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