]> FriiDump Source - friidump.git/blobdiff - CMakeLists.txt
Record A102 and B101 live profile evidence
[friidump.git] / CMakeLists.txt
index b985f1b80a43b317f82eb5889c8aef12a9471155..e3ebf1b66f0e1742063ea6293c783185451c3a37 100644 (file)
@@ -5,6 +5,17 @@ cmake_minimum_required(VERSION 2.8)
 # to the root binary directory of the project as ${HELLO_BINARY_DIR}.
 project (FriiDump)
 
 # to the root binary directory of the project as ${HELLO_BINARY_DIR}.
 project (FriiDump)
 
+if (UNIX AND NOT WIN32)
+    message (WARNING
+        "Linux vendor-command paths require CAP_SYS_RAWIO. "
+        "A normal build does not install this capability. "
+        "After validating the exact executable, run "
+        "validation/friidump-linux-rawio-capability.sh install. "
+        "Do not run the entire FriiDump process as root; rebuilding or replacing "
+        "the executable clears file capabilities."
+    )
+endif ()
+
 if (MSVC)
     # msvc2005 deprecated warnings
     add_definitions (-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE)
 if (MSVC)
     # msvc2005 deprecated warnings
     add_definitions (-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE)
@@ -67,6 +78,32 @@ option (
        OFF
 )
 
        OFF
 )
 
+option (
+       BUILD_NATIVE_REPORT_TESTS
+       "Build the native-report fixture generator"
+       OFF
+)
+
+option (
+       BUILD_HLDS_PROFILE_TESTS
+       "Build the read-only HLDS E7 profile-selection tests"
+       OFF
+)
+
+set (
+       FRIIDUMP_BUILD_COMMIT
+       ""
+       CACHE STRING
+       "Full 40-character Git commit embedded in native compatibility reports"
+)
+
+if (FRIIDUMP_BUILD_COMMIT)
+       string (LENGTH "${FRIIDUMP_BUILD_COMMIT}" FRIIDUMP_BUILD_COMMIT_LENGTH)
+       if (NOT FRIIDUMP_BUILD_COMMIT_LENGTH EQUAL 40 OR FRIIDUMP_BUILD_COMMIT MATCHES "[^0-9A-Fa-f]")
+               message (FATAL_ERROR "FRIIDUMP_BUILD_COMMIT must be exactly 40 hexadecimal characters")
+       endif ()
+endif ()
+
 if (BUILD_STATIC_BINARY)
        set (libmultihash_type STATIC)
        set (libfriidump_type STATIC)
 if (BUILD_STATIC_BINARY)
        set (libmultihash_type STATIC)
        set (libfriidump_type STATIC)
@@ -100,6 +137,25 @@ add_subdirectory (libmultihash)
 add_subdirectory (libfriidump)
 add_subdirectory (src)
 
 add_subdirectory (libfriidump)
 add_subdirectory (src)
 
+if (BUILD_HLDS_PROFILE_TESTS)
+       enable_testing ()
+       include_directories (
+               ${FriiDump_SOURCE_DIR}/libfriidump
+       )
+       add_executable (
+               test_hlds_e7_profiles
+               tests/test_hlds_e7_profiles.c
+       )
+       target_link_libraries (
+               test_hlds_e7_profiles
+               friidumplib
+       )
+       add_test (
+               NAME hlds_e7_profiles
+               COMMAND test_hlds_e7_profiles
+       )
+endif (BUILD_HLDS_PROFILE_TESTS)
+
 
 if (WIN32)
        install (FILES AUTHORS DESTINATION / RENAME Authors.txt)
 
 if (WIN32)
        install (FILES AUTHORS DESTINATION / RENAME Authors.txt)