File: CMakeLists.txt

package info (click to toggle)
python-ltfatpy 1.1.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 41,412 kB
  • sloc: ansic: 8,546; python: 6,470; makefile: 15
file content (66 lines) | stat: -rw-r--r-- 2,442 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Defines the CMake commands/policies
cmake_minimum_required( VERSION 2.8.5 )

# Set the project name
project( LTFATPY )

set(CMAKE_C_FLAGS "$ENV{CPPFLAGS} $ENV{CFLAGS} ${CMAKE_C_FLAGS}")
set(CMAKE_CXX_FLAGS "$ENV{CPPFLAGS} $ENV{CXXFLAGS} ${CMAKE_CXX_FLAGS}")

message(STATUS "CMAKE_C_FLAGS:   ${CMAKE_C_FLAGS}")
message(STATUS "CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}")

# If the user specifies -DCMAKE_BUILD_TYPE on the command line, take their
# definition and dump it in the cache along with proper documentation, 
# otherwise set CMAKE_BUILD_TYPE to Debug prior to calling project()
#
IF(DEFINED CMAKE_BUILD_TYPE)
   SET(CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE} CACHE STRING "Choose the type of
build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug
Release RelWithDebInfo MinSizeRel.")
ELSE()
   SET(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build,
options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release
RelWithDebInfo MinSizeRel.")
ENDIF()

#### Set global variables
set( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_LIST_DIR}/cmake-modules )
set(FFTW_ROOT "/usr/lib" CACHE PATH "FFTW lib folder")
set(LTFATPY_DIR "${CMAKE_SOURCE_DIR}/ltfatpy")
set(CKERNEL_DIR "${LTFATPY_SOURCE_DIR}/ltfat_C_kernel")
set(DOC_DIR "${LTFATPY_SOURCE_DIR}/doc")

#### Find FFTW
find_package(FFTW REQUIRED)
message ("FFTW found")
include_directories(${FFTW_INCLUDE_DIR})

### Find Lapack
find_package(LAPACK REQUIRED)
message ("LAPACK found")
message("BLAS VENDOR : ${BLA_VENDOR}")
message("LAPACK LIBRARIES : ${LAPACK_LIBRARIES}")

### Set PYTHON_SITE_DIR
#find_package ( PythonLibs REQUIRED )
#find_package ( PythonInterp REQUIRED )

#if ( PYTHON_VERSION_STRING AND PYTHONLIBS_VERSION_STRING )
#   if ( NOT PYTHON_VERSION_STRING VERSION_EQUAL PYTHONLIBS_VERSION_STRING )
#     message ( FATAL_ERROR "Version mismatch between python interpreter and libraries")
#   endif ( NOT PYTHON_VERSION_STRING VERSION_EQUAL PYTHONLIBS_VERSION_STRING )
#endif ( PYTHON_VERSION_STRING AND PYTHONLIBS_VERSION_STRING )

### Build c kernel (Using ${PYTHON_SITE_DIR} for install)
add_subdirectory(${CKERNEL_DIR})

#### uninstall target
configure_file(
    "${CMAKE_SOURCE_DIR}/cmake-modules/cmake_uninstall.cmake.in"
    "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
    IMMEDIATE @ONLY)

add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} 
                   -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)