2020-07-18 10:42:54 +00:00
|
|
|
function(SetupConan)
|
|
|
|
# If conan isn't set up yet, we need to install the dependencies.
|
|
|
|
if (NOT EXISTS ${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
|
|
|
|
message(WARNING "The file conanbuildinfo.cmake doesn't exist, running conan install.")
|
|
|
|
|
|
|
|
# If we're linking C statically, we also want to do so for our dependencies.
|
|
|
|
set(CONAN_STATIC_C False)
|
|
|
|
if (STATICC)
|
|
|
|
set(CONAN_STATIC_C True)
|
|
|
|
endif (STATICC)
|
|
|
|
|
|
|
|
if (NOT WINDOWS)
|
|
|
|
execute_process(COMMAND conan install ${CMAKE_SOURCE_DIR} --install-folder=${CMAKE_BINARY_DIR} --build outdated
|
2020-07-18 10:48:41 +00:00
|
|
|
-s compiler=clang -s compiler.libcxx=libstdc++11 -o *:staticC=${CONAN_STATIC_C} -o AngelScript:link_std_statically=True)
|
2020-07-18 10:42:54 +00:00
|
|
|
else ()
|
|
|
|
execute_process(COMMAND conan install ${CMAKE_SOURCE_DIR} --install-folder=${CMAKE_BINARY_DIR} --build outdated
|
2020-07-18 10:48:41 +00:00
|
|
|
-s compiler=gcc -s compiler.libcxx=libstdc++11 -s os=Windows -o *:staticC=${CONAN_STATIC_C} -o AngelScript:link_std_statically=True)
|
2020-07-18 10:42:54 +00:00
|
|
|
endif ()
|
|
|
|
endif ()
|
|
|
|
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
|
|
|
|
conan_basic_setup()
|
|
|
|
endfunction()
|