Bump CMake requirement to 3.1 and fix code which requires 3.2+

CMake supports CXX_STANDARD target property (and therefore
automatic -std=c++11) since 3.1

Thanks to noteness for the report
This commit is contained in:
Alexey Sokolov
2016-01-17 16:39:03 +00:00
parent ae803769c2
commit 82b30ced5e
3 changed files with 7 additions and 4 deletions

View File

@@ -14,7 +14,7 @@
# limitations under the License.
#
cmake_minimum_required(VERSION 3.0)
cmake_minimum_required(VERSION 3.1)
project(ZNC VERSION 1.7.0)
set(ZNC_VERSION 1.7.x)
set(append_git_version true)
@@ -332,6 +332,4 @@ message("")
# TODO
# ====
#
# readme: advice about cmake --system-information
# remove old configure.ac and Makefile.in
# consider mininum cmake version

View File

@@ -14,6 +14,11 @@
# limitations under the License.
#
if(CMAKE_VERSION VERSION_LESS 3.2)
# Since 3.2 it does this automatically from BYPRODUCTS
set_source_files_properties("versionc.cpp" PROPERTIES GENERATED true)
endif()
znc_add_library(znclib ${lib_type} "ZNCString.cpp" "znc.cpp" "IRCNetwork.cpp"
"IRCSock.cpp" "Client.cpp" "Chan.cpp" "Nick.cpp" "Server.cpp"
"Modules.cpp" "MD5.cpp" "Buffer.cpp" "Utils.cpp" "FileUtils.cpp"

View File

@@ -56,7 +56,7 @@ args = parser.parse_args()
with tempfile.TemporaryDirectory() as cmdir:
with open(os.path.join(cmdir, 'CMakeLists.txt'), 'w') as cm:
print('cmake_minimum_required(VERSION 3.0)', file=cm)
print('cmake_minimum_required(VERSION 3.1)', file=cm)
print('project(ExternalModules)', file=cm)
print('find_package(ZNC @ZNC_VERSION_MAJOR@.@ZNC_VERSION_MINOR@ PATHS '
'@CMAKE_INSTALL_FULL_DATADIR@/znc)', file=cm)