-
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.
Added readme and adapted python discoverage
- Loading branch information
Showing
3 changed files
with
113 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,3 @@ | ||
mkdir build | ||
cd build | ||
cmake '-DCMAKE_PREFIX_PATH=/path/1;/path/2' .. |
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,108 @@ | ||
# - Find python libraries | ||
# This module finds if Python is installed and determines where the | ||
# include files and libraries are. It also determines what the name of | ||
# the library is. This code sets the following variables: | ||
# | ||
# PYTHONLIBS_FOUND - have the Python libs been found | ||
# PYTHON_LIBRARIES - path to the python library | ||
# PYTHON_INCLUDE_PATH - path to where Python.h is found (deprecated) | ||
# PYTHON_INCLUDE_DIRS - path to where Python.h is found | ||
# PYTHON_DEBUG_LIBRARIES - path to the debug library | ||
# | ||
|
||
#============================================================================= | ||
# Copyright 2001-2009 Kitware, Inc. | ||
# | ||
# 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. | ||
#============================================================================= | ||
# (To distributed this file outside of CMake, substitute the full | ||
# License text for the above reference.) | ||
|
||
INCLUDE(CMakeFindFrameworks) | ||
# Search for the python framework on Apple. | ||
CMAKE_FIND_FRAMEWORKS(Python) | ||
|
||
FOREACH(_CURRENT_VERSION 2.7 2.7.1) | ||
STRING(REPLACE "." "" _CURRENT_VERSION_NO_DOTS ${_CURRENT_VERSION}) | ||
IF(WIN32) | ||
FIND_LIBRARY(PYTHON_DEBUG_LIBRARY | ||
NAMES python${_CURRENT_VERSION_NO_DOTS}_d python | ||
PATHS | ||
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs/Debug | ||
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs ) | ||
ENDIF(WIN32) | ||
|
||
FIND_LIBRARY(PYTHON_LIBRARY | ||
NAMES python${_CURRENT_VERSION_NO_DOTS} python${_CURRENT_VERSION} | ||
PATHS | ||
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs | ||
# Avoid finding the .dll in the PATH. We want the .lib. | ||
NO_SYSTEM_ENVIRONMENT_PATH | ||
) | ||
# Look for the static library in the Python config directory | ||
FIND_LIBRARY(PYTHON_LIBRARY | ||
NAMES python${_CURRENT_VERSION_NO_DOTS} python${_CURRENT_VERSION} | ||
# Avoid finding the .dll in the PATH. We want the .lib. | ||
NO_SYSTEM_ENVIRONMENT_PATH | ||
# This is where the static library is usually located | ||
PATH_SUFFIXES python${_CURRENT_VERSION}/config | ||
) | ||
|
||
# For backward compatibility, honour value of PYTHON_INCLUDE_PATH, if | ||
# PYTHON_INCLUDE_DIR is not set. | ||
IF(DEFINED PYTHON_INCLUDE_PATH AND NOT DEFINED PYTHON_INCLUDE_DIR) | ||
SET(PYTHON_INCLUDE_DIR "${PYTHON_INCLUDE_PATH}" CACHE PATH | ||
"Path to where Python.h is found" FORCE) | ||
ENDIF(DEFINED PYTHON_INCLUDE_PATH AND NOT DEFINED PYTHON_INCLUDE_DIR) | ||
|
||
SET(PYTHON_FRAMEWORK_INCLUDES) | ||
IF(Python_FRAMEWORKS AND NOT PYTHON_INCLUDE_DIR) | ||
FOREACH(dir ${Python_FRAMEWORKS}) | ||
SET(PYTHON_FRAMEWORK_INCLUDES ${PYTHON_FRAMEWORK_INCLUDES} | ||
${dir}/Versions/${_CURRENT_VERSION}/include/python${_CURRENT_VERSION}) | ||
ENDFOREACH(dir) | ||
ENDIF(Python_FRAMEWORKS AND NOT PYTHON_INCLUDE_DIR) | ||
|
||
FIND_PATH(PYTHON_INCLUDE_DIR | ||
NAMES Python.h | ||
PATHS | ||
${PYTHON_FRAMEWORK_INCLUDES} | ||
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/include | ||
PATH_SUFFIXES | ||
python${_CURRENT_VERSION} | ||
) | ||
|
||
# For backward compatibility, set PYTHON_INCLUDE_PATH, but make it internal. | ||
SET(PYTHON_INCLUDE_PATH "${PYTHON_INCLUDE_DIR}" CACHE INTERNAL | ||
"Path to where Python.h is found (deprecated)") | ||
|
||
ENDFOREACH(_CURRENT_VERSION) | ||
|
||
MARK_AS_ADVANCED( | ||
PYTHON_DEBUG_LIBRARY | ||
PYTHON_LIBRARY | ||
PYTHON_INCLUDE_DIR | ||
) | ||
|
||
# We use PYTHON_INCLUDE_DIR, PYTHON_LIBRARY and PYTHON_DEBUG_LIBRARY for the | ||
# cache entries because they are meant to specify the location of a single | ||
# library. We now set the variables listed by the documentation for this | ||
# module. | ||
SET(PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_DIR}") | ||
SET(PYTHON_LIBRARIES "${PYTHON_LIBRARY}") | ||
SET(PYTHON_DEBUG_LIBRARIES "${PYTHON_DEBUG_LIBRARY}") | ||
|
||
if(NOT PYTHON_INCLUDE_DIR STREQUAL "PYTHON_INCLUDE_DIR-NOTFOUND") | ||
MESSAGE(STATUS "Found Python includes: ${PYTHON_INCLUDE_DIR}") | ||
endif() | ||
if(NOT PYTHON_LIBRARY STREQUAL "PYTHON_LIBRARY-NOTFOUND") | ||
MESSAGE(STATUS "Found Python libraries: ${PYTHON_LIBRARIES}") | ||
endif() | ||
|
||
INCLUDE(FindPackageHandleStandardArgs) | ||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PythonLibs DEFAULT_MSG PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS) |