From 5371aecd2697fbda32244f67bb5d958c2d4edc17 Mon Sep 17 00:00:00 2001 From: Jai Moraes Date: Wed, 4 Dec 2024 12:51:54 -0500 Subject: [PATCH] MOVED: From qnx_ports & gitlab. --- CMakeLists.txt | 9 ++++++++- test/CMakeLists.txt | 16 ++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4b5db23..c917a90 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -435,7 +435,14 @@ else () endif () gflags_define (PATH LIBRARY_INSTALL_DIR "Directory of installed libraries, e.g., \"lib64\"" "lib${LIB_SUFFIX}") gflags_property (LIBRARY_INSTALL_DIR ADVANCED TRUE) - set (INCLUDE_INSTALL_DIR include) + + # Cross-compiling for QNX does not install in the normal include path + if (QNX) + set (INCLUDE_INSTALL_DIR ${QNX_INCLUDE_INSTALL_DIR}) + else() + set (INCLUDE_INSTALL_DIR include) + endif () + set (CONFIG_INSTALL_DIR ${LIBRARY_INSTALL_DIR}/cmake/${PACKAGE_NAME}) set (PKGCONFIG_INSTALL_DIR ${LIBRARY_INSTALL_DIR}/pkgconfig) endif () diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 7bb3971..d100a8f 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -168,6 +168,22 @@ add_executable (gflags_declare_test gflags_declare_test.cc gflags_declare_flags. add_test(NAME gflags_declare COMMAND gflags_declare_test --message "Hello gflags!") set_tests_properties(gflags_declare PROPERTIES PASS_REGULAR_EXPRESSION "Hello gflags!") +# ---------------------------------------------------------------------------- +# QNX Specific Installation (ctest not compatible) +if(QNX) +install(DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} + DESTINATION ${RUNTIME_INSTALL_DIR}/gflags_tests) + +install(DIRECTORY ${PROJECT_SOURCE_DIR}/test/ + DESTINATION ${RUNTIME_INSTALL_DIR}/gflags_tests + FILES_MATCHING + PATTERN "flagfile.*" + PATTERN "gflags_unittest_flagfile" + PATTERN "config" EXCLUDE + PATTERN "nc" EXCLUDE +) +endif() + # ---------------------------------------------------------------------------- # configure Python script which configures and builds a test project if (BUILD_NC_TESTS OR BUILD_CONFIG_TESTS)