Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
GhazanfarShahbaz committed Jun 20, 2024
1 parent aeb3bc1 commit c1157b4
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 17 deletions.
49 changes: 32 additions & 17 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,24 +1,39 @@
cmake_minimum_required(VERSION 3.23)
project(TokenGranterWrapper)
# cmake_minimum_required(VERSION 3.23)
# project(TokenGranterWrapperBindings)

set(CMAKE_CXX_STANDARD 17)
# set(CMAKE_CXX_STANDARD 17)

# set(CURL_LIBRARY "-lcurl")
# find_package(CURL REQUIRED)

# # add_executable(token_granter src/token_granter.cpp)
# # target_include_directories(token_granter PRIVATE ${CURL_INCLUDE_DIRS})
# # target_link_libraries(token_granter ${CURL_LIBRARIES})

# # SHARED LIBRARY COMPILATION HERE
# add_library(token_granter_shared SHARED ./lib/src/token_granter.cpp)
# target_link_libraries(token_granter_shared ${CURL_LIBRARIES})
# target_link_libraries(token_granter_shared ${CURL_LIBRARIES})

set(CURL_LIBRARY "-lcurl")
find_package(CURL REQUIRED)

# add_executable(token_granter src/token_granter.cpp)
# target_include_directories(token_granter PRIVATE ${CURL_INCLUDE_DIRS})
# target_link_libraries(token_granter ${CURL_LIBRARIES})
# # PYBINDING SHARED LIBRARY COMPILATION HERE
# add_subdirectory(./lib/include/pybind11)
# pybind11_add_module(token_granter ./token_granter_wrapper/token_granter_bindings.cpp ./lib/src/token_granter.cpp)
# set_target_properties(token_granter PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/token_granter_wrapper)
# target_link_libraries(token_granter PRIVATE pybind11::module)
# target_link_libraries(token_granter PRIVATE ${CURL_LIBRARIES})

# SHARED LIBRARY COMPILATION HERE
add_library(token_granter_shared SHARED ./lib/src/token_granter.cpp)
target_link_libraries(token_granter_shared ${CURL_LIBRARIES})
target_link_libraries(token_granter_shared ${CURL_LIBRARIES})
cmake_minimum_required(VERSION 3.23)
project(TokenGranterWrapperBindings)
set(CMAKE_CXX_STANDARD 17)


# PYBINDING SHARED LIBRARY COMPILATION HERE
add_subdirectory(./lib/include/pybind11)
pybind11_add_module(token_granter ./token_granter_wrapper/token_granter_bindings.cpp ./lib/src/token_granter.cpp)
set_target_properties(token_granter PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/token_granter_wrapper)
target_link_libraries(token_granter PRIVATE pybind11::module)
target_link_libraries(token_granter PRIVATE ${CURL_LIBRARIES})
add_subdirectory(./lib/src)


set(SOURCE_DIR "token_granter_wrapper")
set(SOURCES "${SOURCE_DIR}/token_granter_bindings.cpp")

pybind11_add_module(token_granter_bindings ${SOURCES})
target_link_libraries(token_granter_bindings PRIVATE token_granter_wrapper)
11 changes: 11 additions & 0 deletions lib/src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
cmake_minimum_required(VERSION 3.23)
project(TokenGranterWrapper)

set(CMAKE_CXX_STANDARD 17)

set(CURL_LIBRARY "-lcurl")
find_package(CURL REQUIRED)

add_library(token_granter_wrapper STATIC token_granter.cpp)

target_link_libraries(token_granter_wrapper ${CURL_LIBRARIES})

0 comments on commit c1157b4

Please sign in to comment.