[asl] 62/177: Adding config.cmake

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Thu Aug 27 09:22:41 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 82d7c9aeb1918870e5c2f40dc31953a12c0d67cc
Author: Avtech Scientific <AvtechScientific at users.noreply.github.com>
Date:   Fri Jul 3 13:44:16 2015 +0300

    Adding config.cmake
---
 CMakeLists.txt                                     | 72 +++++++++++++++++++---
 README.md                                          |  2 +-
 cmake/ASLConfig.cmake.in                           |  6 ++
 .../DefineFunctions.cmake                          | 20 ++++--
 DefineOptions.cmake => cmake/DefineOptions.cmake   |  0
 doc/CMakeLists.txt                                 | 10 ++-
 doc/Developer-Guide/Doxyfile.in                    |  2 +-
 src/CMakeLists.txt                                 |  4 --
 src/acl/CMakeLists.txt                             |  1 -
 src/data/CMakeLists.txt                            |  1 -
 src/math/CMakeLists.txt                            |  3 +-
 src/num/CMakeLists.txt                             |  1 -
 src/numExtend/CMakeLists.txt                       |  1 -
 13 files changed, 97 insertions(+), 26 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1f9a669..5055d5d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -17,15 +17,15 @@ else()
 	set(CMAKE_CXX_STANDARD 11)
 	set(CMAKE_CXX_FLAGS "-fpermissive ${CMAKE_CXX_FLAGS}")
 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.cmake)
-include(DefineFunctions.cmake)
+include(DefineOptions)
+include(DefineFunctions)
 include(GNUInstallDirs)
 
-# Enable supplied cmake Modules
-set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
-
 # Find dependencies
 find_package(OpenCL 1.1 REQUIRED)
 # ToDo: check - system component might be not needed any longer on new versions of Boost
@@ -39,6 +39,50 @@ add_subdirectory(src)
 add_subdirectory(test)
 add_subdirectory(examples)
 add_subdirectory(doc)
+
+# Config
+include(CMakePackageConfigHelpers)
+
+# ASL conforms to Semantic Versioning scheme <http://semver.org/>
+# Switch to COMPATIBILITY SameMajorVersion on ASL_VERSION 1.0.0
+# Till then use COMPATIBILITY ExactVersion 
+write_basic_package_version_file(
+	"${CMAKE_CURRENT_BINARY_DIR}/ASLConfigVersion.cmake"
+	VERSION ${ASL_VERSION}
+	COMPATIBILITY ExactVersion
+)
+
+export(EXPORT ASLTargets
+	FILE "${CMAKE_CURRENT_BINARY_DIR}/ASLTargets.cmake"
+	NAMESPACE ASL::
+)
+
+set(ConfigPackageLocation ${CMAKE_INSTALL_LIBDIR}/cmake/ASL)
+
+configure_package_config_file(
+	cmake/ASLConfig.cmake.in
+	${CMAKE_CURRENT_BINARY_DIR}/ASLConfig.cmake
+	INSTALL_DESTINATION ${ConfigPackageLocation}
+	PATH_VARS CMAKE_INSTALL_INCLUDEDIR
+)
+
+install(EXPORT ASLTargets
+	FILE
+	ASLTargets.cmake
+	NAMESPACE
+	ASL::
+	DESTINATION
+	${ConfigPackageLocation}
+)
+
+install(FILES
+	"${CMAKE_CURRENT_BINARY_DIR}/ASLConfig.cmake"
+	"${CMAKE_CURRENT_BINARY_DIR}/ASLConfigVersion.cmake"
+	DESTINATION
+	${ConfigPackageLocation}
+	COMPONENT
+	Devel
+)
 
 # Packaging
 set(CPACK_GENERATOR "TGZ")
@@ -47,5 +91,19 @@ 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")
-include(CPack)
+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")
+
+# NSIS-specific
+set(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\asl.org.il")
+
+include(CPack)
\ No newline at end of file
diff --git a/README.md b/README.md
index f5b8887..85c76bd 100644
--- a/README.md
+++ b/README.md
@@ -27,7 +27,7 @@ ASL is distributed under the free GNU Affero General Public License (AGPLv3) wit
 
 1. Go to tests: `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`. See `locomotive_in_tunnel -h` for more information.
+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).
 
 ### Writing your own code using ASL
