From 11110c0428c52f9283c3845a51888757719b2a16 Mon Sep 17 00:00:00 2001 From: King_DuckZ Date: Wed, 10 Aug 2016 01:40:09 +0200 Subject: [PATCH] Re-shuffle blocks of cmake code. They should be grouped in a better way like this. --- CMakeLists.txt | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e0c4a75..6d509b2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,30 +34,31 @@ include(shared_git_project) include(TargetArch) include(CMakeDependentOption) +find_package(Boost 1.53.0 REQUIRED COMPONENTS program_options filesystem system) +find_package(PostgreSQL 8.3 REQUIRED) +find_package(YamlCpp 0.5.1 REQUIRED) +find_package(Qt5Qml 5.1 REQUIRED) + target_architecture(DINDEXER_ARCH) if (DINDEXER_ARCH MATCHES "arm.*") set(is_arm ON) endif() + +if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION_MAJOR EQUAL "5") + set(compiler_is_gnuxx_5plus ON) +endif() + cmake_dependent_option(DINDEXER_NATIVE_RELEASE "Pass the -march=native flag to the compiler for release builds" OFF "NOT is_arm" OFF) +option(DINDEXER_DEBUG_CFG_FILE "Enable to set the config file path to the build path" OFF) +option(DINDEXER_WITH_MEDIA_AUTODETECT "Enable code that tries to autodetect the media type and sets --type automatically" ON) +cmake_dependent_option(DINDEXER_WITH_DESKTOP_QT5_GUI "Enable the Qt5 GUI for desktop" ON "Qt5Qml_FOUND" OFF) +cmake_dependent_option(DINDEXER_CXX11_ABI "Controls if _GLIBCXX_USE_CXX11_ABI gets set to 0 or not" ON "compiler_is_gnuxx_5plus" OFF) + if(DINDEXER_NATIVE_RELEASE) set(march_flag "-march=native") else() set(march_flag "") endif() -if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION_MAJOR EQUAL "5") - set(compiler_is_gnuxx_5plus ON) -endif() - -find_package(Boost 1.53.0 REQUIRED COMPONENTS program_options filesystem system) -find_package(PostgreSQL 8.3 REQUIRED) -find_package(YamlCpp 0.5.1 REQUIRED) -import_libpqtypes_project("${PostgreSQL_INCLUDE_DIRS}" "-O3 ${march_flag}") -find_package(Qt5Qml 5.1 REQUIRED) - -option(DINDEXER_DEBUG_CFG_FILE "Enable to set the config file path to the build path" OFF) -option(DINDEXER_WITH_MEDIA_AUTODETECT "Enable code that tries to autodetect the media type and sets --type automatically" ON) -cmake_dependent_option(DINDEXER_WITH_DESKTOP_QT5_GUI "Enable the Qt5 GUI for desktop" ON "Qt5Qml_FOUND" OFF) -cmake_dependent_option(DINDEXER_CXX11_ABI "Controls if _GLIBCXX_USE_CXX11_ABI gets set to 0 or not" ON "compiler_is_gnuxx_5plus" OFF) set(DINDEXER_COPYRIGHT_YEARS "2015,2016") set(DINDEXER_ACTIONS_PATH "${CMAKE_CURRENT_BINARY_DIR}/src" CACHE STRING "Actions search path") @@ -150,6 +151,7 @@ unset(redis_found_index) unset(backend_list) #Libraries +import_libpqtypes_project("${PostgreSQL_INCLUDE_DIRS}" "-O3 ${march_flag}") add_subdirectory(src/pq) add_subdirectory(src/common) add_subdirectory(src/machinery)