diff options
author | Andreas Schneider <asn@samba.org> | 2020-01-31 13:06:13 +0100 |
---|---|---|
committer | Andreas Schneider <asn@samba.org> | 2020-01-31 13:06:13 +0100 |
commit | 0683ae515f12539e2de71e3b770df3a3d637e089 (patch) | |
tree | f7da3444d4ddb6c0959625fff3c5a15b963d3620 | |
parent | 68aa7b7826e84c9fd15bdd0618dd4a2b30896c0d (diff) | |
download | pam_wrapper-0683ae515f12539e2de71e3b770df3a3d637e089.tar.gz pam_wrapper-0683ae515f12539e2de71e3b770df3a3d637e089.tar.xz pam_wrapper-0683ae515f12539e2de71e3b770df3a3d637e089.zip |
cmake: Update cmake defaults
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
-rw-r--r-- | CMakeLists.txt | 4 | ||||
-rw-r--r-- | cmake/Modules/DefineCMakeDefaults.cmake | 19 | ||||
-rw-r--r-- | cmake/Modules/MacroEnsureOutOfSourceBuild.cmake | 17 |
3 files changed, 7 insertions, 33 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index fe635a9..6d75231 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,10 +33,6 @@ include(DefineInstallationPaths) include(DefineOptions.cmake) include(CPackConfig.cmake) -# disallow in-source build -include(MacroEnsureOutOfSourceBuild) -macro_ensure_out_of_source_build("${PROJECT_NAME} requires an out of source build. Please create a separate build directory and run 'cmake /path/to/${PROJECT_NAME} [options]' there.") - # Find out if we have threading available set(CMAKE_THREAD_PREFER_PTHREADS ON) find_package(Threads) diff --git a/cmake/Modules/DefineCMakeDefaults.cmake b/cmake/Modules/DefineCMakeDefaults.cmake index 22eda6f..9fb034f 100644 --- a/cmake/Modules/DefineCMakeDefaults.cmake +++ b/cmake/Modules/DefineCMakeDefaults.cmake @@ -14,17 +14,12 @@ set(CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE ON) # since cmake 2.4.0 set(CMAKE_COLOR_MAKEFILE ON) -# Define the generic version of the libraries here -set(GENERIC_LIB_VERSION "0.1.0") -set(GENERIC_LIB_SOVERSION "0") - -# Set the default build type to release with debug info -if (NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE RelWithDebInfo - CACHE STRING - "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." - ) -endif (NOT CMAKE_BUILD_TYPE) - # Create the compile command database for clang by default set(CMAKE_EXPORT_COMPILE_COMMANDS ON) + +# Always build with -fPIC +set(CMAKE_POSITION_INDEPENDENT_CODE ON) + +# Avoid source tree pollution +set(CMAKE_DISABLE_SOURCE_CHANGES ON) +set(CMAKE_DISABLE_IN_SOURCE_BUILD ON) diff --git a/cmake/Modules/MacroEnsureOutOfSourceBuild.cmake b/cmake/Modules/MacroEnsureOutOfSourceBuild.cmake deleted file mode 100644 index a2e9480..0000000 --- a/cmake/Modules/MacroEnsureOutOfSourceBuild.cmake +++ /dev/null @@ -1,17 +0,0 @@ -# - MACRO_ENSURE_OUT_OF_SOURCE_BUILD(<errorMessage>) -# MACRO_ENSURE_OUT_OF_SOURCE_BUILD(<errorMessage>) - -# Copyright (c) 2006, Alexander Neundorf, <neundorf@kde.org> -# -# Redistribution and use is allowed according to the terms of the BSD license. -# For details see the accompanying COPYING-CMAKE-SCRIPTS file. - -macro (MACRO_ENSURE_OUT_OF_SOURCE_BUILD _errorMessage) - - string(COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" _insource) - if (_insource) - message(SEND_ERROR "${_errorMessage}") - message(FATAL_ERROR "Remove the file CMakeCache.txt in ${CMAKE_SOURCE_DIR} first.") - endif (_insource) - -endmacro (MACRO_ENSURE_OUT_OF_SOURCE_BUILD) |