]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
updating extra snort.cmake a final time
authorJosh <jrosenba@cisco.com>
Wed, 10 Dec 2014 18:29:41 +0000 (12:29 -0600)
committerJosh <jrosenba@cisco.com>
Wed, 10 Dec 2014 18:29:41 +0000 (12:29 -0600)
extra/CMakeLists.txt
extra/FindSnort.cmake

index 7af99696ae5024ca2d2d65142814fec55df1bf52..a2651d120f0c8c7b3f8c4db7831e7b19d506fd71 100644 (file)
@@ -31,11 +31,15 @@ else (BUILD_EXTRA_PLUGINS)
 
     #  add Snort++ properties to the current build
     string (REPLACE "-DHAVE_CONFIG_H" " " tmp_cmp_flags  "${SNORT_INTERFACE_COMPILE_OPTIONS}")
+    string (REPLACE ";" " " tmp_cmp_flags "${tmp_cmp_flags}")
     string (STRIP "${CMAKE_CXX_FLAGS} ${tmp_cmp_flags}" tmp_cmp_flags)
     set (CMAKE_CXX_FLAGS "${tmp_cmp_flags}" CACHE STRING
         "Flags used by the compiler during all build types." FORCE)
+
     include_directories(${SNORT_INTERFACE_INCLUDE_DIRECTORIES})
-    string (STRIP "${CMAKE_EXE_LINKER_FLAGS} ${SNORT_INTERFACE_LINK_FLAGS}" tmp_link_flags)
+
+    string(REPLACE ";" " " tmp_link_flags "${SNORT_INTERFACE_LINK_FLAGS}")
+    string (STRIP "${CMAKE_EXE_LINKER_FLAGS} ${tmp_link_flags}" tmp_link_flags)
     set (CMAKE_EXE_LINKER_FLAGS "${tmp_link_flags}" CACHE STRING
         "Flags used by the linker. " FORCE)
 
index 7bb953139c53c398e0a31e3ae3213fe9b78e5b13..c646a7467ddacb166fa3df31615fc81f69d51dc5 100644 (file)
 #  SNORT_INCLUDE_DIR - Snort include directory
 #
 #
-#  SNORT_INTERFACE_COMPILE_OPTIONS -  Snort++'s compile options.  If snort.cmake found,
-#                                       use those compile flags.  Else, use
-#                                       `pkg-config snort` compile flags
+#  These varaibles are all lists whose variables are retrieved from either
+#  snort.cmake or pkg-config.  snort.cmake will always take precendence over pkg-config.
+#  SNORT_INTERFACE_COMPILE_OPTIONS -  a list of Snort++'s compile options.
 #  SNORT_INTERFACE_INCLUDE_DIRECTORIES - The directories that Snort++ includes
-#                                       when building. retrieved from snort.cmake
-#  SNORT_INTERFACE_LINK_FLAGS  -  Snort++ link flags.  retrived from `pkg-config`
+#                                       when building.
+#  SNORT_INTERFACE_LINK_FLAGS  -  Snort++ link flags.  only available with `pkg-config`
 #
 
 set(ERROR_MESSAGE
@@ -95,20 +95,17 @@ if (PKG_CONFIG_FOUND)
 
         #  CMake file takes precedence over pkg-config file
         if (NOT SNORT_INTERFACE_COMPILE_OPTIONS)
-            string(REPLACE ";" " " tmp_cflags "${SNORT_PKG_CFLAGS_OTHER}")
-            set (SNORT_INTERFACE_COMPILE_OPTIONS "${tmp_cflags}" CACHE STRING
+            set (SNORT_INTERFACE_COMPILE_OPTIONS "${SNORT_PKG_CFLAGS_OTHER}" CACHE STRING
                 "The compile options with which Snort was linked" FORCE)
         endif()
 
         if (NOT SNORT_INTERFACE_INCLUDE_DIRECTORIES)
-            string(REPLACE ";" " " tmp_includes "${SNORT_PKG_INCLUDE_DIRS}")
-            set (SNORT_INTERFACE_INCLUDE_DIRECTORIES "${tmp_includes}" CACHE STRING
+            set (SNORT_INTERFACE_INCLUDE_DIRECTORIES "${SNORT_PKG_INCLUDE_DIRS}" CACHE STRING
                 "The compile options with which Snort was linked" FORCE)
         endif()
 
         #  add Snort link flags
-        string(REPLACE ";" " " tmp_lflags "${SNORT_PKG_LDFLAGS}")
-        set (SNORT_INTERFACE_LINK_FLAGS "${tmp_lflags}"
+        set (SNORT_INTERFACE_LINK_FLAGS "${SNORT_PKG_LDFLAGS}"
             CACHE STRING "The link flags with which the Snort++ binary was linked" FORCE)