From 23ba24775b01863c66d4660d8b76c95f8a474d48 Mon Sep 17 00:00:00 2001 From: Vincent Cunningham Date: Fri, 16 Jul 2021 14:05:33 -0400 Subject: [PATCH 1/4] Fix install destinations `.` will by default install to `/usr/local/./armips` (similar for the Readme) which is undesirable. armips should install to a bin directory, Readme should install to a doc directory for the executable. --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 663cc195..e7087a3c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -244,6 +244,6 @@ if(NOT ARMIPS_LIBRARY_ONLY) add_test(NAME armipstests COMMAND armipstests ${CMAKE_CURRENT_SOURCE_DIR}/Tests) # install - install(TARGETS armips-bin RUNTIME DESTINATION .) - install(FILES Readme.md DESTINATION .) + install(TARGETS armips-bin RUNTIME DESTINATION bin) + install(FILES Readme.md DESTINATION share/doc/armips) endif() From 76a1935848788fa26ca71f782c2ab50afe2495fb Mon Sep 17 00:00:00 2001 From: Vincent Cunningham Date: Fri, 16 Jul 2021 14:31:58 -0400 Subject: [PATCH 2/4] Use PROJECT_NAME --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e7087a3c..921d3589 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -245,5 +245,5 @@ if(NOT ARMIPS_LIBRARY_ONLY) # install install(TARGETS armips-bin RUNTIME DESTINATION bin) - install(FILES Readme.md DESTINATION share/doc/armips) + install(FILES Readme.md DESTINATION share/doc/${PROJECT_NAME}) endif() From 7d4efd53aba4f9bf76a94d2c279ce10f160b2249 Mon Sep 17 00:00:00 2001 From: Vincent Cunningham Date: Tue, 20 Jul 2021 15:42:41 -0400 Subject: [PATCH 3/4] Use GNUInstallDirs Use default UNIX values on non-Windows systems, use the prefix directory itself on Windows. --- CMakeLists.txt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 921d3589..57a77d70 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -244,6 +244,12 @@ if(NOT ARMIPS_LIBRARY_ONLY) add_test(NAME armipstests COMMAND armipstests ${CMAKE_CURRENT_SOURCE_DIR}/Tests) # install - install(TARGETS armips-bin RUNTIME DESTINATION bin) - install(FILES Readme.md DESTINATION share/doc/${PROJECT_NAME}) + if(WIN32) + set(${CMAKE_INSTALL_BINDIR} ".") + set(${CMAKE_INSTALL_DOCDIR} ".") + else() # Not checking for UNIX so some value is always provided to the variables for non-Windows platforms. + include(GNUInstallDirs) + endif() + install(TARGETS armips-bin RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + install(FILES Readme.md DESTINATION ${CMAKE_INSTALL_DOCDIR}) endif() From c3efd5f129212444a23789ba23e0866f58aaf1b3 Mon Sep 17 00:00:00 2001 From: Vincent Cunningham Date: Tue, 20 Jul 2021 15:46:16 -0400 Subject: [PATCH 4/4] Just use GNUInstallDirs and override for windows. Previous commit feels over-engineered. --- CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 57a77d70..bc22ba5b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -244,11 +244,10 @@ if(NOT ARMIPS_LIBRARY_ONLY) add_test(NAME armipstests COMMAND armipstests ${CMAKE_CURRENT_SOURCE_DIR}/Tests) # install + include(GNUInstallDirs) if(WIN32) set(${CMAKE_INSTALL_BINDIR} ".") set(${CMAKE_INSTALL_DOCDIR} ".") - else() # Not checking for UNIX so some value is always provided to the variables for non-Windows platforms. - include(GNUInstallDirs) endif() install(TARGETS armips-bin RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) install(FILES Readme.md DESTINATION ${CMAKE_INSTALL_DOCDIR})