-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
modernized and cleaned up CMake files / explicitly check for CMake 3.13 with Visual Studio #5825
Conversation
project(Cppcheck) | ||
cmake_minimum_required(VERSION 3.5) | ||
if (MSVC) | ||
cmake_minimum_required(VERSION 3.13) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
subsequent calls to raise the required version are allowed
@@ -72,6 +72,10 @@ else() | |||
set(CMAKE_DISABLE_PRECOMPILE_HEADERS On CACHE BOOL "Disable precompiled headers") | |||
endif() | |||
|
|||
if (CMAKE_VERSION VERSION_LESS "3.9") | |||
message(FATAL_ERROR "Registering tests with CTest requires at least CMake 3.9. Use REGISTER_TESTS=OFF to disable this.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would have bailed out in the test code later on before. I moved it up so there is not a stray cmake_minimum_required()
call somewhere in the code.
|
||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) | ||
|
||
include(GNUInstallDirs) | ||
|
||
include(cmake/ccache.cmake) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No longer necessary. Was a work around for CMake 2.8.
|
||
include(cmake/cxx11.cmake) | ||
use_cxx11() | ||
set (CMAKE_CXX_STANDARD_REQUIRED ON) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved from cxx11.cmake
as it is generic and available now.
Requires #5398 to be merged first. |
…13 with Visual Studio
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
No description provided.