]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commitdiff
cmake : create solution folders (#2004)
authorulatekh <redacted>
Tue, 9 Apr 2024 15:23:33 +0000 (08:23 -0700)
committerGitHub <redacted>
Tue, 9 Apr 2024 15:23:33 +0000 (18:23 +0300)
* Create solution folders in the CMake build.

* Fixed non-SDL2 build.

* Fixed emscripten build.

CMakeLists.txt
examples/CMakeLists.txt
examples/wchess/CMakeLists.txt

index c7562025b854f1cbe4e430cc154fee233f5fe0e5..db0862454cec461bccf37ad503e2dff38b51ec52 100644 (file)
@@ -1,5 +1,8 @@
 cmake_minimum_required (VERSION 3.5)
 
+# Allow for the creation of solution folders.
+set_property(GLOBAL PROPERTY USE_FOLDERS ON)
+
 project(whisper.cpp VERSION 1.5.4)
 set(SOVERSION 1)
 
@@ -561,6 +564,7 @@ if (WHISPER_COREML)
     set_target_properties(${TARGET} PROPERTIES
         COMPILE_FLAGS "-fobjc-arc"
         )
+    set_target_properties(${TARGET} PROPERTIES FOLDER "libs")
 endif()
 
 if (WHISPER_OPENVINO)
@@ -579,6 +583,7 @@ if (WHISPER_OPENVINO)
     set(WHISPER_EXTRA_FLAGS ${WHISPER_EXTRA_FLAGS} -DWHISPER_USE_OPENVINO)
 
     target_link_libraries(${TARGET} PRIVATE openvino::runtime)
+    set_target_properties(${TARGET} PROPERTIES FOLDER "libs")
 endif()
 
 #
@@ -677,6 +682,7 @@ target_compile_definitions(${TARGET} PUBLIC
     )
 
 set_target_properties(${TARGET} PROPERTIES PUBLIC_HEADER "ggml.h;whisper.h")
+set_target_properties(${TARGET} PROPERTIES FOLDER "libs")
 
 include(GNUInstallDirs)
 
index 5025cb599b4c8eb0d2cc2391acc1023005be158b..104482f21337825dd4c0b09209e7bfda00e19d25 100644 (file)
@@ -36,6 +36,7 @@ include(DefaultTargetOptions)
 target_link_libraries(${TARGET} PRIVATE whisper)
 
 set_target_properties(${TARGET} PROPERTIES POSITION_INDEPENDENT_CODE ON)
+set_target_properties(${TARGET} PROPERTIES FOLDER "libs")
 
 if (WHISPER_SDL2)
     # common-sdl
@@ -53,10 +54,12 @@ if (WHISPER_SDL2)
     target_link_libraries(${TARGET} PRIVATE ${SDL2_LIBRARIES})
 
     set_target_properties(${TARGET} PROPERTIES POSITION_INDEPENDENT_CODE ON)
+    set_target_properties(${TARGET} PROPERTIES FOLDER "libs")
 endif()
 
 # add json lib
 add_library(json_cpp INTERFACE json.hpp)
+set_target_properties(json_cpp PROPERTIES FOLDER "libs")
 
 # examples
 
@@ -64,25 +67,50 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR})
 
 if (EMSCRIPTEN)
     add_subdirectory(whisper.wasm)
+    set_target_properties(libmain PROPERTIES FOLDER "libs")
     add_subdirectory(stream.wasm)
+    set_target_properties(libstream PROPERTIES FOLDER "libs")
     add_subdirectory(command.wasm)
+    set_target_properties(libcommand PROPERTIES FOLDER "libs")
     add_subdirectory(talk.wasm)
+    set_target_properties(libtalk PROPERTIES FOLDER "libs")
     add_subdirectory(bench.wasm)
+    set_target_properties(libbench PROPERTIES FOLDER "libs")
 elseif(CMAKE_JS_VERSION)
     add_subdirectory(addon.node)
+    set_target_properties(addon.node PROPERTIES FOLDER "examples")
 else()
     add_subdirectory(main)
+    set_target_properties(main PROPERTIES FOLDER "examples")
+if (WHISPER_SDL2)
     add_subdirectory(stream)
+    set_target_properties(stream PROPERTIES FOLDER "examples")
+endif (WHISPER_SDL2)
     add_subdirectory(server)
+    set_target_properties(server PROPERTIES FOLDER "examples")
+if (WHISPER_SDL2)
     add_subdirectory(command)
+    set_target_properties(command PROPERTIES FOLDER "examples")
+endif (WHISPER_SDL2)
     add_subdirectory(bench)
+    set_target_properties(bench PROPERTIES FOLDER "examples")
     add_subdirectory(quantize)
+    set_target_properties(quantize PROPERTIES FOLDER "examples")
+if (WHISPER_SDL2)
     add_subdirectory(talk)
+    set_target_properties(talk PROPERTIES FOLDER "examples")
     add_subdirectory(talk-llama)
+    set_target_properties(talk-llama PROPERTIES FOLDER "examples")
     add_subdirectory(lsp)
+    set_target_properties(lsp PROPERTIES FOLDER "examples")
     if (LLAMA_SYCL)
         add_subdirectory(sycl)
+        set_target_properties(sycl PROPERTIES FOLDER "examples")
     endif()
+endif (WHISPER_SDL2)
 endif()
 
-add_subdirectory(wchess)
+if (WHISPER_SDL2)
+    add_subdirectory(wchess)
+    set_target_properties(wchess PROPERTIES FOLDER "examples")
+endif (WHISPER_SDL2)
index ce8e6d867941f0137111b0b2210610c813714c7b..7aa1209884978694deee4beea8f1b87b505b4e1c 100644 (file)
@@ -1,7 +1,10 @@
 add_subdirectory(libwchess)
+set_target_properties(wchess-core PROPERTIES FOLDER "libs")
 
 if (EMSCRIPTEN)
     add_subdirectory(wchess.wasm)
+    set_target_properties(wchess.wasm PROPERTIES FOLDER "libs")
 else()
     add_subdirectory(wchess.cmd)
+    set_target_properties(wchess PROPERTIES FOLDER "libs")
 endif()