diff --git a/cmake/ASLConfig.cmake.in b/cmake/ASLConfig.cmake.in
new file mode 100644
index 0000000..d393612
--- /dev/null
+++ b/cmake/ASLConfig.cmake.in
@@ -0,0 +1,6 @@
+set(ASL_VERSION "@ASL_VERSION@")
+
+ at PACKAGE_INIT@
+include("${CMAKE_CURRENT_LIST_DIR}/ASLTargets.cmake")
+
+check_required_components(ASL)
\ No newline at end of file
diff --git a/DefineFunctions.cmake b/cmake/DefineFunctions.cmake
similarity index 61%
rename from DefineFunctions.cmake
rename to cmake/DefineFunctions.cmake
index 89be836..44a3f5f 100644
--- a/DefineFunctions.cmake
+++ b/cmake/DefineFunctions.cmake
@@ -1,12 +1,20 @@
-# Installs sublibraries - binaries and
-# public headers (preserving source tree structure)
+# Installs sublibraries - binaries and public headers
+# (preserving source tree structure)
 function(INSTALL_SUBLIB _SUBLIB _SUBLIB_PUBLIC_HEADERS)
-	# ToDo: add COMPONENT headers
+
+	set_target_properties(
+		${_SUBLIB} PROPERTIES VERSION ${ASL_VERSION}
+		SOVERSION ${ASL_VERSION_MAJOR}
+		INTERFACE_${_SUBLIB}_MAJOR_VERSION ${ASL_VERSION_MAJOR}
+		COMPATIBLE_INTERFACE_STRING ${ASL_VERSION_MAJOR}
+	)
+
 	install(TARGETS
-		${_SUBLIB}
+		${_SUBLIB} EXPORT ASLTargets
 		RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
 		LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
 		ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+		INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/asl
 	)
 
 	# Install public headers preserving the source tree structure
@@ -15,11 +23,11 @@ function(INSTALL_SUBLIB _SUBLIB _SUBLIB_PUBLIC_HEADERS)
 		file(RELATIVE_PATH relative_path ${CMAKE_SOURCE_DIR}/src ${CMAKE_CURRENT_SOURCE_DIR}/${header})
 		# Extract directories of the relative path
 		get_filename_component(directories ${relative_path} DIRECTORY)
-		# ToDo: add COMPONENT libraries
 		install(FILES
 			${header}
 			DESTINATION
 			${CMAKE_INSTALL_INCLUDEDIR}/asl/${directories}
+			COMPONENT Devel
 		)
 	endforeach()
-endfunction(INSTALL_SUBLIB)
+endfunction(INSTALL_SUBLIB)
\ No newline at end of file
diff --git a/DefineOptions.cmake b/cmake/DefineOptions.cmake
similarity index 100%
rename from DefineOptions.cmake
rename to cmake/DefineOptions.cmake
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
index c55d182..1a08fe3 100644
--- a/doc/CMakeLists.txt
+++ b/doc/CMakeLists.txt
@@ -1,5 +1,13 @@
 if (WITH_INTERNAL_DOC)
 	find_package(Doxygen REQUIRED)
+
+	if (DOXYGEN_DOT_FOUND)
+		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.")
+	endif (DOXYGEN_DOT_FOUND)
+
 	# Configure Doxyfile
 	configure_file(
 		"${PROJECT_SOURCE_DIR}/doc/Developer-Guide/Doxyfile.in"
@@ -8,4 +16,4 @@ if (WITH_INTERNAL_DOC)
 	add_custom_target(docs ${DOXYGEN_EXECUTABLE} ${PROJECT_BINARY_DIR}/doc/Developer-Guide/Doxyfile)
 	install(CODE "execute_process(COMMAND ${CMAKE_BUILD_TOOL} docs)")
 	install(DIRECTORY ${CMAKE_BINARY_DIR}/doc/html DESTINATION ${CMAKE_INSTALL_DOCDIR})
-endif()
+endif()
\ No newline at end of file
diff --git a/doc/Developer-Guide/Doxyfile.in b/doc/Developer-Guide/Doxyfile.in
index d23a6fa..dea8421 100644
--- a/doc/Developer-Guide/Doxyfile.in
+++ b/doc/Developer-Guide/Doxyfile.in
@@ -1742,7 +1742,7 @@ HIDE_UNDOC_RELATIONS   = YES
 # toolkit from AT&T and Lucent Bell Labs. The other options in this section
 # have no effect if this option is set to NO (the default)
 
-HAVE_DOT               = YES
+HAVE_DOT               = @DOXYGEN_HAVE_DOT@
 
 # The DOT_NUM_THREADS specifies the number of dot invocations doxygen is
 # allowed to run in parallel. When set to 0 (the default) doxygen will
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 87b0d71..b391fc6 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -27,7 +27,6 @@ set(aslCommon_SOURCES
 )
 
 add_library(aslCommon ${aslCommon_SOURCES})
-set_target_properties(aslCommon PROPERTIES VERSION ${ASL_VERSION} SOVERSION ${ASL_VERSION_MAJOR})
 target_link_libraries(aslCommon ${Boost_LIBRARIES})
 INSTALL_SUBLIB(aslCommon aslCommon_PUBLIC_HEADERS)
 
@@ -56,7 +55,6 @@ set(asl_SOURCES
 )
 
 add_library(asl ${asl_SOURCES})
-set_target_properties(asl PROPERTIES VERSION ${ASL_VERSION} SOVERSION ${ASL_VERSION_MAJOR})
 target_link_libraries(asl aslCommon aslacl asldata aslmath ${Boost_LIBRARIES})
 INSTALL_SUBLIB(asl asl_PUBLIC_HEADERS)
 
@@ -79,7 +77,6 @@ set(aslvtk_SOURCES
 )
 
 add_library(aslvtk ${aslvtk_SOURCES})
-set_target_properties(aslvtk PROPERTIES VERSION ${ASL_VERSION} SOVERSION ${ASL_VERSION_MAJOR})
 target_link_libraries(aslvtk ${VTK_LIBRARIES} ${OpenCL_LIBRARIES})
 INSTALL_SUBLIB(aslvtk aslvtk_PUBLIC_HEADERS)
 
@@ -103,7 +100,6 @@ if (WITH_MATIO)
 	)
 
 	add_library(aslmatio ${aslmatio_SOURCES})
