feat: v1.3-konforme API, HTTP-Fixes, Base64, Example erweitert; Makefile & README Setup
This commit is contained in:
@ -3,23 +3,25 @@ project(PrivateBinAPIExample)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
|
||||
# Find the privatebinapi library
|
||||
find_library(PRIVATEBINAPI_LIB privatebinapi
|
||||
PATHS ${CMAKE_CURRENT_SOURCE_DIR}/../build)
|
||||
# Use the prebuilt library from the parent build directory
|
||||
set(PRIVATEBINAPI_BUILD_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../build")
|
||||
set(PRIVATEBINAPI_RELEASE_LIB "${PRIVATEBINAPI_BUILD_DIR}/Release/privatebinapi.lib")
|
||||
|
||||
# If not found, build it as part of the project
|
||||
if(NOT PRIVATEBINAPI_LIB)
|
||||
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/.. ${CMAKE_CURRENT_BINARY_DIR}/privatebinapi)
|
||||
set(PRIVATEBINAPI_LIB privatebinapi)
|
||||
if(EXISTS "${PRIVATEBINAPI_RELEASE_LIB}")
|
||||
set(PRIVATEBINAPI_LIB "${PRIVATEBINAPI_RELEASE_LIB}")
|
||||
else()
|
||||
# Fallback: try the build root (multi-config generators may place libs differently)
|
||||
find_library(PRIVATEBINAPI_LIB privatebinapi PATHS "${PRIVATEBINAPI_BUILD_DIR}")
|
||||
endif()
|
||||
|
||||
if(NOT PRIVATEBINAPI_LIB)
|
||||
message(FATAL_ERROR "privatebinapi library not found. Please run build.bat in the project root first.")
|
||||
endif()
|
||||
|
||||
# Create example executable
|
||||
add_executable(example example.cpp)
|
||||
|
||||
# Link with the privatebinapi library
|
||||
target_link_libraries(example ${PRIVATEBINAPI_LIB})
|
||||
target_link_libraries(example PRIVATE ${PRIVATEBINAPI_LIB} winhttp)
|
||||
|
||||
# Include directories
|
||||
target_include_directories(example PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../include
|
||||
)
|
||||
Reference in New Issue
Block a user