"Fossies" - the Fresh Open Source Software Archive

Member "snort3_extra-3.0.3-1/CMakeLists.txt" (23 Sep 2020, 4165 Bytes) of package /linux/misc/snort3_extra-3.0.3-1.tar.gz:


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": 1.0.0-beta2_vs_3.0.3-1.

    1 cmake_minimum_required ( VERSION 3.4.3 )
    2 project( snort_extra CXX C )
    3 
    4 set (EXTRA_VERSION_MAJOR 1)
    5 set (EXTRA_VERSION_MINOR 0)
    6 set (EXTRA_VERSION_PATCH 0)
    7 set (EXTRA_VERSION "${EXTRA_VERSION_MAJOR}.${EXTRA_VERSION_MINOR}.${EXTRA_VERSION_PATCH}")
    8 
    9 set (CMAKE_CXX_STANDARD 11)
   10 set (CMAKE_CXX_STANDARD_REQUIRED ON)
   11 set (CMAKE_CXX_EXTENSIONS OFF)
   12 
   13 set (CMAKE_C_STANDARD 99)
   14 set (CMAKE_C_STANDARD_REQUIRED ON)
   15 set (CMAKE_C_EXTENSIONS ON)
   16 
   17 set (CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
   18 # Pull in definitions of various install directories
   19 include (GNUInstallDirs)
   20 include (${CMAKE_MODULE_PATH}/create_options.cmake)
   21 include (${CMAKE_MODULE_PATH}/configure_options.cmake)
   22 
   23 set (CPACK_GENERATOR TGZ)
   24 set (CPACK_PACKAGE_NAME "snort_extra")
   25 set (CPACK_PACKAGE_VENDOR "Cisco")
   26 set (CPACK_PACKAGE_VERSION_MAJOR "${EXTRA_VERSION_MAJOR}")
   27 set (CPACK_PACKAGE_VERSION_MINOR "${EXTRA_VERSION_MINOR}")
   28 set (CPACK_PACKAGE_VERSION_PATCH "${EXTRA_VERSION_PATCH}")
   29 set (CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/doc/images/snort.png")
   30 set (CPACK_PACKAGE_INSTALL_DIRECTORY "snort")
   31 set (CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE")
   32 set (CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/README")
   33 set (CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
   34 set (CPACK_SOURCE_IGNORE_FILES "${CMAKE_BINARY_DIR}/*")
   35 set (CPACK_SOURCE_GENERATOR TGZ)
   36 
   37 include(CPack)
   38 
   39 set ( C_FLAGS "" CACHE STRING "" )
   40 set ( CXX_FLAGS "" CACHE STRING "" )
   41 
   42 set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${C_FLAGS}" CACHE STRING "" FORCE )
   43 set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_FLAGS}" CACHE STRING "" FORCE )
   44 
   45 execute_process (
   46     COMMAND pkg-config --variable=cpp_opts snort
   47     OUTPUT_VARIABLE CPP_OPTS
   48 )
   49 string ( REGEX REPLACE "[\r\n]" " " CPP_OPTS "${CPP_OPTS}" )
   50 separate_arguments ( CPP_OPTS )
   51 
   52 foreach ( OPT ${CPP_OPTS} )
   53     execute_process (
   54         COMMAND pkg-config --variable=${OPT}_CPPFLAGS snort
   55         OUTPUT_VARIABLE CPPFLAGS
   56     )
   57 
   58     string ( REGEX REPLACE "[\r\n]" " " CPPFLAGS "${CPPFLAGS}" )
   59     set ( ${OPT}_CPPFLAGS "${CPPFLAGS}" CACHE STRING "" )
   60 
   61     set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${${OPT}_CPPFLAGS}" CACHE STRING "" FORCE )
   62     set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${${OPT}_CPPFLAGS}" CACHE STRING "" FORCE )
   63 endforeach ( OPT )
   64 
   65 execute_process (
   66     COMMAND pkg-config --variable=cpp_opts_other snort
   67     OUTPUT_VARIABLE CPP_OPTS_OTHER
   68 )
   69 string ( REGEX REPLACE "[\r\n]" " " CPP_OPTS_OTHER "${CPP_OPTS_OTHER}" )
   70 separate_arguments ( CPP_OPTS_OTHER )
   71 
   72 foreach ( OPT ${CPP_OPTS_OTHER} )
   73     execute_process (
   74         COMMAND pkg-config --variable=${OPT}_CPPFLAGS snort
   75         OUTPUT_VARIABLE CPPFLAGS
   76     )
   77 
   78     string ( REGEX REPLACE "[\r\n]" " " CPPFLAGS "${CPPFLAGS}" )
   79     set ( ${OPT}_CPPFLAGS "${CPPFLAGS}" CACHE STRING "" )
   80 
   81     set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${${OPT}_CPPFLAGS}" CACHE STRING "" FORCE )
   82     set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${${OPT}_CPPFLAGS}" CACHE STRING "" FORCE )
   83 endforeach ( OPT )
   84 
   85 # Set these after all tests are done but *before* any subdirectories are included
   86 #  or other targets declared.
   87 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_C_FLAGS}")
   88 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CXX_FLAGS}")
   89 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${EXTRA_LINKER_FLAGS}")
   90 set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${EXTRA_LINKER_FLAGS}")
   91 foreach (EXTRA_LIBRARY IN LISTS EXTRA_LIBRARIES)
   92     link_libraries(${EXTRA_LIBRARY})
   93 endforeach (EXTRA_LIBRARY)
   94 
   95 add_subdirectory ( src )
   96 
   97 string(TOUPPER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_UPPER)
   98 
   99 message("
  100 -------------------------------------------------------
  101 ${CMAKE_PROJECT_NAME} version ${EXTRA_VERSION}
  102 
  103 Install options:
  104     prefix:     ${CMAKE_INSTALL_PREFIX}
  105 
  106 Compiler options:
  107     CC:             ${CMAKE_C_COMPILER}
  108     CXX:            ${CMAKE_CXX_COMPILER}
  109     CFLAGS:         ${CMAKE_C_FLAGS} ${CMAKE_C_FLAGS_${CMAKE_BUILD_TYPE_UPPER}}
  110     CXXFLAGS:       ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE_UPPER}}
  111     EXE_LDFLAGS:    ${CMAKE_EXE_LINKER_FLAGS}
  112     MODULE_LDFLAGS: ${CMAKE_MODULE_LINKER_FLAGS}
  113 ")