diff options
author | Suren A. Chilingaryan <csa@suren.me> | 2016-03-04 19:30:43 +0100 |
---|---|---|
committer | Suren A. Chilingaryan <csa@suren.me> | 2016-03-04 19:30:43 +0100 |
commit | c8b64cf87a3ff10abac92835c07b1dd76319f185 (patch) | |
tree | 0a86fd68612ab35cccec3567015c60633cb526f8 /CMakeLists.txt | |
parent | c38706b3c8bbaec638cc49745fd71dfb14df37e5 (diff) | |
parent | 327b71b05b60a03e56fad618b51fbccd06c3776d (diff) | |
download | pcitool-c8b64cf87a3ff10abac92835c07b1dd76319f185.tar.gz pcitool-c8b64cf87a3ff10abac92835c07b1dd76319f185.tar.bz2 pcitool-c8b64cf87a3ff10abac92835c07b1dd76319f185.tar.xz pcitool-c8b64cf87a3ff10abac92835c07b1dd76319f185.zip |
Integrate last part of Python code from Vasiliy Chernov
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 3dcc918..3db7ca9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,6 +10,7 @@ cmake_minimum_required(VERSION 2.8) set(DISABLE_PCITOOL FALSE CACHE BOOL "Build only the library") set(DISABLE_PYTHON FALSE CACHE BOOL "Disable python scripting support") +set(DISABLE_SERVERS FALSE CACHE BOOL "Disable Web API support") #list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") @@ -53,6 +54,10 @@ if (NOT DEFINED PCILIB_MODEL_DIR) set(PCILIB_MODEL_DIR "${PCILIB_DATA_DIR}/models" CACHE PATH "Directory to install XML models") endif (NOT DEFINED PCILIB_MODEL_DIR) +if (NOT DEFINED PCILIB_SERVER_DIR) + set(PCILIB_SERVER_DIR "${PCILIB_DATA_DIR}/pyserver" CACHE PATH "Directory to install python server") +endif (NOT DEFINED PCILIB_SERVER_DIR) + if (NOT DEFINED PCILIB_DOC_DIR) set(PCILIB_DOC_DIR "${CMAKE_CURRENT_BINARY_DIR}/docs/" CACHE PATH "Directory to install documentation") endif (NOT DEFINED PCILIB_DOC_DIR) @@ -93,6 +98,10 @@ if (NOT DISABLE_PYTHON) set(HAVE_PYTHON TRUE) endif (NOT DISABLE_PYTHON) +if (NOT HAVE_PYTHON) + set(DISABLE_SERVERS TRUE) +endif (NOT HAVE_PYTHON) + set(EXTRA_SYSTEM_LIBS -lrt) include(CheckIncludeFiles) @@ -179,6 +188,11 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/misc/pcitool.pc.in ${CMAKE_CURRENT_BI configure_file(${CMAKE_CURRENT_SOURCE_DIR}/pcilib/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/pcilib/config.h) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/pcilib/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/pcilib/version.h) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/docs/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/docs/Doxyfile) +if (NOT DISABLE_SERVERS) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/misc/pcilib_api.service.in ${CMAKE_CURRENT_BINARY_DIR}/misc/pcilib_api.service) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/misc/pcilib_html.service.in ${CMAKE_CURRENT_BINARY_DIR}/misc/pcilib_html.service) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/misc/pcilib.sysconfig.in ${CMAKE_CURRENT_BINARY_DIR}/misc/pcilib.sysconfig) +endif (NOT DISABLE_SERVERS) if (NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR) file(COPY ${CMAKE_SOURCE_DIR}/xml DESTINATION ${CMAKE_BINARY_DIR}) @@ -198,4 +212,18 @@ install(FILES DESTINATION ${LIB_INSTALL_DIR}/pkgconfig ) +if (NOT DISABLE_SERVERS) + #install Python servers + file(GLOB DEPLOY_FILES_AND_DIRS "${CMAKE_SOURCE_DIR}/pyserver/*") + foreach(ITEM ${DEPLOY_FILES_AND_DIRS}) + if( IS_DIRECTORY "${ITEM}" ) + list(APPEND DIRS_TO_DEPLOY "${ITEM}") + else() + list(APPEND FILES_TO_DEPLOY "${ITEM}") + endif() + endforeach() + install(FILES ${FILES_TO_DEPLOY} DESTINATION ${PCILIB_SERVER_DIR}) + install(DIRECTORY ${DIRS_TO_DEPLOY} DESTINATION ${PCILIB_SERVER_DIR}) +endif (NOT DISABLE_SERVERS) + message("-- Configured pcitool ${PCILIB_VERSION_MAJOR}.${PCILIB_VERSION_MINOR}.${PCILIB_VERSION_MICRO} with public ABI ${PCILIB_ABI_VERSION}") |