35 lines
1.1 KiB
CMake
35 lines
1.1 KiB
CMake
if (WIN32)
|
|
find_package(MinGW REQUIRED)
|
|
find_library(PIP_LIBRARY pip ${MINGW_LIB})
|
|
set(PIP_INCLUDES ${MINGW_INCLUDE}/pip)
|
|
set(PIP_CMG ${MINGW_BIN}/pip_cmg.exe)
|
|
else ()
|
|
find_library(PIP_LIBRARY pip /usr/lib/)
|
|
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
|
|
find_library(PTHREAD_LIBRARY pthread)
|
|
find_library(DL_LIBRARY dl)
|
|
find_library(UTIL_LIBRARY util)
|
|
list(APPEND PIP_LIBRARY ${PTHREAD_LIBRARY} ${DL_LIBRARY} ${UTIL_LIBRARY})
|
|
endif ()
|
|
set(PIP_INCLUDES /usr/include/pip)
|
|
set(PIP_CMG /usr/bin/pip_cmg)
|
|
endif ()
|
|
|
|
#set(PIP_CMG /usr/bin/pip_cmg)
|
|
|
|
if (NOT PIP_VERSION)
|
|
file(STRINGS "${PIP_INCLUDES}/pip_version_str.h" _VERSION REGEX "\".*\"")
|
|
string(REGEX MATCH "\".*\"" _VERSION ${_VERSION})
|
|
string(LENGTH ${_VERSION} SL)
|
|
math(EXPR SL '${SL}-2')
|
|
string(SUBSTRING ${_VERSION} 1 ${SL} _VERSION)
|
|
set(PIP_VERSION ${_VERSION} CACHE STRING "VERSION")
|
|
message(STATUS "Found PIP version ${PIP_VERSION}")
|
|
endif ()
|
|
if (PIP_FIND_VERSION VERSION_GREATER PIP_VERSION)
|
|
message(FATAL_ERROR "PIP version ${PIP_VERSION} is available, but ${PIP_FIND_VERSION} requested!")
|
|
endif ()
|
|
|
|
include(PIPMacros.cmake)
|
|
|