when i make my project i’m getting a message something like, "set_our+header_properties) is not defined so i located the file it’s defined at and here’s what it says now after i tried putting in a message to indicate the file is being read:
#this is supposed to give me a messaage in the log. if it appears than this file is being read by cmake.
message(STATUS “Common.cmake loaded, function set_our_header_properties defined is here at the top of this file, if this message appears at least i know it’s reading the file.”)
function(set_our_header_properties)
foreach(file ${ARGN})
# Infer which subdirectory this header file should be installed.
set(loc ${file})
string(REPLACE “${CMAKE_CURRENT_BINARY_DIR}/” “” loc ${loc})
string(REGEX REPLACE “^include/” “” loc ${loc})
string(REGEX REPLACE “/[-A-Za-z0-9_]+.$” “” loc ${loc})
string(REGEX REPLACE “^addons/[^/]+/” “” loc ${loc})
# If we have inferred correctly then it should be under allegro5.
string(REGEX MATCH "^allegro5" matched ${loc})
if(matched STREQUAL "allegro5")
# MACOSX_PACKAGE_LOCATION is also used in install_our_headers.
set_source_files_properties(${file}
PROPERTIES
MACOSX_PACKAGE_LOCATION Headers/${loc}
)
else()
message(FATAL_ERROR "Could not infer where to install ${file}")
endif()
endforeach(file)
endfunction(set_our_header_properties)
this is my file where function(set_our_properties) is and i don’t think it’s being read cause i included the file at line one of my CMakeLists.txt. this is the line i added:
include(cmake/Common.cmake)
the CMakeLists.txt file is in ~/allegro5 and the Common.cmake file is in ~allegro5/cmake so i think i have the correct path to include it. it seems the file still isn’t being read, i’ve made a log and reviewed it with the following command: cmake … --trace-expand -DWANT_PRIMITIVES=ON -DWANT_IMAGE=ON -DWANT_FONT=ON -DWANT_AUDIO=ON -DWANT_ACODEC=ON -DWANT_COLOR=ON -DWANT_MEMFILE=ON -DWANT_PHYSFS=ON -DWANT_NATIVE_DIALOG=ON -DWANT_VIDEO=ON -DWANT_TTF=ON > log 2>&1
when i review the log there’s no mention of Common.cmake file at all so i believe the problem is it’s still not looking at the file. i suspect there may be an issue with the cmake version but i’m not sure. how do i fix this?
system: linux mint: 6.8.0-49-generic
cmake version: cmake version 3.28.3
make version: GNU Make 4.3
Built for x86_64-pc-linux-gnu