git-svn-id: svn://db.shs.com.ru/pip@397 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5

This commit is contained in:
2017-04-17 15:40:06 +00:00
parent 8304f59d09
commit e16ca645ef
4 changed files with 63 additions and 22 deletions

View File

@@ -34,6 +34,7 @@ file(WRITE "src/pip_version_str.h" "// This file was generated by PIP CMake, don
option(ICU "Unicode support" 1)
option(USB "USB support" 0)
option(STL "Building with STL containers" 0)
option(STL_IOSTREAM "Building with std iostream operators support" 0)
option(CRYPT "Crypt support" 0)
option(FFTW "fftw3 support for PIFFT" 0)
option(FFTW_THREADS "fftw3 support for threadsave" 1)
@@ -41,11 +42,22 @@ option(INTROSPECTION_CONTAINERS "Build with containers introspection" 0)
option(INTROSPECTION_THREADS "Build with threads introspection" 0)
option(LIB "System install" 1)
option(DEBUG "Build with -g3" 0)
set(CMAKE_BUILD_TYPE "Release")
set(LIBS)
if(DEBUG)
add_definitions(-DPIP_DEBUG)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g3")
message(STATUS "Build debug version")
else()
set(CMAKE_BUILD_TYPE "Release")
message(STATUS "Build relaese version")
endif()
if(STL_IOSTREAM)
add_definitions(-DPIP_STD_IOSTREAM)
message(STATUS "Building with std iostream operators support")
else()
message(STATUS "Building without std iostream operators support")
endif()
# Sources
@@ -90,6 +102,7 @@ if(PIP_MATH_YN)
add_definitions(-DPIP_MATH_YN)
endif()
set(LIBS)
if(WIN32)
list(APPEND CMAKE_LIBRARY_PATH ${MINGW_LIB})
endif()
@@ -151,21 +164,42 @@ endif()
# Check if PIP support fftw3 for PIFFT using in math module
if(FFTW)
message(STATUS "Building with fftw3 support")
# find_library(${fftw3} ${LIB_})
add_definitions(-DPIP_FFTW)
set(FFTW_LIB_NAME fftw3)
list(APPEND FFTW_LIB_LIST_ ${FFTW_LIB_NAME} ${FFTW_LIB_NAME}f ${FFTW_LIB_NAME}l ${FFTW_LIB_NAME}q)
if(WIN32)
add_definitions(-DPIP_FFTW_THREADSAFE)
list(APPEND LIBS fftw3-3 fftw3f-3 fftw3l-3)
foreach(FFTW_LIB_ ${FFTW_LIB_LIST_})
list(APPEND FFTW_LIB_LIST "${FFTW_LIB_}-3")
endforeach()
else()
list(APPEND LIBS fftw3 fftw3f)
if(FFTW_THREADS)
add_definitions(-DPIP_FFTW_THREADSAFE)
list(APPEND LIBS fftw3_threads fftw3f_threads)
else()
message(STATUS "WARNING PIFFTW::preparePlan was not threadsafe")
endif()
set(FFTW_LIB_LIST ${FFTW_LIB_LIST_})
endif()
if(FFTW_THREADS)
add_definitions(-DPIP_FFTW_THREADSAFE)
foreach(FFTW_LIB_T ${FFTW_LIB_LIST})
list(APPEND FFTW_LIB_LIST "${FFTW_LIB_T}_threads")
endforeach()
else()
message(STATUS "WARNING PIFFTW::preparePlan was not threadsafe")
endif()
foreach(FFTW_LIB ${FFTW_LIB_LIST})
find_library("${FFTW_LIB}_FOUND" ${FFTW_LIB})
if(${FFTW_LIB}_FOUND)
message(STATUS "Check ${FFTW_LIB} OK")
list(APPEND LIBS ${FFTW_LIB})
if("${FFTW_LIB}" MATCHES "${FFTW_LIB_NAME}f")
add_definitions(-DPIP_FFTW_FLOAT)
endif()
if("${FFTW_LIB}" MATCHES "${FFTW_LIB_NAME}l")
add_definitions(-DPIP_FFTW_LDOUBLE)
endif()
if("${FFTW_LIB}" MATCHES "${FFTW_LIB_NAME}q")
add_definitions(-DPIP_FFTW_QDOUBLE)
endif()
else()
message(STATUS "Check ${FFTW_LIB} missing")
endif()
endforeach()
else()
message(STATUS "Building without fftw3 support")
endif()
@@ -206,11 +240,11 @@ endif()
foreach(LIB_ ${LIBS})
find_library("${LIB_}_FOUND" ${LIB_})
message(STATUS "Check the ${LIB_} is installed: " ${${LIB_}_FOUND})
if("${${LIB_}_FOUND}" STREQUAL "${LIB_}_FOUND-NOTFOUND")
message(WARNING "library ${LIB_} not found, please install it")
else()
if(${LIB_}_FOUND)
list(APPEND LIBS ${LIB_})
list(APPEND CMAKE_REQUIRED_LIBRARIES ${LIB_})
else()
message(WARNING "library ${LIB_} not found, please install it")
endif()
endforeach()
if(WIN32)