Reorganization between variables/build options
[staging/xdg-launcher.git] / cmake / cmake.d / 01-build_options.cmake
similarity index 69%
rename from cmake/cmake.d/04-build_options.cmake
rename to cmake/cmake.d/01-build_options.cmake
index 3db685c..246d650 100644 (file)
 #     Customise your preferences in "./conf.d/cmake/config.cmake"
 #--------------------------------------------------------------------------
 
-# Check GCC minimal version
-if (gcc_minimal_version)
-               message (STATUS "${Cyan}-- Check gcc_minimal_version (found gcc version ${CMAKE_C_COMPILER_VERSION}) \
-               (found g++ version ${CMAKE_CXX_COMPILER_VERSION})${ColourReset}")
-       if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${gcc_minimal_version} OR CMAKE_C_COMPILER_VERSION VERSION_LESS ${gcc_minimal_version})
-               message(FATAL_ERROR "${Red}**** FATAL: Require at least gcc-${gcc_minimal_version} please set CMAKE_C[XX]_COMPILER")
-       endif()
-endif(gcc_minimal_version)
-
-# Check Kernel mandatory version, will fail the configuration if required version not matched.
-if (kernel_mandatory_version)
-       message (STATUS "${Cyan}-- Check kernel_mandatory_version (found kernel version ${KERNEL_VERSION})${ColourReset}")
-       if (KERNEL_VERSION VERSION_LESS ${kernel_mandatory_version})
-               message(FATAL_ERROR "${Red}**** FATAL: Require at least ${kernel_mandatory_version} please use a recent kernel or source your SDK environment then clean and reconfigure your CMake project.")
-       endif (KERNEL_VERSION VERSION_LESS ${kernel_mandatory_version})
-endif(kernel_mandatory_version)
-
-# Check Kernel minimal version just print a Warning about missing features
-# and set a definition to be used as preprocessor condition in code to disable
-# incompatibles features.
-if (kernel_minimal_version)
-       message (STATUS "${Cyan}-- Check kernel_minimal_version (found kernel version ${KERNEL_VERSION})${ColourReset}")
-       if (KERNEL_VERSION VERSION_LESS ${kernel_minimal_version})
-               message(WARNING "${Yellow}**** Warning: Some feature(s) require at least ${kernel_minimal_version}. Please use a recent kernel or source your SDK environment then clean and reconfigure your CMake project.${ColourReset}")
-       else (KERNEL_VERSION VERSION_LESS ${kernel_minimal_version})
-               add_definitions(-DKERNEL_MINIMAL_VERSION_OK)
-       endif (KERNEL_VERSION VERSION_LESS ${kernel_minimal_version})
-endif(kernel_minimal_version)
+# (BUG!!!) as PKG_CONFIG_PATH does not work [should be en env variable]
+set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH ON CACHE BOOLEAN "Flag for using prefix path")
 
 INCLUDE(FindPkgConfig)
 INCLUDE(CheckIncludeFiles)
 INCLUDE(CheckLibraryExists)
 INCLUDE(GNUInstallDirs)
 
+set(CMAKE_BUILD_TYPE Debug CACHE STRING "the type of build")
+set(CMAKE_POSITION_INDEPENDENT_CODE ON)
+set(CMP0048 1)
+
 # Default compilation options
 ############################################################################
 link_libraries(-Wl,--as-needed -Wl,--gc-sections)
@@ -68,7 +46,6 @@ endforeach()
 
 # Compilation OPTIONS depending on language
 #########################################
-
 foreach(option ${COMPILE_OPTIONS})
        add_compile_options(${option})
 endforeach()
@@ -130,6 +107,7 @@ ENDIF(CMAKE_BUILD_TYPE MATCHES DEBUG)
 INCLUDE_DIRECTORIES(${EXTRA_INCLUDE_DIRS})
 
 # Default Linkflag
+set (PKG_TEMPLATE_PREFIX ${CMAKE_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR} CACHE PATH "Default Package Templates Directory")
 if(NOT BINDINGS_LINK_FLAG)
        set(BINDINGS_LINK_FLAG "-Wl,--version-script=${PKG_TEMPLATE_PREFIX}/cmake/export.map")
 endif()