CMake: shuffle the top-level CMakeLists
- Put all the options near the top, easy to spot when reading the file - Put the settings that need regular updates, like version, near the top - Add some "section headers"
This commit is contained in:
parent
fb0cf9a668
commit
91a5ec426d
@ -33,12 +33,33 @@ project( calamares C CXX )
|
|||||||
|
|
||||||
cmake_minimum_required( VERSION 3.2 )
|
cmake_minimum_required( VERSION 3.2 )
|
||||||
|
|
||||||
set( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMakeModules" )
|
|
||||||
|
|
||||||
set( CMAKE_CXX_STANDARD 14 )
|
### OPTIONS
|
||||||
set( CMAKE_CXX_STANDARD_REQUIRED ON )
|
#
|
||||||
set( CMAKE_C_STANDARD 99 )
|
option( INSTALL_CONFIG "Install configuration files" ON )
|
||||||
set( CMAKE_C_STANDARD_REQUIRED ON )
|
option( BUILD_TESTING "Build the testing tree." ON )
|
||||||
|
option( WITH_PYTHON "Enable Python modules API (requires Boost.Python)." ON )
|
||||||
|
option( WITH_PYTHONQT "Enable next generation Python modules API (experimental, requires PythonQt)." ON )
|
||||||
|
option( WITH_KF5Crash "Enable crash reporting with KCrash." ON )
|
||||||
|
|
||||||
|
|
||||||
|
### Calamares application info
|
||||||
|
#
|
||||||
|
set( CALAMARES_ORGANIZATION_NAME "Calamares" )
|
||||||
|
set( CALAMARES_ORGANIZATION_DOMAIN "github.com/calamares" )
|
||||||
|
set( CALAMARES_APPLICATION_NAME "Calamares" )
|
||||||
|
set( CALAMARES_DESCRIPTION_SUMMARY
|
||||||
|
"The distribution-independent installer framework" )
|
||||||
|
|
||||||
|
set( CALAMARES_VERSION_MAJOR 3 )
|
||||||
|
set( CALAMARES_VERSION_MINOR 2 )
|
||||||
|
set( CALAMARES_VERSION_PATCH 0 )
|
||||||
|
set( CALAMARES_VERSION_RC 0 )
|
||||||
|
|
||||||
|
|
||||||
|
### CMAKE SETUP
|
||||||
|
#
|
||||||
|
set( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMakeModules" )
|
||||||
|
|
||||||
# CMake 3.9, 3.10 compatibility
|
# CMake 3.9, 3.10 compatibility
|
||||||
if( POLICY CMP0071 )
|
if( POLICY CMP0071 )
|
||||||
@ -52,8 +73,15 @@ if(NOT CMAKE_VERSION VERSION_LESS "3.10.0")
|
|||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall" )
|
|
||||||
|
|
||||||
|
### C++ SETUP
|
||||||
|
#
|
||||||
|
set( CMAKE_CXX_STANDARD 14 )
|
||||||
|
set( CMAKE_CXX_STANDARD_REQUIRED ON )
|
||||||
|
set( CMAKE_C_STANDARD 99 )
|
||||||
|
set( CMAKE_C_STANDARD_REQUIRED ON )
|
||||||
|
|
||||||
|
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall" )
|
||||||
if( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
|
if( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
|
||||||
message( STATUS "Found Clang ${CMAKE_CXX_COMPILER_VERSION}, setting up Clang-specific compiler flags." )
|
message( STATUS "Found Clang ${CMAKE_CXX_COMPILER_VERSION}, setting up Clang-specific compiler flags." )
|
||||||
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall" )
|
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall" )
|
||||||
@ -139,12 +167,6 @@ if( ECM_FOUND )
|
|||||||
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_MODULE_PATH})
|
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_MODULE_PATH})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
option( INSTALL_CONFIG "Install configuration files" ON )
|
|
||||||
option( WITH_PYTHON "Enable Python modules API (requires Boost.Python)." ON )
|
|
||||||
option( WITH_PYTHONQT "Enable next generation Python modules API (experimental, requires PythonQt)." ON )
|
|
||||||
option( WITH_KF5Crash "Enable crash reporting with KCrash." ON )
|
|
||||||
option( BUILD_TESTING "Build the testing tree." ON )
|
|
||||||
|
|
||||||
find_package( KF5 COMPONENTS CoreAddons Crash )
|
find_package( KF5 COMPONENTS CoreAddons Crash )
|
||||||
if( NOT KF5Crash_FOUND )
|
if( NOT KF5Crash_FOUND )
|
||||||
set( WITH_KF5Crash OFF )
|
set( WITH_KF5Crash OFF )
|
||||||
@ -245,23 +267,10 @@ endif()
|
|||||||
unset( prev_tx )
|
unset( prev_tx )
|
||||||
unset( curr_tx )
|
unset( curr_tx )
|
||||||
|
|
||||||
add_subdirectory( lang ) # i18n tools
|
|
||||||
|
|
||||||
###
|
|
||||||
### Calamares application info
|
|
||||||
###
|
|
||||||
set( CALAMARES_ORGANIZATION_NAME "Calamares" )
|
|
||||||
set( CALAMARES_ORGANIZATION_DOMAIN "github.com/calamares" )
|
|
||||||
set( CALAMARES_APPLICATION_NAME "Calamares" )
|
|
||||||
set( CALAMARES_DESCRIPTION_SUMMARY "The distribution-independent installer framework" )
|
|
||||||
set( CALAMARES_TRANSLATION_LANGUAGES en ${_tx_complete} ${_tx_good} ${_tx_ok} )
|
set( CALAMARES_TRANSLATION_LANGUAGES en ${_tx_complete} ${_tx_good} ${_tx_ok} )
|
||||||
list( SORT CALAMARES_TRANSLATION_LANGUAGES )
|
list( SORT CALAMARES_TRANSLATION_LANGUAGES )
|
||||||
|
|
||||||
### Bump version here
|
add_subdirectory( lang ) # i18n tools
|
||||||
set( CALAMARES_VERSION_MAJOR 3 )
|
|
||||||
set( CALAMARES_VERSION_MINOR 2 )
|
|
||||||
set( CALAMARES_VERSION_PATCH 0 )
|
|
||||||
set( CALAMARES_VERSION_RC 0 )
|
|
||||||
|
|
||||||
set( CALAMARES_VERSION ${CALAMARES_VERSION_MAJOR}.${CALAMARES_VERSION_MINOR}.${CALAMARES_VERSION_PATCH} )
|
set( CALAMARES_VERSION ${CALAMARES_VERSION_MAJOR}.${CALAMARES_VERSION_MINOR}.${CALAMARES_VERSION_PATCH} )
|
||||||
set( CALAMARES_VERSION_SHORT "${CALAMARES_VERSION}" )
|
set( CALAMARES_VERSION_SHORT "${CALAMARES_VERSION}" )
|
||||||
|
Loading…
Reference in New Issue
Block a user