File: CMakeLists.txt

package info (click to toggle)
casacore 3.8.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 51,912 kB
  • sloc: cpp: 471,569; fortran: 16,372; ansic: 7,416; yacc: 4,714; lex: 2,346; sh: 1,865; python: 629; perl: 531; sed: 499; csh: 201; makefile: 32
file content (82 lines) | stat: -rw-r--r-- 3,454 bytes parent folder | download | duplicates (2)
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
message(STATUS "Looking for python3 specific environment...")

find_package(Python3 REQUIRED COMPONENTS Interpreter Development NumPy)

if (Python3_FOUND)
    find_package(Boost REQUIRED)
    if(${Boost_MAJOR_VERSION} EQUAL 1 AND ${Boost_MINOR_VERSION} GREATER 66)
        # Boost>=1.67 Python components require a Python version suffix
        set(BOOST_PYTHON3_LIBRARY_NAME
            python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}
            CACHE STRING "The name of the boost python3 library to search for")
    else()
        set(BOOST_PYTHON3_LIBRARY_NAME
            python${Python3_VERSION_MAJOR}
            CACHE STRING "The name of the boost python3 library to search for")
    endif()
    find_package(Boost REQUIRED COMPONENTS ${BOOST_PYTHON3_LIBRARY_NAME})

    # copy the variables to their final destination
    set(PYTHON3_EXECUTABLE ${Python3_EXECUTABLE} CACHE FILEPATH "Path to Python3 interpreter")
    set(PYTHON3_LIBRARY ${Python3_LIBRARIES} CACHE PATH "Python3 library")
    set(PYTHON3_INCLUDE_DIR ${Python3_INCLUDE_DIRS} CACHE PATH "Python3 include folder")
    set(PYTHON3_FIND_PACKAGE_MESSAGE_DETAILS_PythonLibs ${FIND_PACKAGE_MESSAGE_DETAILS_PythonLibs} CACHE STRING "")

    set(PYTHON3_LIBRARIES ${Python3_LIBRARIES} PARENT_SCOPE)
    set(PYTHON3_NUMPY_INCLUDE_DIRS ${Python3_NumPy_INCLUDE_DIRS} PARENT_SCOPE)
    set(PYTHON3_Boost_LIBRARIES ${Boost_LIBRARIES} PARENT_SCOPE)
    set(PYTHON3_Boost_INCLUDE_DIRS ${Boost_INCLUDE_DIRS} PARENT_SCOPE)
    set(PYTHON3_Boost_PYTHON_LIBRARY_RELEASE ${Boost_PYTHON_LIBRARY_RELEASE} PARENT_SCOPE)
    set(PYTHON3_INCLUDE_DIRS ${Python3_INCLUDE_DIRS} PARENT_SCOPE)

    # to access the variables here we also need to set them in the local scope
    set(PYTHON3_LIBRARIES ${Python3_LIBRARIES} )
    set(PYTHON3_NUMPY_INCLUDE_DIRS ${Python3_NumPy_INCLUDE_DIRS} )
    set(PYTHON3_Boost_LIBRARIES ${Boost_LIBRARIES} )
    set(PYTHON3_Boost_INCLUDE_DIRS ${Boost_INCLUDE_DIRS} )
    set(PYTHON3_Boost_PYTHON_LIBRARY_RELEASE ${Boost_PYTHON_LIBRARY_RELEASE} )
    set(PYTHON3_INCLUDE_DIRS ${Python3_INCLUDE_DIRS} )
endif(Python3_FOUND)

include_directories (${PYTHON3_Boost_INCLUDE_DIRS} ${PYTHON3_NUMPY_INCLUDE_DIRS} ${PYTHON3_INCLUDE_DIRS})

add_library (casa_python3
../python/Converters/PycArray.cc
../python/Converters/PycArrayNP.cc
../python/Converters/PycBasicData.cc
../python/Converters/PycExcp.cc
../python/Converters/PycImport.cc
../python/Converters/PycRecord.cc
../python/Converters/PycValueHolder.cc
)


target_link_libraries (casa_python3 casa_casa ${PYTHON3_Boost_LIBRARIES} ${PYTHON3_LIBRARIES})

install (TARGETS casa_python3
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib${LIB_SUFFIX}
ARCHIVE DESTINATION lib${LIB_SUFFIX}
LIBRARY PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
)

# don't install headers if python2 cmake logic already installs it
if (NOT BUILD_PYTHON)
    install (FILES
    ../python/Converters/PycArray.h
    ../python/Converters/PycArrayComCC.h
    ../python/Converters/PycArrayComH.h
    ../python/Converters/PycArrayNP.h
    ../python/Converters/PycBasicData.h
    ../python/Converters/PycExcp.h
    ../python/Converters/PycRecord.h
    ../python/Converters/PycValueHolder.h
    ../python/Converters/PycArray.tcc
    DESTINATION include/casacore/python/Converters
    )

    install (FILES
    ../python/Converters.h
    DESTINATION include/casacore/python
    )
endif (NOT BUILD_PYTHON)