forked from opencog/cogutil
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request opencog#4 from singnet/organize-cmake-files-2
Apply .cmake reorganization changes from opencog to singnet repository.
- Loading branch information
Showing
9 changed files
with
356 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Copyright (c) 2015 OpenCog.org (http://opencog.org) | ||
# | ||
# Redistribution and use is allowed according to the terms of the BSD license. | ||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file. | ||
|
||
# - Try to find GHC; Once done this will define | ||
# | ||
# GHC_FOUND - system has the GHC Haskell compiler | ||
|
||
|
||
FIND_PROGRAM(GHC_EXECUTABLE ghc) | ||
|
||
IF (DEFINED GHC_EXECUTABLE) | ||
SET(GHC_FOUND TRUE) | ||
|
||
# Non-working attempt to tell CMake what the .hs extension means. | ||
# Again, this doesn't work .... | ||
ADD_CUSTOM_COMMAND( | ||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${NAME}.o | ||
COMMAND "${GHC_EXECUTABLE}" | ||
# -o ${CMAKE_CURRENT_BINARY_DIR}/${NAME}.o | ||
${CMAKE_CURRENT_SOURCE_DIR}/${NAME}.hs | ||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${NAME}.hs | ||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} | ||
) | ||
|
||
ELSE () | ||
SET(GHC_FOUND FALSE) | ||
ENDIF () | ||
|
||
|
||
IF(GHC_FOUND) | ||
IF(NOT GHC_FIND_QUIETLY) | ||
MESSAGE(STATUS "GHC was found.") | ||
ENDIF(NOT GHC_FIND_QUIETLY) | ||
ELSE(GHC_FOUND) | ||
SET(GHC_DIR_MESSAGE "GHC was not found.") | ||
IF(NOT GHC_FIND_QUIETLY) | ||
MESSAGE(STATUS "${GHC_DIR_MESSAGE}") | ||
ELSE(NOT GHC_FIND_QUIETLY) | ||
IF(GHC_FIND_REQUIRED) | ||
MESSAGE(FATAL_ERROR "${GHC_DIR_MESSAGE}") | ||
ENDIF(GHC_FIND_REQUIRED) | ||
ENDIF(NOT GHC_FIND_QUIETLY) | ||
ENDIF(GHC_FOUND) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
# - Try to find the link-grammar library; Once done this will define | ||
# | ||
# LINK_GRAMMAR_FOUND - system has the link-grammar library | ||
# LINK_GRAMMAR_INCLUDE_DIRS - the link-grammar include directory | ||
# LINK_GRAMMAR_LIBRARIES - The libraries needed to use link-grammar | ||
# LINK_GRAMMAR_DATA_DIR - the dir where you will find the dictionaries | ||
|
||
# Copyright (c) 2008 OpenCog.org (http://opencog.org) | ||
# Copyright (c) 2014 Linas Vepstas | ||
# | ||
# Redistribution and use in source and binary forms, with or without | ||
# modification, are permitted provided that the following conditions | ||
# are met: | ||
# | ||
# 1. Redistributions of source code must retain the copyright | ||
# notice, this list of conditions and the following disclaimer. | ||
# 2. Redistributions in binary form must reproduce the copyright | ||
# notice, this list of conditions and the following disclaimer in the | ||
# documentation and/or other materials provided with the distribution. | ||
# 3. The name of the author may not be used to endorse or promote products | ||
# derived from this software without specific prior written permission. | ||
# | ||
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | ||
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | ||
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | ||
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
|
||
# Look for the header file | ||
FIND_PATH(LINK_GRAMMAR_INCLUDE_DIR link-grammar/link-includes.h) | ||
FIND_PATH(LINK_GRAMMAR_DATA_DIR 4.0.dict | ||
PATHS | ||
/usr/share/link-grammar/en/ | ||
/usr/local/share/link-grammar/en/ | ||
/opt/local/share/link-grammar/en/ | ||
PATH_SUFFIXES share/link-grammar/en/ ) | ||
|
||
# Look for the library | ||
FIND_LIBRARY(LINK_GRAMMAR_LIBRARY | ||
NAMES | ||
link-grammar | ||
PATHS | ||
/usr/lib | ||
/usr/local/lib | ||
/opt/link-grammar/lib | ||
/opt/local/lib) | ||
|
||
# Copy the results to the output variables. | ||
IF (LINK_GRAMMAR_INCLUDE_DIR AND LINK_GRAMMAR_LIBRARY AND LINK_GRAMMAR_DATA_DIR) | ||
SET(LINK_GRAMMAR_FOUND 1) | ||
SET(LINK_GRAMMAR_LIBRARIES ${LINK_GRAMMAR_LIBRARY}) | ||
SET(LINK_GRAMMAR_INCLUDE_DIRS ${LINK_GRAMMAR_INCLUDE_DIR}) | ||
ELSE (LINK_GRAMMAR_INCLUDE_DIR AND LINK_GRAMMAR_LIBRARY AND LINK_GRAMMAR_DATA_DIR) | ||
SET(LINK_GRAMMAR_FOUND 0) | ||
SET(LINK_GRAMMAR_LIBRARIES) | ||
SET(LINK_GRAMMAR_INCLUDE_DIRS) | ||
ENDIF (LINK_GRAMMAR_INCLUDE_DIR AND LINK_GRAMMAR_LIBRARY AND LINK_GRAMMAR_DATA_DIR) | ||
|
||
# check link-grammar's version if we're using cmake >= 2.6 | ||
IF(LINK_GRAMMAR_INCLUDE_DIR AND NOT CMAKE_MAJOR_VERSION LESS 2 AND NOT CMAKE_MINOR_VERSION LESS 6) | ||
SET(LG_VERSION_MAJOR 0) | ||
SET(LG_VERSION_MINOR 0) | ||
SET(LG_VERSION_PATCH 0) | ||
|
||
# Extract the version from the 'version.h' file | ||
FILE(READ "${LINK_GRAMMAR_INCLUDE_DIR}/link-grammar/link-features.h" _LG_FEAT_H_CONTENTS) | ||
|
||
STRING(REGEX MATCH "#define LINK_MAJOR_VERSION[ ]+([0-9]+)" _MATCH "${_LG_FEAT_H_CONTENTS}") | ||
SET(LG_VERSION_MAJOR ${CMAKE_MATCH_1}) | ||
STRING(REGEX MATCH "#define LINK_MINOR_VERSION[ ]+([0-9]+)" _MATCH "${_LG_FEAT_H_CONTENTS}") | ||
SET(LG_VERSION_MINOR ${CMAKE_MATCH_1}) | ||
STRING(REGEX MATCH "#define LINK_MICRO_VERSION[ ]+([0-9]+)" _MATCH "${_LG_FEAT_H_CONTENTS}") | ||
SET(LG_VERSION_PATCH ${CMAKE_MATCH_1}) | ||
|
||
SET(LG_VERSION "${LG_VERSION_MAJOR}.${LG_VERSION_MINOR}.${LG_VERSION_PATCH}") | ||
|
||
# Check found version against required one | ||
IF (DEFINED LinkGrammar_FIND_VERSION AND ${LG_VERSION} VERSION_LESS LinkGrammar_FIND_VERSION) | ||
SET(LINK_GRAMMAR_FOUND FALSE) | ||
ELSE () | ||
SET(LINK_GRAMMAR_FOUND TRUE) | ||
ENDIF () | ||
ENDIF(LINK_GRAMMAR_INCLUDE_DIR AND NOT CMAKE_MAJOR_VERSION LESS 2 AND NOT CMAKE_MINOR_VERSION LESS 6) | ||
|
||
IF (LinkGrammar_FIND_VERSION) | ||
SET(_LG_VERSION_MESSAGE_STRING "(${LG_VERSION} >= ${LinkGrammar_FIND_VERSION})") | ||
ENDIF (LinkGrammar_FIND_VERSION) | ||
|
||
# Report the results. | ||
IF (LINK_GRAMMAR_FOUND) | ||
IF (NOT LINK_GRAMMAR_FIND_QUIETLY) | ||
MESSAGE(STATUS "Link Grammar ${_LG_VERSION_MESSAGE_STRING} found.") | ||
ENDIF (NOT LINK_GRAMMAR_FIND_QUIETLY) | ||
ELSE (LINK_GRAMMAR_FOUND) | ||
SET(LINK_GRAMMAR_DIR_MESSAGE | ||
"link-grammar${_LG_VERSION_MESSAGE_STRING} was not found. Make sure LINK_GRAMMAR_LIBRARY, LINK_GRAMMAR_INCLUDE_DIR and LINK_GRAMMAR_DATA_DIR are set.") | ||
IF (NOT LINK_GRAMMAR_FIND_QUIETLY) | ||
MESSAGE(STATUS "${LINK_GRAMMAR_DIR_MESSAGE}") | ||
ELSE (NOT LINK_GRAMMAR_FIND_QUIETLY) | ||
IF (LINK_GRAMMAR_FIND_REQUIRED) | ||
MESSAGE(FATAL_ERROR "${LINK_GRAMMAR_DIR_MESSAGE}") | ||
ENDIF (LINK_GRAMMAR_FIND_REQUIRED) | ||
ENDIF (NOT LINK_GRAMMAR_FIND_QUIETLY) | ||
ENDIF (LINK_GRAMMAR_FOUND) | ||
|
||
MARK_AS_ADVANCED( | ||
LINK_GRAMMAR_INCLUDE_DIR | ||
LINK_GRAMMAR_LIBRARY | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
# - Find MOSES library | ||
# | ||
# This module checks for the required version number and defines | ||
# MOSES_LIBRARIES, the libraries to link against to use MOSES. | ||
# MOSES_LIB_DIR, the location of the libraries | ||
# MOSES_FOUND, If false, do not try to use MOSES | ||
# | ||
# Redistribution and use is allowed according to the terms of the BSD license. | ||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file. | ||
|
||
FIND_LIBRARY(MOSES_LIBRARY NAMES moses PATHS | ||
/usr/lib | ||
/usr/local/lib | ||
PATH_SUFFIXES moses | ||
) | ||
|
||
FIND_LIBRARY(MOSES_EXEC_LIBRARY NAMES moses_exec PATHS | ||
PATH_SUFFIXES moses | ||
) | ||
|
||
FIND_LIBRARY(COMBOANT_LIBRARY NAMES comboant PATHS | ||
PATH_SUFFIXES moses | ||
) | ||
|
||
FIND_LIBRARY(COMBOREDUCT_LIBRARY NAMES comboreduct PATHS | ||
PATH_SUFFIXES moses | ||
) | ||
|
||
FIND_LIBRARY(FEATURE_SELECTION_LIBRARY NAMES feature_selection PATHS | ||
PATH_SUFFIXES moses | ||
) | ||
|
||
# Copy the results to the output variables. | ||
IF (MOSES_LIBRARY) | ||
SET(MOSES_FOUND 1) | ||
SET(MOSES_LIBRARIES ${MOSES_LIBRARY} ${MOSES_EXEC_LIBRARY} | ||
${COMBOANT_LIBRARY} ${COMBOREDUCT_LIBRARY} | ||
${FEATURE_SELECTION_LIBRARY}) | ||
MESSAGE(STATUS "Found MOSES library: ${MOSES_LIBRARIES}") | ||
ELSE (MOSES_LIBRARY) | ||
SET(MOSES_FOUND 0) | ||
SET(MOSES_LIBRARIES) | ||
ENDIF (MOSES_LIBRARY) | ||
|
||
# Check found version against required one | ||
IF (MOSES_FOUND) | ||
FIND_FILE(MOSES_CFG_FILE moses.h | ||
/usr/include | ||
/usr/local/include | ||
) | ||
# IF (DEFINED MOSES_CFG_FILE) | ||
# FILE(READ "${MOSES_CFG_FILE}" _MOSES_VERSION_H_CONTENTS) | ||
# STRING(REGEX MATCH "#define MOSES_VERSION_MAJOR ([0-9])" _MATCH "${_MOSES_VERSION_H_CONTENTS}") | ||
# SET(MOSES_VERSION_MAJOR ${CMAKE_MATCH_1}) | ||
# STRING(REGEX MATCH "#define MOSES_VERSION_MINOR ([0-9])" _MATCH "${_MOSES_VERSION_H_CONTENTS}") | ||
# SET(MOSES_VERSION_MINOR ${CMAKE_MATCH_1}) | ||
# STRING(REGEX MATCH "#define MOSES_VERSION_PATCH ([0-9])" _MATCH "${_MOSES_VERSION_H_CONTENTS}") | ||
# SET(MOSES_VERSION_PATCH ${CMAKE_MATCH_1}) | ||
# set (MOSES_VERSION "${MOSES_VERSION_MAJOR}.${MOSES_VERSION_MINOR}.${MOSES_VERSION_PATCH}") | ||
# MESSAGE(STATUS "Detected MOSES version number: ${MOSES_VERSION}") | ||
# IF (DEFINED MOSES_VERSION AND MOSES_VERSION VERSION_LESS MOSES_FIND_VERSION) | ||
# SET(MOSES_FOUND FALSE) | ||
# MESSAGE(STATUS "Installed version ${MOSES_VERSION} of MOSES does not meet the minimum required version of ${MOSES_FIND_VERSION}") | ||
# ENDIF () | ||
# ELSE () | ||
# MESSAGE(STATUS "Unable to find moses.h header file") | ||
# SET(MOSES_FOUND 0) | ||
# ENDIF () | ||
ENDIF () | ||
|
||
# Report the results. | ||
IF (NOT MOSES_FOUND) | ||
SET(MOSES_DIR_MESSAGE "Required version of MOSES was not found. Make sure the MOSES_LIBRARY environment variable is set.") | ||
MESSAGE(STATUS "${MOSES_DIR_MESSAGE}") | ||
IF (MOSES_FIND_REQUIRED) | ||
MESSAGE(FATAL_ERROR "${MOSES_DIR_MESSAGE}") | ||
ENDIF (MOSES_FIND_REQUIRED) | ||
ENDIF (NOT MOSES_FOUND) | ||
|
||
MARK_AS_ADVANCED( | ||
MOSES_LIBRARIES | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
set(OCTOMAP_LIBPATH | ||
/opt/ros/kinetic/lib | ||
/usr/lib | ||
/usr/local/lib) | ||
|
||
find_library(OCTOMAP_LIBRARY octomap PATH ${OCTOMAP_LIBPATH}) | ||
message(STATUS "Find octomap lib ${OCTOMAP_LIBRARY}") | ||
|
||
find_library(OCTOMAP_OCTOMATH_LIBRARY octomath PATH ${OCTOMAP_LIBPATH}) | ||
message(STATUS "Find octomath lib ${OCTOMAP_OCTOMATH_LIBRARY}") | ||
|
||
set(OCTOMAP_LIBRARIES | ||
${OCTOMAP_LIBRARY} | ||
${OCTOMAP_OCTOMATH_LIBRARY} | ||
) | ||
|
||
INCLUDE (CheckIncludeFiles) | ||
|
||
find_path(OCTOMAP_INCLUDE_DIR octomap/octomap.h | ||
PATH /usr/include /opt/ros/kinetic/include | ||
/usr/local/include | ||
) | ||
|
||
if (OCTOMAP_LIBRARY AND OCTOMAP_INCLUDE_DIR) | ||
set(OCTOMAP_FOUND TRUE) | ||
endif (OCTOMAP_LIBRARY AND OCTOMAP_INCLUDE_DIR) | ||
|
||
if (OCTOMAP_FOUND) | ||
message(STATUS "Found octomap headers at ${OCTOMAP_INCLUDE_DIR}") | ||
else (OCTOMAP_FOUND) | ||
message(STATUS "Octomap not found") | ||
endif (OCTOMAP_FOUND) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Try to find UUID | ||
# Once done this will define | ||
# UUID_FOUND | ||
# UUID_INCLUDE_DIRS | ||
# UUID_LIBRARIES | ||
# UUID_DEFINITIONS | ||
|
||
find_package(PkgConfig) | ||
pkg_check_modules(PC_UUID QUIET libuuid) | ||
set(UUID_DEFINITIONS ${PC_UUID_CFLAGS_OTHER}) | ||
|
||
find_path(UUID_INCLUDE_DIR uuid/uuid.h HINTS ${PC_UUID_INCLUDEDIR} ${PC_UUID_INCLUDE_DIRS} PATH_SUFFIXES uuid) | ||
|
||
find_library(UUID_LIBRARY NAMES uuid libuuid HINTS ${PC_UUID_LIBDIR} ${PC_UUID_LIBRARY_DIRS}) | ||
|
||
set(UUID_LIBRARIES ${UUID_LIBRARY}) | ||
set(UUID_INCLUDE_DIRS ${UUID_INCLUDE_DIR}) | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(UUID DEFAULT_MSG UUID_LIBRARY UUID_INCLUDE_DIR) | ||
|
||
mark_as_advanced(UUID_INCLUDE_DIR UUID_LIBRARY) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# - Find cpprest library | ||
# | ||
# This module checks for the required version number and defines | ||
# cpprest_LIBRARIES, the libraries to link against to use cpprest. | ||
# cpprest_LIB_DIR, the location of the libraries | ||
# cpprest_FOUND, If false, do not try to build PatternMiner | ||
# | ||
# Redistribution and use is allowed according to the terms of the BSD license. | ||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file. | ||
|
||
FIND_LIBRARY(cpprest_LIBRARY NAMES cpprest PATHS | ||
/usr/lib | ||
/usr/local/lib | ||
) | ||
|
||
# Check cpprest's version | ||
IF (cpprest_LIBRARY) | ||
FIND_FILE(cpprest_version_FILE version.h | ||
/usr/include/cpprest/ | ||
/usr/local/include/cpprest/ | ||
) | ||
IF (DEFINED cpprest_version_FILE) | ||
FILE(READ "${cpprest_version_FILE}" _CPPREST_VERSION_H_CONTENTS) | ||
STRING(REGEX MATCH "#define CPPREST_VERSION_MAJOR ([0-9]+)" _MATCH "${_CPPREST_VERSION_H_CONTENTS}") | ||
SET(cpprest_VERSION_MAJOR ${CMAKE_MATCH_1}) | ||
STRING(REGEX MATCH "#define CPPREST_VERSION_MINOR ([0-9]+)" _MATCH "${_CPPREST_VERSION_H_CONTENTS}") | ||
SET(cpprest_VERSION_MINOR ${CMAKE_MATCH_1}) | ||
set (cpprest_VERSION "${cpprest_VERSION_MAJOR}.${cpprest_VERSION_MINOR}") | ||
MESSAGE(STATUS "Detected cpprest version number: ${cpprest_VERSION}") | ||
IF (DEFINED cpprest_VERSION AND cpprest_VERSION VERSION_LESS cpprest_FIND_VERSION) | ||
SET(cpprest_FOUND 0) | ||
SET(cpprest_LIBRARIES) | ||
MESSAGE(STATUS "Installed version ${cpprest_VERSION} of cpprest does not meet the minimum required version of ${cpprest_FIND_VERSION}") | ||
ELSE () | ||
SET(cpprest_FOUND 1) | ||
SET(cpprest_LIBRARIES ${cpprest_LIBRARY}) | ||
MESSAGE(STATUS "Found libcpprest library: ${cpprest_LIBRARIES}") | ||
ENDIF () | ||
ELSE () | ||
SET(cpprest_FOUND 0) | ||
SET(cpprest_LIBRARIES ) | ||
MESSAGE(STATUS "Unkown cpprest version: unable to find version.h in cpprest/include/") | ||
ENDIF () | ||
ELSE (cpprest_LIBRARY) | ||
SET(cpprest_FOUND 0) | ||
SET(cpprest_LIBRARIES) | ||
ENDIF (cpprest_LIBRARY) | ||
|
||
MARK_AS_ADVANCED( | ||
cpprest_LIBRARIES | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters