From 51730a6ac5b03c8e38da2d0ede1e55c728bc7633 Mon Sep 17 00:00:00 2001 From: Carl Timmer Date: Fri, 12 Mar 2021 09:59:03 -0500 Subject: [PATCH] update --- CMakeLists.txt | 10 ++++------ cmake_uninstall.cmake.in | 39 +++++++++++++++++++-------------------- 2 files changed, 23 insertions(+), 26 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4317f122e..b1bd3b16b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,7 +30,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED True) set(CMAKE_DEBUG_POSTFIX -dbg) -# Place libs & binaries in build/cmake/lib and bin (this is not for installation) +# Place libs & binaries in build/lib and bin (this is not for installation) set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib) set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin) @@ -67,11 +67,6 @@ else() endif() -# Example of executing a command -#EXECUTE_PROCESS( COMMAND uname -a COMMAND tr -d '\n' OUTPUT_VARIABLE UNAME ) -#message(STATUS "UNAME = " ${UNAME}) - - set(C_HEADER_FILES src/libCsrc/evio.h src/libCsrc/msinttypes.h @@ -344,9 +339,12 @@ if (NOT DEFINED C_ONLY) # Main Executables add_executable(ReadWriteTest src/test/ReadWriteTest.cpp) + # Put debug extension on if applicable + set_target_properties(ReadWriteTest PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX}) target_link_libraries(ReadWriteTest pthread ${Boost_LIBRARIES} expat dl z m ${LZ4_LIBRARY} eviocc) add_executable(RingBufferTest src/test/RingBufferTest.cpp) + set_target_properties(RingBufferTest PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX}) target_link_libraries(RingBufferTest pthread ${Boost_LIBRARIES} expat dl z m ${LZ4_LIBRARY} eviocc) else() message(STATUS "NOT compiling C++ evio library!!!" ) diff --git a/cmake_uninstall.cmake.in b/cmake_uninstall.cmake.in index c6d809418..c2d34d479 100644 --- a/cmake_uninstall.cmake.in +++ b/cmake_uninstall.cmake.in @@ -1,22 +1,21 @@ -if (NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") - message(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"") -endif(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") +if(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt") + message(FATAL_ERROR "Cannot find install manifest: @CMAKE_BINARY_DIR@/install_manifest.txt") +endif() -file(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files) +file(READ "@CMAKE_BINARY_DIR@/install_manifest.txt" files) string(REGEX REPLACE "\n" ";" files "${files}") -list(REVERSE files) -foreach (file ${files}) - message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"") - if (EXISTS "$ENV{DESTDIR}${file}") - execute_process( - COMMAND @CMAKE_COMMAND@ -E remove "$ENV{DESTDIR}${file}" - OUTPUT_VARIABLE rm_out - RESULT_VARIABLE rm_retval - ) - if(NOT ${rm_retval} EQUAL 0) - message(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"") - endif (NOT ${rm_retval} EQUAL 0) - else (EXISTS "$ENV{DESTDIR}${file}") - message(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.") - endif (EXISTS "$ENV{DESTDIR}${file}") -endforeach(file) +foreach(file ${files}) + message(STATUS "Uninstalling $ENV{DESTDIR}${file}") + if(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") + exec_program( + "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" + OUTPUT_VARIABLE rm_out + RETURN_VALUE rm_retval + ) + if(NOT "${rm_retval}" STREQUAL 0) + message(FATAL_ERROR "Problem when removing $ENV{DESTDIR}${file}") + endif() + else(IS_SYMLINK "$ENV{DESTDIR}${file}" OR EXISTS "$ENV{DESTDIR}${file}") + message(STATUS "File $ENV{DESTDIR}${file} does not exist.") + endif() +endforeach()