Skip to content

Commit

Permalink
Download silber lib as debug
Browse files Browse the repository at this point in the history
ben committed Sep 21, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 927877e commit b50b285
Showing 2 changed files with 39 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_windows.yml
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@ jobs:
mkdir build &&
echo "preparing new build with cmake..." &&
cd build/ &&
cmake .. &&
cmake -DCMAKE_BUILD_TYPE=Release .. &&
cmake --build . &&
echo "Build complete!"
shell: bash
41 changes: 38 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 3.0)
cmake_minimum_required (VERSION 3.14)

project (aquamarine)

@@ -23,7 +23,7 @@ IF (UNIX OR APPLE)
include_directories(${SQLite3_INCLUDE_DIRS} ${JPEG_INCLUDE_DIR})
ENDIF()

add_subdirectory(sh_mem)
#add_subdirectory(sh_mem)

set(AM_SOURCE_FILES
analyze/AffinityComparer.cpp
@@ -44,6 +44,41 @@ set(AM_SOURCE_FILES
service/SilberService.cpp
)

# Unpack the archive based on the platform
if(UNIX AND NOT APPLE)
set(LIB_URL "https://github.com/MaksymT17/silber/releases/download/1.1/linux_release.zip")
set(LIB_NAME "linux_release.zip")
set(LIB_PATH "${CMAKE_BINARY_DIR}/${LIB_NAME}") # Full path including filename
file(DOWNLOAD ${LIB_URL} ${LIB_PATH})
execute_process(COMMAND unzip ${LIB_PATH} -d ${CMAKE_BINARY_DIR})

elseif(APPLE)
set(LIB_URL "https://github.com/MaksymT17/silber/releases/download/1.1/macos_release.zip")
set(LIB_NAME "macos_release.zip")
set(LIB_PATH "${CMAKE_BINARY_DIR}/${LIB_NAME}") # Full path including filename
file(DOWNLOAD ${LIB_URL} ${LIB_PATH})
execute_process(COMMAND unzip ${LIB_PATH} -d ${CMAKE_BINARY_DIR})

elseif(WIN32)
set(LIB_URL "https://github.com/MaksymT17/silber/releases/download/1.1/windows_debug.zip")
set(LIB_NAME "windows_debug.zip")
set(LIB_PATH "${CMAKE_BINARY_DIR}/${LIB_NAME}") # Full path including filename
file(DOWNLOAD ${LIB_URL} ${LIB_PATH})
execute_process(COMMAND powershell -Command "Expand-Archive -Path ${LIB_PATH} -DestinationPath '${CMAKE_BINARY_DIR}'")

else()
#print unsupported OS
endif()

file(MAKE_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/silber/lib")
file(COPY "${CMAKE_BINARY_DIR}/lib" DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/silber/")

file(MAKE_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/silber/include")
file(COPY "${CMAKE_BINARY_DIR}/include" DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/silber/")

link_directories("${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/silber/lib")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/silber/include")

IF (UNIX OR APPLE)
add_library(aquamarine_lib STATIC ${AM_SOURCE_FILES} ${JPEG_LIBRARIES} database/DataBaseCommunicator.cpp extraction/JpgExtractor.cpp)
ELSE()
@@ -52,7 +87,7 @@ ENDIF()

add_executable(aquamarine main.cpp)

target_link_libraries(aquamarine aquamarine_lib silber-1.0 ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries(aquamarine aquamarine_lib silber-1.1 ${CMAKE_THREAD_LIBS_INIT})
IF (UNIX OR APPLE)
target_link_libraries(aquamarine ${SQLite3_LIBRARIES} ${JPEG_LIBRARIES} )
ENDIF()

0 comments on commit b50b285

Please sign in to comment.