"Fossies" - the Fresh Open Source Software Archive

Member "muscle/CMakeLists.txt" (21 Nov 2020, 5415 Bytes) of package /linux/privat/muscle7.62.zip:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "CMakeLists.txt": 7.61_vs_7.62.

    1 cmake_minimum_required (VERSION 2.8)
    2 
    3 cmake_policy(SET CMP0020 NEW)
    4 
    5 if(TARGET muscle)
    6    return()  # This library has already been built
    7 endif()
    8 
    9 project (muscle)
   10 set (CMAKE_CXX_STANDARD 11)
   11 
   12 file(GLOB MUSCLE_SRCS
   13    "./dataio/*.cpp"
   14    "./iogateway/*.cpp"
   15    "./message/*.cpp"
   16    "./reflector/*.cpp"
   17    "./regex/*.cpp"
   18    "./syslog/*.cpp"
   19    "./system/*.cpp"
   20    "./util/*.cpp"
   21    "./zlib/*.cpp"
   22 )
   23 
   24 file(GLOB EXCLUDE_THESE_SOURCES
   25   "./dataio/*SSL*"
   26 )
   27 list(REMOVE_ITEM MUSCLE_SRCS ${EXCLUDE_THESE_SOURCES} )
   28 
   29 if (WIN32)
   30    file(GLOB ZLIB_SRCS "./zlib/zlib/*.c")
   31    set(MUSCLE_SRCS
   32       ${MUSCLE_SRCS}
   33       ${ZLIB_SRCS}
   34       "./regex/regex/regcomp.c"
   35       "./regex/regex/regerror.c"
   36       "./regex/regex/regexec.c"
   37       "./regex/regex/regfree.c"
   38    )
   39 else (!WIN32)
   40    if(${CMAKE_VERSION} VERSION_LESS "3.1.0")
   41       add_definitions(-std=c++11)   # fallback for older versions of CMake that don't know about CMAKE_CXX_STANDARD
   42    endif()
   43    find_package(ZLIB 1.2.8)
   44    if (ZLIB_FOUND)
   45       # Cool, we'll use the system-provided zlib
   46    else (!ZLIB_FOUND)
   47       message("No Zlib library installed on system: falling back to using MUSCLE's captive zlib implementation instead")
   48       file(GLOB ZLIB_SRCS "./zlib/zlib/*.c")
   49       set(MUSCLE_SRCS
   50          ${MUSCLE_SRCS}
   51          ${ZLIB_SRCS})
   52    endif (ZLIB_FOUND)
   53 endif (WIN32)
   54 
   55 if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "iOS")
   56    add_library(muscle ${MUSCLE_SRCS})
   57 else ()
   58    add_library(muscle STATIC ${MUSCLE_SRCS})
   59    target_compile_options(muscle PUBLIC -fembed-bitcode)
   60    target_link_libraries(muscle -fembed-bitcode)
   61    set_target_properties(muscle PROPERTIES
   62         FRAMEWORK TRUE
   63         MACOSX_FRAMEWORK_IDENTIFIER com.meyersound.muscle
   64    )
   65    install(TARGETS muscle
   66       FRAMEWORK DESTINATION lib
   67    )
   68    install(DIRECTORY "./dataio"
   69             DESTINATION lib/muscle.framework/Headers
   70             COMPONENT header_files
   71             FILES_MATCHING PATTERN "*.h"
   72             PATTERN "*SSL*" EXCLUDE
   73    )
   74    install(DIRECTORY "./iogateway"
   75             DESTINATION lib/muscle.framework/Headers
   76             COMPONENT header_files
   77             FILES_MATCHING PATTERN "*.h"
   78    )
   79    install(DIRECTORY "./message"
   80             DESTINATION lib/muscle.framework/Headers
   81             COMPONENT header_files
   82             FILES_MATCHING PATTERN "*.h"
   83    )
   84    install(DIRECTORY "./reflector"
   85             DESTINATION lib/muscle.framework/Headers
   86             COMPONENT header_files
   87             FILES_MATCHING PATTERN "*.h"
   88    )
   89    install(DIRECTORY "./regex"
   90             DESTINATION lib/muscle.framework/Headers
   91             COMPONENT header_files
   92             FILES_MATCHING PATTERN "*.h"
   93    )
   94    install(DIRECTORY "./support"
   95             DESTINATION lib/muscle.framework/Headers
   96             COMPONENT header_files
   97             FILES_MATCHING PATTERN "*.h"
   98    )
   99    install(DIRECTORY "./syslog"
  100             DESTINATION lib/muscle.framework/Headers
  101             COMPONENT header_files
  102             FILES_MATCHING PATTERN "*.h"
  103    )
  104    install(DIRECTORY "./system"
  105             DESTINATION lib/muscle.framework/Headers
  106             COMPONENT header_files
  107             FILES_MATCHING PATTERN "*.h"
  108    )
  109    install(DIRECTORY "./util"
  110             DESTINATION lib/muscle.framework/Headers
  111             COMPONENT header_files
  112             FILES_MATCHING PATTERN "*.h"
  113    )
  114    install(DIRECTORY "./zlib"
  115             DESTINATION lib/muscle.framework/Headers
  116             COMPONENT header_files
  117             FILES_MATCHING PATTERN "*.h"
  118    )
  119 endif()
  120 
  121 option(WITH_QT "Enable Qt5 Support" ON)
  122 if (WITH_QT)
  123 	find_package(Qt5Widgets)
  124 	if(Qt5Widgets_FOUND)
  125 		set(CMAKE_AUTOMOC ON)
  126 		add_subdirectory(qtsupport)
  127 	else()
  128    		message("Note:  Qt5 wasn't found:  Qt executables and support code will not be built")
  129 	endif()
  130 else()
  131    message("Note:  -DWITH_QT=OFF argument was specified:  Qt executables and support code will not be built")
  132 endif()
  133 
  134 target_include_directories(muscle PUBLIC .)
  135 target_compile_definitions(muscle PUBLIC MUSCLE_ENABLE_ZLIB_ENCODING MUSCLE_NO_EXCEPTIONS)
  136 if (APPLE)
  137    find_library(COREFOUNDATION_FRAMEWORK CoreFoundation)
  138    if (NOT COREFOUNDATION_FRAMEWORK)
  139       message(FATAL_ERROR "CoreFoundation framework not found.")
  140    endif()
  141    target_link_libraries(muscle ${COREFOUNDATION_FRAMEWORK})
  142    if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL iOS)
  143       find_library(SYSTEMCONFIGURATION_FRAMEWORK SystemConfiguration)
  144       if (NOT SYSTEMCONFIGURATION_FRAMEWORK)
  145          message(FATAL_ERROR "SystemConfiguration framework not found.")
  146       endif()
  147       target_link_libraries(muscle ${SYSTEMCONFIGURATION_FRAMEWORK})
  148       find_library(IOKIT_FRAMEWORK IOKit)
  149       if (NOT IOKIT_FRAMEWORK)
  150          message(FATAL_ERROR "IOKit framework not found.")
  151       endif()
  152       target_link_libraries(muscle ${IOKIT_FRAMEWORK})
  153    endif()
  154 endif (APPLE)
  155 
  156 if (WIN32)
  157    target_include_directories(muscle PRIVATE "./regex/regex" "./zlib/zlib")
  158 else (!WIN32)
  159    if (ZLIB_FOUND)
  160       target_link_libraries(muscle z)
  161    else (!ZLIB_FOUND)
  162       target_include_directories(muscle PRIVATE "./zlib/zlib")
  163       target_link_libraries(muscle)
  164    endif (ZLIB_FOUND)
  165 endif (WIN32)
  166 
  167 option(WITH_MUSCLED "Enable building of muscled" ON)
  168 if (WITH_MUSCLED)
  169    add_executable(muscled server/muscled.cpp)
  170    target_include_directories(muscled PUBLIC .)
  171    target_link_libraries(muscled muscle)
  172 else ()
  173    message("Note:  -DWITH_MUSCLED=OFF argument was specified:  muscled will not be built")
  174 endif ()