-	set_target_properties(aslmatio PROPERTIES VERSION ${ASL_VERSION} SOVERSION ${ASL_VERSION_MAJOR})
 	target_link_libraries(aslmatio ${MATIO_LIBRARIES})
 	INSTALL_SUBLIB(aslmatio aslmatio_PUBLIC_HEADERS)
 endif (WITH_MATIO)
diff --git a/src/acl/CMakeLists.txt b/src/acl/CMakeLists.txt
index a39ad5d..33b0b60 100644
--- a/src/acl/CMakeLists.txt
+++ b/src/acl/CMakeLists.txt
@@ -63,6 +63,5 @@ set(aslacl_SOURCES
 )
 
 add_library(aslacl ${aslacl_SOURCES})
-set_target_properties(aslacl PROPERTIES VERSION ${ASL_VERSION} SOVERSION ${ASL_VERSION_MAJOR})
 target_link_libraries(aslacl aslCommon aslaclOperators aslaclMath ${OpenCL_LIBRARIES})
 INSTALL_SUBLIB(aslacl aslacl_PUBLIC_HEADERS)
diff --git a/src/data/CMakeLists.txt b/src/data/CMakeLists.txt
index 9f8ed17..5737c14 100644
--- a/src/data/CMakeLists.txt
+++ b/src/data/CMakeLists.txt
@@ -23,5 +23,4 @@ set(asldata_SOURCES
 )
 
 add_library(asldata ${asldata_SOURCES})
-set_target_properties(asldata PROPERTIES VERSION ${ASL_VERSION} SOVERSION ${ASL_VERSION_MAJOR})
 INSTALL_SUBLIB(asldata asldata_PUBLIC_HEADERS)
diff --git a/src/math/CMakeLists.txt b/src/math/CMakeLists.txt
index fec064b..a6148f3 100644
--- a/src/math/CMakeLists.txt
+++ b/src/math/CMakeLists.txt
@@ -38,5 +38,4 @@ set(aslmath_SOURCES
 )
 
 add_library(aslmath ${aslmath_SOURCES})
-set_target_properties(aslmath PROPERTIES VERSION ${ASL_VERSION} SOVERSION ${ASL_VERSION_MAJOR})
-INSTALL_SUBLIB(aslmath aslmath_PUBLIC_HEADERS)
+INSTALL_SUBLIB(aslmath aslmath_PUBLIC_HEADERS)
\ No newline at end of file
diff --git a/src/num/CMakeLists.txt b/src/num/CMakeLists.txt
index 18379c5..ae8e6f5 100644
--- a/src/num/CMakeLists.txt
+++ b/src/num/CMakeLists.txt
@@ -68,6 +68,5 @@ set(aslnum_SOURCES
 )
 
 add_library(aslnum ${aslnum_SOURCES})
-set_target_properties(aslnum PROPERTIES VERSION ${ASL_VERSION} SOVERSION ${ASL_VERSION_MAJOR})
 target_link_libraries(aslnum aslacl)
 INSTALL_SUBLIB(aslnum aslnum_PUBLIC_HEADERS)
diff --git a/src/numExtend/CMakeLists.txt b/src/numExtend/CMakeLists.txt
index 79880f1..e766041 100644
--- a/src/numExtend/CMakeLists.txt
+++ b/src/numExtend/CMakeLists.txt
@@ -13,5 +13,4 @@ set(aslExt_SOURCES
 )
 
 add_library(aslExt ${aslExt_SOURCES})
-set_target_properties(aslExt PROPERTIES VERSION ${ASL_VERSION} SOVERSION ${ASL_VERSION_MAJOR})
 INSTALL_SUBLIB(aslExt aslExt_PUBLIC_HEADERS)

-- 
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