contrib: add AppStream metadata
[libam7xxx.git] / CMakeLists.txt
index fa111c9..f234866 100644 (file)
@@ -1,12 +1,14 @@
 cmake_minimum_required(VERSION 2.6)
 project(libam7xxx C)
 
+include (GNUInstallDirs)
+
 set(PROJECT_DESCRIPTION
   "Communication library for Actions Micro AM7XXX based USB projectors and DPFs")
 
 set(PROJECT_VER_MAJOR 0)
 set(PROJECT_VER_MINOR 1)
-set(PROJECT_VER_PATCH 4)
+set(PROJECT_VER_PATCH 7)
 set(PROJECT_VER_EXTRA "")
 set(PROJECT_VER
   "${PROJECT_VER_MAJOR}.${PROJECT_VER_MINOR}.${PROJECT_VER_PATCH}${PROJECT_VER_EXTRA}")
@@ -65,8 +67,15 @@ if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG)
     -Wswitch-enum
     -Wundef
     -Wunreachable-code
-    -Wwrite-strings
-    -fstack-protector)
+    -Wwrite-strings)
+
+  include(CheckCCompilerFlag)
+  CHECK_C_COMPILER_FLAG(-fstack-protector-strong COMPILER_SUPPORTS_STACK_PROTECTOR_STRONG)
+  if (COMPILER_SUPPORTS_STACK_PROTECTOR_STRONG)
+    add_flags(CMAKE_C_FLAGS -fstack-protector-strong)
+  else()
+    add_flags(CMAKE_C_FLAGS -fstack-protector)
+  endif()
 
   add_flags(DEBUG_FLAGS
     -ggdb)