- At build time, the version, compile time, CMake version, compiler version, and compiler flags are retrieved with the new CMake module and a header is created. This header provides more robust version management and notifications. - Build warnings fixed, code corrected for compilation. - Improvements were made to CMake code. - Modifications were made to the tests to read the library's version information.
42 lines
1.3 KiB
CMake
42 lines
1.3 KiB
CMake
#
|
||
# Copyright 2025 Yağız Zengin
|
||
#
|
||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||
# you may not use this file except in compliance with the License.
|
||
# You may obtain a copy of the License at
|
||
|
||
# http://www.apache.org/licenses/LICENSE-2.0
|
||
#
|
||
# Unless required by applicable law or agreed to in writing, software
|
||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
# See the License for the specific language governing permissions and
|
||
# limitations under the License.
|
||
#
|
||
|
||
# Project info
|
||
cmake_minimum_required(VERSION 3.10)
|
||
project(pmt VERSION 1.0.0)
|
||
|
||
# Set compiler flags
|
||
add_compile_options(-Wall -Werror)
|
||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||
add_compile_options(-gdwarf-5 -fsanitize=address -fstack-protector)
|
||
endif()
|
||
|
||
# Add pmt's CMake module(s)
|
||
include(cmake/generate_headers.cmake)
|
||
|
||
# Generate header(s)
|
||
get_property(FLAGS DIRECTORY PROPERTY COMPILE_OPTIONS)
|
||
generateBuildInfo(${FLAGS})
|
||
|
||
# Add include directories
|
||
include_directories(include srclib/libhelper/include srclib/libpartition_map/include)
|
||
|
||
# Add libraries
|
||
add_subdirectory(srclib/libhelper)
|
||
add_subdirectory(srclib/libpartition_map)
|
||
|
||
# NOTE: pmt is not ready, this CMakeFiles.txt only builds libraries
|