Skip to content

Commit 691a1d5

Browse files
committed
Check .x files and uninstall them if any found
1 parent eb424f0 commit 691a1d5

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

CMakeLists.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,19 @@ include(GNUInstallDirs)
1313
set(THREADS_PREFER_PTHREAD_FLAG ON)
1414
find_package(Threads REQUIRED)
1515

16+
# Check for pcm*.x artifacts generated by an old build scenario using Makefiles
17+
file(GLOB_RECURSE PCM_X_ARTIFACTS ${CMAKE_CURRENT_SOURCE_DIR}/*.x)
18+
foreach(file ${PCM_X_ARTIFACTS})
19+
file(REMOVE ${file})
20+
message(STATUS "Removing old artifact from current source directory : ${file}")
21+
endforeach()
22+
if(PCM_X_ARTIFACTS)
23+
message(WARNING
24+
" Old pcm utilities (.x) were indicated in build folder.\n"
25+
" Old binaries are expected to be installed in system.\n"
26+
" Make sure to install the new binaries(run 'cmake --install .') after building.)")
27+
endif()
28+
1629
message(STATUS "System: ${CMAKE_SYSTEM}")
1730
if(UNIX AND NOT APPLE)
1831
if(${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")

0 commit comments

Comments
 (0)