Execute conan install command in CMake when conan files not found.
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
This commit is contained in:
parent
cb4e4ca829
commit
be08c4f09d
|
@ -12,15 +12,16 @@ if (WINDOWS)
|
|||
ADD_DEFINITIONS(-D WINDOWS=1)
|
||||
endif(WINDOWS)
|
||||
|
||||
if (EXISTS ${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
|
||||
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
|
||||
conan_basic_setup()
|
||||
else ()
|
||||
message(WARNING "The file conanbuildinfo.cmake doesn't exist, you have to run conan install first")
|
||||
endif ()
|
||||
|
||||
message(STATUS "Using ${CMAKE_CXX_COMPILER}")
|
||||
|
||||
if (NOT EXISTS ${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
|
||||
message(WARNING "The file conanbuildinfo.cmake doesn't exist, running conan install.")
|
||||
execute_process(COMMAND conan install ${CMAKE_SOURCE_DIR} --install-folder=${CMAKE_BINARY_DIR} --build missing)
|
||||
endif ()
|
||||
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
|
||||
conan_basic_setup()
|
||||
|
||||
|
||||
# Create Core library with files in src/Core
|
||||
file(GLOB_RECURSE CORE_SRC_FILES "src/*.cpp" "src/*.hpp")
|
||||
add_library(pkmnLib SHARED ${CORE_SRC_FILES})
|
||||
|
@ -31,12 +32,10 @@ if (NOT DEFINED CONAN_EXPORTED)
|
|||
add_executable(pkmnLibTests ${TEST_FILES} extern/catch.hpp)
|
||||
endif ()
|
||||
|
||||
|
||||
foreach (_variableName ${CONAN_LIBS})
|
||||
message(STATUS "Lib: ${_variableName}")
|
||||
endforeach()
|
||||
|
||||
#target_link_libraries(pkmnLib ${CONAN_LIBS})
|
||||
conan_target_link_libraries(pkmnLib)
|
||||
target_link_libraries(pkmnLibTests pkmnLib)
|
||||
|
||||
|
@ -51,3 +50,5 @@ endif (WINDOWS)
|
|||
# Add a definition for the test library
|
||||
target_compile_definitions(pkmnLibTests PRIVATE TESTS_BUILD)
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue