From 18d0993638efb269090a7946958d9418bb9ef566 Mon Sep 17 00:00:00 2001 From: M-BELLAHCENE <34917424+M-BELLAHCENE@users.noreply.github.com> Date: Tue, 27 Sep 2022 10:13:53 +0200 Subject: [PATCH] Fix getopt.h error when not needed --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fa9daa2..984f38f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -231,8 +231,8 @@ IF(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR CMAKE_SYSTEM_NAME STREQUAL "Darwin") link_directories( /usr/local/lib ) ENDIF() -IF (CMAKE_SYSTEM_NAME STREQUAL Windows) - FIND_PATH(GETOPT_INCLUDE_DIR NAMES getopt.h AND LSQUIC_TESTS AND LSQUIC_BIN) +IF (CMAKE_SYSTEM_NAME STREQUAL Windows AND LSQUIC_TESTS AND LSQUIC_BIN) + FIND_PATH(GETOPT_INCLUDE_DIR NAMES getopt.h) IF (GETOPT_INCLUDE_DIR) INCLUDE_DIRECTORIES(${GETOPT_INCLUDE_DIR}) ELSE()