Cmake: BUILD_XXHSUM is set, but do nothing #138

Closed
opened 2018-05-14 10:37:47 -05:00 by sl1pkn07 · 1 comment
sl1pkn07 commented 2018-05-14 10:37:47 -05:00 (Migrated from github.com)

BUILD_XXHSUM is set, but do nothing. seems need add at start/end of this part

if (BUILD_XXHSUM)
github.com/Cyan4973/xxHash@3064d42e7d/cmake_unofficial/CMakeLists.txt (L64-L66)
endif(BUILD_XXHSUM)

greetings

BUILD_XXHSUM is set, but do nothing. seems need add at start/end of this part `if (BUILD_XXHSUM)` https://github.com/Cyan4973/xxHash/blob/3064d42e7d74b0921bdd1818395d9cb37bb8976a/cmake_unofficial/CMakeLists.txt#L64-L66 `endif(BUILD_XXHSUM)` greetings
sl1pkn07 commented 2018-05-14 12:26:25 -05:00 (Migrated from github.com)
diff --git a/cmake_unofficial/CMakeLists.txt b/cmake_unofficial/CMakeLists.txt
index 1ca7a06..42cb2b6 100644
--- a/cmake_unofficial/CMakeLists.txt
+++ b/cmake_unofficial/CMakeLists.txt
@@ -61,9 +61,11 @@ set_target_properties(xxhash PROPERTIES
   SOVERSION "${XXHASH_VERSION_STRING}"
   VERSION "${XXHASH_VERSION_STRING}")
 
-# xxhsum
-add_executable(xxhsum "${XXHASH_DIR}/xxhsum.c")
-target_link_libraries(xxhsum xxhash)
+if(BUILD_XXHSUM)
+    # xxhsum
+    add_executable(xxhsum "${XXHASH_DIR}/xxhsum.c")
+    target_link_libraries(xxhsum xxhash)
+endif(BUILD_XXHSUM)
 
 # Extra warning flags
 include (CheckCCompilerFlag)
@@ -87,9 +89,10 @@ endforeach (flag)
 
 if(NOT XXHASH_BUNDLED_MODE)
   include(GNUInstallDirs)
-
-  install(TARGETS xxhsum
-    RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
+  if(BUILD_XXHSUM)
+    install(TARGETS xxhsum
+      RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
+  endif(BUILD_XXHSUM)
   install(TARGETS xxhash
     LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
     ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}")
~~~patch diff --git a/cmake_unofficial/CMakeLists.txt b/cmake_unofficial/CMakeLists.txt index 1ca7a06..42cb2b6 100644 --- a/cmake_unofficial/CMakeLists.txt +++ b/cmake_unofficial/CMakeLists.txt @@ -61,9 +61,11 @@ set_target_properties(xxhash PROPERTIES SOVERSION "${XXHASH_VERSION_STRING}" VERSION "${XXHASH_VERSION_STRING}") -# xxhsum -add_executable(xxhsum "${XXHASH_DIR}/xxhsum.c") -target_link_libraries(xxhsum xxhash) +if(BUILD_XXHSUM) + # xxhsum + add_executable(xxhsum "${XXHASH_DIR}/xxhsum.c") + target_link_libraries(xxhsum xxhash) +endif(BUILD_XXHSUM) # Extra warning flags include (CheckCCompilerFlag) @@ -87,9 +89,10 @@ endforeach (flag) if(NOT XXHASH_BUNDLED_MODE) include(GNUInstallDirs) - - install(TARGETS xxhsum - RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") + if(BUILD_XXHSUM) + install(TARGETS xxhsum + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") + endif(BUILD_XXHSUM) install(TARGETS xxhash LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}") ~~~
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-Cyan4973/xxHash#138
No description provided.