Skip to content
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

Merged
merged 1 commit into from
Jan 5, 2024

Conversation

firewave
Copy link
Collaborator

@firewave firewave commented Jan 4, 2024

No description provided.

project(Cppcheck)
cmake_minimum_required(VERSION 3.5)
if (MSVC)
cmake_minimum_required(VERSION 3.13)
Copy link
Collaborator Author

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.")
Copy link
Collaborator Author

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)
Copy link
Collaborator Author

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)
Copy link
Collaborator Author

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.

@firewave
Copy link
Collaborator Author

firewave commented Jan 4, 2024

Requires #5398 to be merged first.

@firewave firewave marked this pull request as ready for review January 4, 2024 20:33
@firewave firewave marked this pull request as draft January 4, 2024 20:44
@firewave firewave marked this pull request as ready for review January 4, 2024 20:47
Copy link
Owner

@danmar danmar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@firewave firewave merged commit 93a53af into danmar:main Jan 5, 2024
64 checks passed
@firewave firewave deleted the cmake-3x branch January 5, 2024 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants