[Cmake-commits] CMake branch, next, updated. v2.8.4-1315-gc948068
Clement Creusot
creusot at cs.york.ac.uk
Fri Apr 1 11:58:18 EDT 2011
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via c9480681012fc7101b34f76c9ff03b14b0ee7137 (commit)
via 1942f583b37da01cb2827c28f7e3fa23dd712cfa (commit)
via 0315d3b66f31a6db21242a020f0a666547e470cc (commit)
from 3f6870e481d7f304f2c654e6c0dc612a406bcf5e (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c9480681012fc7101b34f76c9ff03b14b0ee7137
commit c9480681012fc7101b34f76c9ff03b14b0ee7137
Merge: 3f6870e 1942f58
Author: Clement Creusot <creusot at cs.york.ac.uk>
AuthorDate: Fri Apr 1 11:58:15 2011 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Apr 1 11:58:15 2011 -0400
Merge topic 'module-armadillo' into next
1942f58 Add new module Armadillo
0315d3b KWSys Nightly Date Stamp
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1942f583b37da01cb2827c28f7e3fa23dd712cfa
commit 1942f583b37da01cb2827c28f7e3fa23dd712cfa
Author: Clement Creusot <creusot at cs.york.ac.uk>
AuthorDate: Fri Apr 1 16:56:32 2011 +0100
Commit: Clement Creusot <creusot at cs.york.ac.uk>
CommitDate: Fri Apr 1 16:56:32 2011 +0100
Add new module Armadillo
diff --git a/Modules/FindArmadillo.cmake b/Modules/FindArmadillo.cmake
new file mode 100644
index 0000000..dca0377
--- /dev/null
+++ b/Modules/FindArmadillo.cmake
@@ -0,0 +1,96 @@
+# - Try to find Armadillo include dirs and libraries
+# Usage of this module as follows:
+#
+# == Using Armadillo: ==
+# find_package( Armadillo RECQUIRED )
+# include_directories(${ARMADILLO_INCLUDE_DIRS})
+# add_executable(foo foo.cc)
+# target_link_libraries(foo ${ARMADILLO_LIBRARIES})
+#
+#=============================================================================
+#
+# This module sets the following variables:
+# ARMADILLO_FOUND - set to true if the library is found
+# ARMADILLO_INCLUDE_DIRS - list of required include directories
+# ARMADILLO_LIBRARIES - list of libraries to be linked
+# ARMADILLO_VERSION_MAJOR - major version number
+# ARMADILLO_VERSION_MINOR - minor version number
+# ARMADILLO_VERSION_PATCH - patch version number
+# ARMADILLO_VERSION_STRING - version number as a string (ex: "1.0.4")
+# ARMADILLO_VERSION_NAME - name of the version (ex: "Antipodean Antileech")
+#
+#=============================================================================
+# Copyright 2011 Clement Creusot
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#
+#=============================================================================
+
+# UNIX paths are standard, no need to write.
+find_library(ARMADILLO_LIBRARY
+ NAMES armadillo
+ PATHS "$ENV{ProgramFiles}/Armadillo/lib" "$ENV{ProgramFiles}/Armadillo/lib64" "$ENV{ProgramFiles}/Armadillo"
+ )
+find_path(ARMADILLO_INCLUDE_DIR
+ NAMES armadillo
+ PATHS "$ENV{ProgramFiles}/Armadillo/include"
+ )
+
+
+if(ARMADILLO_INCLUDE_DIR)
+
+ # ------------------------------------------------------------------------
+ # Extract version information from <armadillo>
+ # ------------------------------------------------------------------------
+
+ # WARNING: Early releases of Armadillo didn't have the arma_version.hpp file.
+ # (e.g. v.0.9.8-1 in ubuntu maverick packages (2001-03-15))
+ # If the file is missing, set all values to 0
+ set(ARMADILLO_VERSION_MAJOR 0)
+ set(ARMADILLO_VERSION_MINOR 0)
+ set(ARMADILLO_VERSION_PATCH 0)
+ set(ARMADILLO_VERSION_NAME "EARLY RELEASE")
+
+ if(EXISTS "${ARMADILLO_INCLUDE_DIR}/armadillo_bits/arma_version.hpp")
+
+ # Read and parse armdillo version header file for version number
+ file(READ "${ARMADILLO_INCLUDE_DIR}/armadillo_bits/arma_version.hpp" _armadillo_HEADER_CONTENTS)
+ string(REGEX REPLACE ".*#define ARMA_VERSION_MAJOR ([0-9]+).*" "\\1" ARMADILLO_VERSION_MAJOR "${_armadillo_HEADER_CONTENTS}")
+ string(REGEX REPLACE ".*#define ARMA_VERSION_MINOR ([0-9]+).*" "\\1" ARMADILLO_VERSION_MINOR "${_armadillo_HEADER_CONTENTS}")
+ string(REGEX REPLACE ".*#define ARMA_VERSION_PATCH ([0-9]+).*" "\\1" ARMADILLO_VERSION_PATCH "${_armadillo_HEADER_CONTENTS}")
+
+ # WARNING: The number of spaces before the version name is not one.
+ string(REGEX REPLACE ".*#define ARMA_VERSION_NAME\ +\"([0-9a-zA-Z\ _-]+)\".*" "\\1" ARMADILLO_VERSION_NAME "${_armadillo_HEADER_CONTENTS}")
+
+ endif(EXISTS "${ARMADILLO_INCLUDE_DIR}/armadillo_bits/arma_version.hpp")
+
+ set(ARMADILLO_VERSION_STRING "${ARMADILLO_VERSION_MAJOR}.${ARMADILLO_VERSION_MINOR}.${ARMADILLO_VERSION_PATCH}")
+endif (ARMADILLO_INCLUDE_DIR)
+
+#======================
+
+
+# Checks 'RECQUIRED', 'QUIET' and versions.
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(Armadillo
+ REQUIRED_VARS ARMADILLO_LIBRARY ARMADILLO_INCLUDE_DIR
+ VERSION_VAR ARMADILLO_VERSION_STRING)
+# version_var fails with cmake < 2.8.4.
+
+if (ARMADILLO_FOUND)
+ set(ARMADILLO_INCLUDE_DIRS ${ARMADILLO_INCLUDE_DIR})
+ set(ARMADILLO_LIBRARIES ${ARMADILLO_LIBRARY})
+endif (ARMADILLO_FOUND)
+
+
+# Hide internal variables
+mark_as_advanced(
+ ARMADILLO_INCLUDE_DIR
+ ARMADILLO_LIBRARY)
+
+#======================
-----------------------------------------------------------------------
Summary of changes:
Modules/FindArmadillo.cmake | 96 +++++++++++++++++++++++++++++++++++++
Source/kwsys/kwsysDateStamp.cmake | 4 +-
2 files changed, 98 insertions(+), 2 deletions(-)
create mode 100644 Modules/FindArmadillo.cmake
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list