Skip to content

Commit

Permalink
drop-in files for finding SHOGUN from CMake or pkg-config
Browse files Browse the repository at this point in the history
  • Loading branch information
Björn Esser committed Dec 30, 2013
1 parent 63624a0 commit 8ea8b12
Show file tree
Hide file tree
Showing 4 changed files with 111 additions and 0 deletions.
Empty file.
51 changes: 51 additions & 0 deletions configs/ShogunConfig.cmake.in
@@ -0,0 +1,51 @@
# CMake-Config file for SHOGUN Machine Learning Toolbox
# Copyright (C) 2013 Björn Esser <besser82@fedoraproject.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
#
# It defines the following variables
# @PROJECT_NAME_UPPER@_INCLUDE_DIRS - include directories for lib@PROJECT_NAME@
# @PROJECT_NAME_UPPER@_LIBRARIES - libraries to link against
# @PROJECT_NAME_UPPER@_LIBRARIES_DIR - installation directory of lib@PROJECT_NAME@.so
# @PROJECT_NAME_UPPER@_CXXFLAGS - flags to pass to the C-compiler
# @PROJECT_NAME_UPPER@_CXXFLAGS - flags to pass to the C++-compiler
# @PROJECT_NAME_UPPER@_LDFLAGS - flags to pass to the linker

##### Compute paths #####
GET_FILENAME_COMPONENT( @PROJECT_NAME_UPPER@_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH )
IF( EXISTS "${@PROJECT_NAME_UPPER@_CMAKE_DIR}/CMakeCache.txt" )
INCLUDE( "${@PROJECT_NAME_UPPER@_CMAKE_DIR}/configs/@PROJECT_NAME_CAPITAL@BuildTreeSettings.cmake" )
ELSE()
SET( @PROJECT_NAME_UPPER@_INCLUDE_DIRS "@INCLUDE_INSTALL_DIR@/@PROJECT_NAME@" )
ENDIF()


##### Our library dependencies (contains definitions for IMPORTED targets) #####
INCLUDE( "${@PROJECT_NAME_UPPER@_CMAKE_DIR}/@PROJECT_NAME_CAPITAL@LibraryDepends.cmake" )


##### These are IMPORTED targets created by @PROJECT_NAME_CAPITAL@LibraryDepends.cmake #####
SET( @PROJECT_NAME_UPPER@_LIBRARIES "@PROJECT_NAME@" )
SET( @PROJECT_NAME_UPPER@_LIBRARIES_DIR "@LIB_INSTALL_DIR@" )


##### These are the flags for compiler and linker #####
SET( @PROJECT_NAME_UPPER@_CFLAGS "-I\"${@PROJECT_NAME_UPPER@_INCLUDE_DIRS}\"" )
SET( @PROJECT_NAME_UPPER@_CXXFLAGS "${@PROJECT_NAME_UPPER@_CFLAGS}" )
SET( @PROJECT_NAME_UPPER@_LDFLAGS "-L\"${@PROJECT_NAME_UPPER@_LIBRARIES_DIR}\" -l${@PROJECT_NAME_UPPER@_LIBRARIES}" )


##### Give a reply about @PROJECT_NAME_UPPER@ has been found #####
MESSAGE( STATUS "Found @PROJECT_NAME_CAPITAL@: ${IMPORTED_LOCATION_RELEASE} (Version: \"@VERSION_EXPORT@\")" )
30 changes: 30 additions & 0 deletions configs/ShogunConfigVersion.cmake.in
@@ -0,0 +1,30 @@
# CMake-Config file for SHOGUN Machine Learning Toolbox
# Copyright (C) 2013 Björn Esser <besser82@fedoraproject.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.


##### Define @PROJECT_NAME_UPPER@'s version #####
SET( PACKAGE_VERSION "@VERSION_EXPORT@" )


##### Check whether the requested PACKAGE_FIND_VERSION is compatible #####
IF( "${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}" )
SET( PACKAGE_VERSION_COMPATIBLE FALSE )
ELSE( "${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}" )
SET( PACKAGE_VERSION_COMPATIBLE TRUE )
IF( "${PACKAGE_VERSION}" VERSION_EQUAL "${PACKAGE_FIND_VERSION}" )
SET( PACKAGE_VERSION_EXACT TRUE )
ENDIF( "${PACKAGE_VERSION}" VERSION_EQUAL "${PACKAGE_FIND_VERSION}" )
ENDIF( "${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}" )
30 changes: 30 additions & 0 deletions configs/shogun.pc.in
@@ -0,0 +1,30 @@
# Package-Config file for SHOGUN Machine Learning Toolbox
# Copyright (C) 2013 Björn Esser <besser82@fedoraproject.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.


prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}
datarootdir=${exec_prefix}/@SHARE_INSTALL_DIR_NOPREFIX@
datadir=${datarootdir}/@PROJECT_NAME@
libdir=${exec_prefix}/@LIB_INSTALL_DIR_NOPREFIX@
includedir=${exec_prefix}/@INCLUDE_INSTALL_DIR_NOPREFIX@


Name: @PROJECT_NAME@
Version: @VERSION_EXPORT@
Description: The SHOGUN Machine Learning Toolbox
Libs: -l@PROJECT_NAME@
Cflags: -I${includedir}/@PROJECT_NAME@

0 comments on commit 8ea8b12

Please sign in to comment.