Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove ExternalProject dependency #35

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 1 addition & 26 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,30 +47,6 @@ endif()
# External libraries
find_package(OpenSSL 1.1 REQUIRED)

# gsl-lite fetched from GitHub
include( ExternalProject )
find_package( Git REQUIRED )
set( GSL_LITE_URL https://github.com/gsl-lite/gsl-lite.git )
set_directory_properties( PROPERTIES EP_PREFIX ${CMAKE_BINARY_DIR}/third_party )

ExternalProject_Add(
gsl-extern
GIT_REPOSITORY ${GSL_LITE_URL}
TIMEOUT 10
UPDATE_COMMAND ${GIT_EXECUTABLE} pull
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
LOG_DOWNLOAD ON
)

ExternalProject_Get_Property( gsl-extern SOURCE_DIR )
set( GSL_LITE_INCLUDE_DIR ${SOURCE_DIR}/include CACHE INTERNAL "Include folder for gsl-lite" )

add_library( gsl INTERFACE )
add_dependencies(gsl gsl-extern)
target_include_directories( gsl INTERFACE ${GSL_LITE_INCLUDE_DIR} )

###
### Library Config
###
Expand All @@ -81,8 +57,7 @@ file(GLOB_RECURSE LIB_HEADERS CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/inc
file(GLOB_RECURSE LIB_SOURCES CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp")

add_library(${LIB_NAME} ${LIB_HEADERS} ${LIB_SOURCES})
add_dependencies(${LIB_NAME} gsl)
target_link_libraries(${LIB_NAME} PRIVATE gsl OpenSSL::Crypto)
target_link_libraries(${LIB_NAME} PRIVATE OpenSSL::Crypto)
target_include_directories(${LIB_NAME}
PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
Expand Down
Loading