/alps/pcitool

To get this branch, use:
bzr branch http://suren.me/webbzr/alps/pcitool

« back to all changes in this revision

Viewing changes to CMakeLists.txt

  • Committer: Suren A. Chilingaryan
  • Date: 2016-03-04 18:30:43 UTC
  • mfrom: (346.1.39 pcitool)
  • Revision ID: csa@suren.me-20160304183043-mjf6xvyermjh5olg
Integrate last part of Python code from Vasiliy Chernov

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
 
11
11
set(DISABLE_PCITOOL FALSE CACHE BOOL "Build only the library")
12
12
set(DISABLE_PYTHON FALSE CACHE BOOL "Disable python scripting support") 
 
13
set(DISABLE_SERVERS FALSE CACHE BOOL "Disable Web API support") 
13
14
 
14
15
#list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
15
16
 
53
54
    set(PCILIB_MODEL_DIR "${PCILIB_DATA_DIR}/models" CACHE PATH "Directory to install XML models")
54
55
endif (NOT DEFINED PCILIB_MODEL_DIR)
55
56
 
 
57
if (NOT DEFINED PCILIB_SERVER_DIR)
 
58
    set(PCILIB_SERVER_DIR "${PCILIB_DATA_DIR}/pyserver" CACHE PATH "Directory to install python server")
 
59
endif (NOT DEFINED PCILIB_SERVER_DIR)
 
60
 
56
61
if (NOT DEFINED PCILIB_DOC_DIR)
57
62
    set(PCILIB_DOC_DIR "${CMAKE_CURRENT_BINARY_DIR}/docs/" CACHE PATH "Directory to install documentation")
58
63
endif (NOT DEFINED PCILIB_DOC_DIR)
93
98
    set(HAVE_PYTHON TRUE)
94
99
endif (NOT DISABLE_PYTHON)
95
100
 
 
101
if (NOT HAVE_PYTHON)
 
102
    set(DISABLE_SERVERS TRUE)
 
103
endif (NOT HAVE_PYTHON)
 
104
 
96
105
set(EXTRA_SYSTEM_LIBS -lrt)
97
106
 
98
107
include(CheckIncludeFiles)
179
188
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/pcilib/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/pcilib/config.h)
180
189
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/pcilib/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/pcilib/version.h)
181
190
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/docs/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/docs/Doxyfile)
 
191
if (NOT DISABLE_SERVERS)
 
192
    configure_file(${CMAKE_CURRENT_SOURCE_DIR}/misc/pcilib_api.service.in ${CMAKE_CURRENT_BINARY_DIR}/misc/pcilib_api.service)
 
193
    configure_file(${CMAKE_CURRENT_SOURCE_DIR}/misc/pcilib_html.service.in ${CMAKE_CURRENT_BINARY_DIR}/misc/pcilib_html.service)
 
194
    configure_file(${CMAKE_CURRENT_SOURCE_DIR}/misc/pcilib.sysconfig.in ${CMAKE_CURRENT_BINARY_DIR}/misc/pcilib.sysconfig)
 
195
endif (NOT DISABLE_SERVERS)
182
196
 
183
197
if (NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
184
198
    file(COPY ${CMAKE_SOURCE_DIR}/xml DESTINATION ${CMAKE_BINARY_DIR})
198
212
    DESTINATION ${LIB_INSTALL_DIR}/pkgconfig
199
213
)
200
214
 
 
215
if (NOT DISABLE_SERVERS)
 
216
   #install Python servers
 
217
   file(GLOB DEPLOY_FILES_AND_DIRS "${CMAKE_SOURCE_DIR}/pyserver/*")
 
218
   foreach(ITEM ${DEPLOY_FILES_AND_DIRS})
 
219
        if( IS_DIRECTORY "${ITEM}" )
 
220
            list(APPEND DIRS_TO_DEPLOY "${ITEM}")
 
221
        else()
 
222
            list(APPEND FILES_TO_DEPLOY "${ITEM}")
 
223
        endif()
 
224
    endforeach()
 
225
    install(FILES ${FILES_TO_DEPLOY} DESTINATION ${PCILIB_SERVER_DIR})
 
226
    install(DIRECTORY ${DIRS_TO_DEPLOY} DESTINATION ${PCILIB_SERVER_DIR})
 
227
endif (NOT DISABLE_SERVERS)
 
228
 
201
229
message("-- Configured pcitool ${PCILIB_VERSION_MAJOR}.${PCILIB_VERSION_MINOR}.${PCILIB_VERSION_MICRO} with public ABI ${PCILIB_ABI_VERSION}")