Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

support for cmake uninstall target

(also added missing version.h file)

Change-Id: I1abd44250de93a9a76d17927e3647e87f37c78a3
  • Loading branch information...
commit 1abf8cd296f47dab3a4704f341bd741222f9cb47 1 parent 7b401e0
Ricky Cormier authored
Showing with 166 additions and 0 deletions.
  1. +28 −0 .gitignore
  2. +43 −0 CMakeLists.txt
  3. +95 −0 include/fplib/version.h
View
28 .gitignore
@@ -0,0 +1,28 @@
+# Ignore "private" files & folders
+/@*
+
+# Ignore cachegrind output files
+cachegrind.out.*
+
+# Ignore gcc files
+*.a
+*.o
+*.so
+
+# Ignore log files
+*.log
+
+# Ignore CMake related auto-generated files
+CMakeFiles/
+CMakeCache.txt
+Makefile
+cmake_install.cmake
+cmake_uninstall.cmake
+cmake_uninstall.cmake.in
+install_manifest.txt
+/config.cmake
+/configure-stamp
+/configure.json
+
+# Ignore git 'origin' file
+*.orig
View
43 CMakeLists.txt
@@ -30,6 +30,49 @@ IF(config_file STREQUAL NOTFOUND)
LINK_DIRECTORIES(/opt/local/lib)
ENDIF(APPLE)
+
+ # Create uninstall target
+ FILE(WRITE cmake_uninstall.cmake.in
+ "IF(COMMAND cmake_policy)\n"
+ " IF(POLICY CMP0007)\n"
+ " CMAKE_POLICY(SET CMP0007 OLD)\n"
+ " ENDIF(POLICY CMP0007)\n"
+ "ENDIF(COMMAND cmake_policy)\n"
+ "\n"
+ "IF (NOT EXISTS \"\@CMAKE_CURRENT_BINARY_DIR\@/install_manifest.txt\")\n"
+ " MESSAGE(FATAL_ERROR \"Cannot find install manifest: @CMAKE_CURRENT_BINARY_DIR\@/install_manifest.txt\")\n"
+ "ENDIF(NOT EXISTS \"\@CMAKE_CURRENT_BINARY_DIR\@/install_manifest.txt\")\n"
+ "\n"
+ "FILE(READ \"\@CMAKE_CURRENT_BINARY_DIR\@/install_manifest.txt\" files)\n"
+ "STRING(REGEX REPLACE \"\\n\" \";\" files \"\${files}\")\n"
+ "LIST(REVERSE files)\n"
+ "\n"
+ "FOREACH (file \${files})\n"
+ " MESSAGE(STATUS \"Uninstalling \$ENV{DESTDIR}\${file}\")\n"
+ " if (EXISTS \"\$ENV{DESTDIR}\${file}\")\n"
+ " EXECUTE_PROCESS(\n"
+ " COMMAND \@CMAKE_COMMAND\@ -E remove \"\$ENV{DESTDIR}\${file}\"\n"
+ " OUTPUT_VARIABLE rm_out\n"
+ " RESULT_VARIABLE rm_retval\n"
+ " )\n"
+ " IF(NOT \${rm_retval} EQUAL 0)\n"
+ " MESSAGE(FATAL_ERROR \"Problem when removing \$ENV{DESTDIR}\${file}\")\n"
+ " ENDIF (NOT \${rm_retval} EQUAL 0)\n"
+ " ELSE (EXISTS \"\$ENV{DESTDIR}\${file}\")\n"
+ " MESSAGE(STATUS \"File \$ENV{DESTDIR}\${file} does not exist.\")\n"
+ " ENDIF (EXISTS \"\$ENV{DESTDIR}\${file}\")\n"
+ "ENDFOREACH(file)\n"
+ )
+
+ CONFIGURE_FILE(
+ "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
+ IMMEDIATE @ONLY
+ )
+
+ ADD_CUSTOM_TARGET(uninstall
+ COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
+
ENDIF()
# Required for taglib
View
95 include/fplib/version.h
@@ -0,0 +1,95 @@
+#ifndef LIBFPLIB_FPLIB_VERSION_H_9ABE03B1_
+#define LIBFPLIB_FPLIB_VERSION_H_9ABE03B1_
+
+#define LIBFPLIB_NAME_STR "libfplib"
+#define LIBFPLIB_VERSION_STR "1.6.1"
+#define LIBFPLIB_DESCRIPTION_STR "Last FM fingerprint library runtime"
+#define LIBFPLIB_COPYRIGHT_STR "(C) 2012 Last.fm Ltd"
+#define LIBFPLIB_COPYRIGHT_FULL_STR "Copyright (C) 2012 Last.fm Ltd"
+
+#define LIBFPLIB_PROJECT_STR "libfplib"
+#define LIBFPLIB_PACKAGE_STR "lastfm-libfplib"
+#define LIBFPLIB_AUTHOR_STR "Ricky Cormier <ricky@last.fm>"
+#define LIBFPLIB_RELEASE_ISODATE_STR "2012-05-23T15:17:49+00:00"
+#define LIBFPLIB_RELEASE_YEAR_STR "2012"
+#define LIBFPLIB_RELEASE_DATE_STR "2012-05-23"
+#define LIBFPLIB_RELEASE_TIME_STR "15:17:49"
+#define LIBFPLIB_FULL_REVISION_STR "1.6.1"
+#define LIBFPLIB_REVISION_STR "1.6.1"
+
+#define LIBFPLIB_RELEASE_YEAR 2012
+#define LIBFPLIB_RELEASE_EPOCH_TIME 1337786269
+#define LIBFPLIB_MAJOR_REVISION 1
+#define LIBFPLIB_MINOR_REVISION 6
+#define LIBFPLIB_PATCHLEVEL 1
+
+#ifdef __cplusplus
+
+#include <string>
+
+namespace fm { namespace last { namespace version {
+
+ ////////////////////////////////////////////////////////////////////////////
+ // Use this class if you just need access to version info and have no need
+ // to instantiate an object that will provide access to that version info.
+
+ struct libfplib_vinfo
+ {
+ static std::string name() { return LIBFPLIB_NAME_STR; }
+ static std::string version() { return LIBFPLIB_VERSION_STR; }
+ static std::string description() { return LIBFPLIB_DESCRIPTION_STR; }
+ static std::string copyright() { return LIBFPLIB_COPYRIGHT_STR; }
+ static std::string copyright_full() { return LIBFPLIB_COPYRIGHT_FULL_STR; }
+ static std::string project_str() { return LIBFPLIB_PROJECT_STR; }
+ static std::string package_str() { return LIBFPLIB_PACKAGE_STR; }
+ static std::string author_str() { return LIBFPLIB_AUTHOR_STR; }
+ static std::string release_isodate_str() { return LIBFPLIB_RELEASE_ISODATE_STR; }
+ static std::string release_year_str() { return LIBFPLIB_RELEASE_YEAR_STR; }
+ static std::string release_date_str() { return LIBFPLIB_RELEASE_DATE_STR; }
+ static std::string release_time_str() { return LIBFPLIB_RELEASE_TIME_STR; }
+ static std::string full_revision_str() { return LIBFPLIB_FULL_REVISION_STR; }
+ static std::string revision_str() { return LIBFPLIB_REVISION_STR; }
+ static int release_year() { return LIBFPLIB_RELEASE_YEAR; }
+ static time_t release_epoch_time() { return LIBFPLIB_RELEASE_EPOCH_TIME; }
+ static int major_revision() { return LIBFPLIB_MAJOR_REVISION; }
+ static int minor_revision() { return LIBFPLIB_MINOR_REVISION; }
+ static int patchlevel() { return LIBFPLIB_PATCHLEVEL; }
+
+ };
+
+ ////////////////////////////////////////////////////////////////////////////
+ // Use this class if you have an existing interface that defines the vinfo
+ // functions and expects them to be implemented by a derived class.
+
+ template <typename Base>
+ struct libfplib_vinfo_ : Base
+ {
+ virtual std::string name() const { return libfplib_vinfo::name(); }
+ virtual std::string version() const { return libfplib_vinfo::version(); }
+ virtual std::string description() const { return libfplib_vinfo::description(); }
+ virtual std::string copyright() const { return libfplib_vinfo::copyright(); }
+ virtual std::string copyright_full() const { return libfplib_vinfo::copyright_full(); }
+ virtual std::string project_str() const { return libfplib_vinfo::project_str(); }
+ virtual std::string package_str() const { return libfplib_vinfo::package_str(); }
+ virtual std::string author_str() const { return libfplib_vinfo::author_str(); }
+ virtual std::string release_isodate_str() const { return libfplib_vinfo::release_isodate_str(); }
+ virtual std::string release_year_str() const { return libfplib_vinfo::release_year_str(); }
+ virtual std::string release_date_str() const { return libfplib_vinfo::release_date_str(); }
+ virtual std::string release_time_str() const { return libfplib_vinfo::release_time_str(); }
+ virtual std::string full_revision_str() const { return libfplib_vinfo::full_revision_str(); }
+ virtual std::string revision_str() const { return libfplib_vinfo::revision_str(); }
+ virtual int release_year() const { return libfplib_vinfo::release_year(); }
+ virtual time_t release_epoch_time() const { return libfplib_vinfo::release_epoch_time(); }
+ virtual int major_revision() const { return libfplib_vinfo::major_revision(); }
+ virtual int minor_revision() const { return libfplib_vinfo::minor_revision(); }
+ virtual int patchlevel() const { return libfplib_vinfo::patchlevel(); }
+
+ };
+
+ ////////////////////////////////////////////////////////////////////////////
+
+} } }
+
+#endif /* __cplusplus */
+
+#endif /* LIBFPLIB_FPLIB_VERSION_H_9ABE03B1_ */
Please sign in to comment.
Something went wrong with that request. Please try again.