From 4d147d9630653e4c93a70a2a8026c323ed1042d2 Mon Sep 17 00:00:00 2001 From: Peter Korsgaard Date: Mon, 4 Jan 2021 09:05:42 +0100 Subject: [PATCH] CMakeLists.txt: Don't require a C++ compiler By default, CMake assumes that the project is using both C and C++. By explicitly passing 'C' as argument of the project() macro, we tell CMake that only C is used, which prevents CMake from erroring out if a C++ compiler doesn't exist. Signed-off-by: Peter Korsgaard [Retrieved (and slightly updated by adding enable_language(CXX) if WITH_ASTYLE is set) from: https://git.buildroot.net/buildroot/tree/package/openjpeg/0003-CMakeLists.txt-Don-t-require-a-C-compiler.patch] Signed-off-by: Fabrice Fontaine --- CMakeLists.txt | 2 +- thirdparty/CMakeLists.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5a410783..136d7287 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,7 +24,7 @@ endif() #string(TOLOWER ${OPENJPEG_NAMESPACE} OPENJPEG_LIBRARY_NAME) set(OPENJPEG_LIBRARY_NAME openjp2) -project(${OPENJPEG_NAMESPACE}) +project(${OPENJPEG_NAMESPACE} C) # Do full dependency headers. include_regular_expression("^.*$") diff --git a/thirdparty/CMakeLists.txt b/thirdparty/CMakeLists.txt index b0b229c8..ebdcd9d4 100644 --- a/thirdparty/CMakeLists.txt +++ b/thirdparty/CMakeLists.txt @@ -120,5 +120,6 @@ endif(BUILD_THIRDPARTY) #------------ IF (WITH_ASTYLE) + enable_language(CXX) ADD_SUBDIRECTORY(astyle) ENDIF(WITH_ASTYLE)