-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from jchristopherson/v1.0.3
V1.0.3
- Loading branch information
Showing
24 changed files
with
237 additions
and
217 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,18 @@ | ||
# Get the macros and functions we'll need | ||
include("${PROJECT_SOURCE_DIR}/cmake/helper.cmake") | ||
include(FetchContent) | ||
|
||
# If found, us the installed version; else, import the library | ||
if (ferror_FOUND) | ||
# Inform the user of what's going on | ||
message(STATUS "FERROR (${ferror_VERSION}) library found.") | ||
# Fetch the proper content | ||
FetchContent_Declare( | ||
ferror | ||
GIT_REPOSITORY "https://github.com/jchristopherson/ferror" | ||
) | ||
FetchContent_MakeAvailable(ferror) | ||
|
||
# Get the mod file location | ||
get_target_property(ferror_INCLUDE_DIR ferror INTERFACE_INCLUDE_DIRECTORIES) | ||
else() | ||
# Inform the user of what's going on | ||
message(STATUS "FERROR library not found. Downloading appropriate repository.") | ||
|
||
# Fetch the proper content | ||
FetchContent_Declare( | ||
ferror | ||
GIT_REPOSITORY "https://github.com/jchristopherson/ferror" | ||
OVERRIDE_FIND_PACKAGE | ||
) | ||
|
||
FetchContent_MakeAvailable(ferror) | ||
|
||
if (WIN32) | ||
if (BUILD_SHARED_LIBS) | ||
add_custom_command( | ||
TARGET ${PROJECT_NAME} POST_BUILD | ||
COMMAND ${CMAKE_COMMAND} -E copy_if_different | ||
$<TARGET_FILE:ferror> | ||
$<TARGET_FILE_DIR:${PROJECT_NAME} | ||
) | ||
endif() | ||
endif() | ||
|
||
set(ferror_INCLUDE_DIR ${ferror_BINARY_DIR}/include) | ||
endif() | ||
|
||
# Make a parent-scope variable for the library | ||
set(ferror_INCLUDE_DIR ${ferror_BINARY_DIR}/include) | ||
configure_file( | ||
"${ferror_SOURCE_DIR}/include/ferror.h" | ||
"${ferror_INCLUDE_DIR}/ferror.h" | ||
COPYONLY | ||
) | ||
set(ferror_LIBRARY ferror) | ||
set(ferror_INCLUDE_DIR ${ferror_INCLUDE_DIR} PARENT_SCOPE) | ||
set(ferror_LIBRARY ${ferror_LIBRARY} PARENT_SCOPE) | ||
|
||
# Make a parent-scope variable locating the include directory for ferror | ||
set(ferror_INCLUDE_DIR ${ferror_INCLUDE_DIR} PARENT_SCOPE) |
Oops, something went wrong.