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,14 +12,15 @@ if (WINDOWS)
|
||||||
ADD_DEFINITIONS(-D WINDOWS=1)
|
ADD_DEFINITIONS(-D WINDOWS=1)
|
||||||
endif(WINDOWS)
|
endif(WINDOWS)
|
||||||
|
|
||||||
if (EXISTS ${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
|
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)
|
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
|
||||||
conan_basic_setup()
|
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}")
|
|
||||||
|
|
||||||
# Create Core library with files in src/Core
|
# Create Core library with files in src/Core
|
||||||
file(GLOB_RECURSE CORE_SRC_FILES "src/*.cpp" "src/*.hpp")
|
file(GLOB_RECURSE CORE_SRC_FILES "src/*.cpp" "src/*.hpp")
|
||||||
|
@ -31,12 +32,10 @@ if (NOT DEFINED CONAN_EXPORTED)
|
||||||
add_executable(pkmnLibTests ${TEST_FILES} extern/catch.hpp)
|
add_executable(pkmnLibTests ${TEST_FILES} extern/catch.hpp)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
|
||||||
foreach (_variableName ${CONAN_LIBS})
|
foreach (_variableName ${CONAN_LIBS})
|
||||||
message(STATUS "Lib: ${_variableName}")
|
message(STATUS "Lib: ${_variableName}")
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
#target_link_libraries(pkmnLib ${CONAN_LIBS})
|
|
||||||
conan_target_link_libraries(pkmnLib)
|
conan_target_link_libraries(pkmnLib)
|
||||||
target_link_libraries(pkmnLibTests pkmnLib)
|
target_link_libraries(pkmnLibTests pkmnLib)
|
||||||
|
|
||||||
|
@ -51,3 +50,5 @@ endif (WINDOWS)
|
||||||
# Add a definition for the test library
|
# Add a definition for the test library
|
||||||
target_compile_definitions(pkmnLibTests PRIVATE TESTS_BUILD)
|
target_compile_definitions(pkmnLibTests PRIVATE TESTS_BUILD)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue