]> sigrok.org Git - pulseview.git/commitdiff
cmake: move project() before other statements
authorGerhard Sittig <redacted>
Thu, 20 Aug 2020 07:11:20 +0000 (09:11 +0200)
committerGerhard Sittig <redacted>
Tue, 25 Aug 2020 17:25:55 +0000 (19:25 +0200)
The included GNUInstallDirs logic needs to know about the programming
languages which are used in the project. Without this spec a verbose
developer message gets emitted:

  CMake Warning (dev) at $HOME/share/cmake-3.18/Modules/GNUInstallDirs.cmake:225 (message):
    Unable to determine default CMAKE_INSTALL_LIBDIR directory because no
    target architecture is known.  Please enable at least one language before
    including GNUInstallDirs.
  Call Stack (most recent call first):
    CMakeLists.txt:24 (include)
    This warning is for project developers.  Use -Wno-dev to suppress it.

Move the project() statement in CMakeList.txt before the include(), and
specify the C and C++ programming languages (C is needed at configuration
time for feature detection, before the application's C++ sources get built).

CMakeLists.txt

index aa5175cc6ae1559fa8970922a22abf1a9492f160..160a0c0a984b585c580913960506eef82b622d16 100644 (file)
@@ -21,9 +21,9 @@
 
 cmake_minimum_required(VERSION 2.8.12)
 
-include(GNUInstallDirs)
+project(pulseview C CXX)
 
-project(pulseview)
+include(GNUInstallDirs)
 
 # Let AUTOMOC and AUTOUIC process GENERATED files.
 if(POLICY CMP0071)