Skip to content

Commit

Permalink
Default external folder is chosen when content is fetched, reporting …
Browse files Browse the repository at this point in the history
…a warning in case that user prefers another place
  • Loading branch information
Epixu committed Sep 11, 2023
1 parent 22e130f commit 74785c6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 0 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@ target_include_directories(LangulusCore INTERFACE source)

message("Compiler: ${CMAKE_CXX_COMPILER_ID} - ${CMAKE_CXX_COMPILER_VERSION}")

if(NOT DEFINED LANGULUS_EXTERNAL_DIRECTORY)
set(LANGULUS_EXTERNAL_DIRECTORY "${CMAKE_SOURCE_DIR}/external" CACHE PATH
"Place where external dependencies will be downloaded and configured")
message(WARNING "LANGULUS_EXTERNAL_DIRECTORY not defined, using default: ${LANGULUS_EXTERNAL_DIRECTORY}")
endif()

if(CMAKE_CXX_FLAGS)
# Make sure trigraphs are disabled
STRING(FIND ${CMAKE_CXX_FLAGS} "/Zc:trigraphs" TRIGRAPHS_ENABLED)
Expand Down
10 changes: 8 additions & 2 deletions LangulusUtilities.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
include(FetchContent)

function(fetch_langulus_module NAME)
if(NOT DEFINED LANGULUS_EXTERNAL_DIRECTORY)
message(FATAL_ERROR "LANGULUS_EXTERNAL_DIRECTORY is not defined")
set(LANGULUS_EXTERNAL_DIRECTORY "${CMAKE_SOURCE_DIR}/external" CACHE PATH
"Place where external dependencies will be downloaded and configured")
message(WARNING "LANGULUS_EXTERNAL_DIRECTORY not defined, using default: ${LANGULUS_EXTERNAL_DIRECTORY}")
endif()

message(STATUS "Fetching external Langulus${NAME}...")
Expand All @@ -18,7 +22,9 @@ endfunction()

function(fetch_external_module NAME GIT_REPOSITORY REPO GIT_TAG TAG)
if(NOT DEFINED LANGULUS_EXTERNAL_DIRECTORY)
message(FATAL_ERROR "LANGULUS_EXTERNAL_DIRECTORY is not defined")
set(LANGULUS_EXTERNAL_DIRECTORY "${CMAKE_SOURCE_DIR}/external" CACHE PATH
"Place where external dependencies will be downloaded and configured")
message(WARNING "LANGULUS_EXTERNAL_DIRECTORY not defined, using default: ${LANGULUS_EXTERNAL_DIRECTORY}")
endif()

message(STATUS "Fetching external library ${NAME}...")
Expand Down

0 comments on commit 74785c6

Please sign in to comment.