File tree Expand file tree Collapse file tree 12 files changed +49
-9
lines changed Expand file tree Collapse file tree 12 files changed +49
-9
lines changed Original file line number Diff line number Diff line change 1- cmake_minimum_required (VERSION 3.0 )
1+ cmake_minimum_required (VERSION 3.19 )
22
33project (whisper.cpp VERSION 1.0.4)
44
5- set (CMAKE_EXPORT_COMPILE_COMMANDS "on" )
6- set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR} /bin)
7- set (CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX} /lib" )
5+ # Add path to modules
6+ list ( APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR} /cmake/" )
87
98if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )
109 set (WHISPER_STANDALONE ON )
11- include (cmake/ GitVars.cmake )
12- include (cmake/ BuildTypes.cmake )
10+ include (GitVars)
11+ include (BuildTypes)
1312
1413 # configure project version
1514 if (EXISTS "${CMAKE_SOURCE_DIR} /bindings/ios/Makefile-tmpl" )
@@ -82,9 +81,6 @@ endif()
8281
8382# dependencies
8483
85- set (CMAKE_C_STANDARD 11)
86- set (CMAKE_CXX_STANDARD 11)
87-
8884find_package (Threads REQUIRED)
8985
9086# on APPLE - include Accelerate framework
@@ -190,6 +186,8 @@ add_library(${TARGET}
190186 whisper.cpp
191187 )
192188
189+ include (DefaultTargetOptions)
190+
193191target_include_directories (${TARGET} PUBLIC
194192 .
195193 )
Original file line number Diff line number Diff line change 1+ # Set the default compile features and properties for a target.
2+
3+ if (NOT TARGET )
4+ message (FATAL_ERROR "TARGET not set before including DefaultTargetOptions" )
5+ endif ()
6+
7+ target_compile_features (${TARGET}
8+ PRIVATE
9+ cxx_std_11
10+ )
11+
12+ set_target_properties (${TARGET}
13+ PROPERTIES
14+ EXPORT_COMPILE_COMMANDS ON
15+ RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR} /bin"
16+ INSTALL_RPATH "${CMAKE_INSTALL_PREFIX} /lib"
17+ )
Original file line number Diff line number Diff line change @@ -8,6 +8,8 @@ add_executable(${TARGET}
88 emscripten.cpp
99 )
1010
11+ include (DefaultTargetOptions)
12+
1113target_link_libraries (${TARGET} PRIVATE
1214 whisper
1315 )
Original file line number Diff line number Diff line change 11set (TARGET bench)
22add_executable (${TARGET} bench.cpp)
3+
4+ include (DefaultTargetOptions)
5+
36target_link_libraries (${TARGET} PRIVATE whisper ${CMAKE_THREAD_LIBS_INIT} )
Original file line number Diff line number Diff line change @@ -8,6 +8,8 @@ add_executable(${TARGET}
88 emscripten.cpp
99 )
1010
11+ include (DefaultTargetOptions)
12+
1113target_link_libraries (${TARGET} PRIVATE
1214 whisper
1315 )
Original file line number Diff line number Diff line change @@ -2,6 +2,9 @@ if (WHISPER_SUPPORT_SDL2)
22 # command
33 set (TARGET command )
44 add_executable (${TARGET} command .cpp)
5+
6+ include (DefaultTargetOptions)
7+
58 target_include_directories (${TARGET} PRIVATE ${SDL2_INCLUDE_DIRS} )
69 target_link_libraries (${TARGET} PRIVATE whisper ${SDL2_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} )
710endif ()
Original file line number Diff line number Diff line change 11set (TARGET main)
22add_executable (${TARGET} main.cpp)
3+
4+ include (DefaultTargetOptions)
5+
36target_link_libraries (${TARGET} PRIVATE whisper ${CMAKE_THREAD_LIBS_INIT} )
Original file line number Diff line number Diff line change @@ -8,6 +8,8 @@ add_executable(${TARGET}
88 emscripten.cpp
99 )
1010
11+ include (DefaultTargetOptions)
12+
1113target_link_libraries (${TARGET} PRIVATE
1214 whisper
1315 )
Original file line number Diff line number Diff line change @@ -2,6 +2,9 @@ if (WHISPER_SUPPORT_SDL2)
22 # stream
33 set (TARGET stream)
44 add_executable (${TARGET} stream.cpp)
5+
6+ include (DefaultTargetOptions)
7+
58 target_include_directories (${TARGET} PRIVATE ${SDL2_INCLUDE_DIRS} )
69 target_link_libraries (${TARGET} PRIVATE whisper ${SDL2_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} )
710endif ()
Original file line number Diff line number Diff line change @@ -9,6 +9,8 @@ add_executable(${TARGET}
99 gpt-2.cpp
1010 )
1111
12+ include (DefaultTargetOptions)
13+
1214target_link_libraries (${TARGET} PRIVATE
1315 whisper
1416 )
You can’t perform that action at this time.
0 commit comments