Commit 9182242e authored by Michaël Roynard's avatar Michaël Roynard

Revert "Put conan install call inside cmake"

This reverts commit b9dcc5c0.
parent b9dcc5c0
Pipeline #1961 passed with stage
in 1 minute and 17 seconds
......@@ -2,6 +2,8 @@ variables:
CC: "gcc" # eg. gcc or clang
CXX: "g++" # eg. g++ or clang++
RELEASE_TYPE: "Release" # default release type
COMPILER_VERSION: "7.3" # version of the compiler
COMPILER_LIBCXX: "libstdc++11" # libcxx with which we link against
CMAKE_GENERATOR: "-G Ninja" # include -G if defined
BUILD_DIRECTORY: "build-in-docker" # build directory name
SOURCE_DIRECTORY: ".." # where cmake search source files from the build directory
......@@ -24,9 +26,14 @@ stages:
- mkdir -p $BUILD_DIRECTORY
- cd $BUILD_DIRECTORY
- if [ "$CLEAN" == "ON" ]; then rm -rf ./*; fi
- conan install ..
--build missing
-s compiler=$CC
-s compiler.version=$COMPILER_VERSION
-s compiler.libcxx=$COMPILER_LIBCXX
-s build_type=$RELEASE_TYPE
- cmake $CMAKE_GENERATOR
-DWITH_TESTS=$TESTS
-DCMAKE_BUILD_TYPE=$RELEASE_TYPE
$SOURCE_DIRECTORY
- cmake --build .
--target $TARGET
......@@ -41,6 +48,7 @@ distcheck-linux-clang-release:
variables:
CC: "clang"
CXX: "clang++"
COMPILER_VERSION: "6.0"
distcheck-linux-gcc-debug:
<<: *distcheck-basic-linux
......@@ -53,3 +61,4 @@ distcheck-linux-clang-debug:
RELEASE_TYPE: "Debug"
CC: "clang"
CXX: "clang++"
COMPILER_VERSION: "6.0"
......@@ -2,20 +2,8 @@ cmake_minimum_required(VERSION 3.8.2) # required for cxx_std_17
project(GTest-constexpr-ext VERSION 0.0.1 LANGUAGES CXX)
# call conan install from cmake for autodetecting libcxx, compiler etc.
if(NOT EXISTS "${CMAKE_BINARY_DIR}/conan.cmake")
message(STATUS "Downloading conan.cmake from https://github.com/conan-io/cmake-conan")
file(DOWNLOAD "https://raw.githubusercontent.com/conan-io/cmake-conan/master/conan.cmake"
"${CMAKE_BINARY_DIR}/conan.cmake")
endif()
include(${CMAKE_BINARY_DIR}/conan.cmake)
# conan dependencies
conan_cmake_run(REQUIRES
gtest/1.8.0@bincrafters/stable
BASIC_SETUP CMAKE_TARGETS
BUILD missing)
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()
SET(COMPILER_CLANG OFF)
SET(COMPILER_GCC OFF)
......
......@@ -3,7 +3,7 @@ set(GTEST_CONSTEXPR_EXT_INCLUDE_DIR "${PROJECT_SOURCE_DIR}/include")
add_library(Gtest-constexpr-ext INTERFACE)
target_compile_features(Gtest-constexpr-ext INTERFACE cxx_std_17)
target_include_directories(Gtest-constexpr-ext INTERFACE ${GTEST_CONSTEXPR_EXT_INCLUDE_DIR})
target_link_libraries(Gtest-constexpr-ext INTERFACE CONAN_PKG::gtest)
target_link_libraries(Gtest-constexpr-ext INTERFACE ${CONAN_LIBS})
# dummy static project not linked anywere needed so that a vcxproj is generated with the sources in the solution
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
......@@ -15,4 +15,4 @@ set_target_properties(Gtest-constexpr-ext_srcs PROPERTIES LINKER_LANGUAGE CXX)
target_compile_features(Gtest-constexpr-ext_srcs PUBLIC cxx_std_17)
target_include_directories(Gtest-constexpr-ext_srcs PUBLIC ${GTEST_CONSTEXPR_EXT_INCLUDE_DIR})
source_group(TREE ${GTEST_CONSTEXPR_EXT_INCLUDE_DIR} FILES ${GTEST_CONSTEXPR_EXT_SOURCES})
target_link_libraries(Gtest-constexpr-ext_srcs PUBLIC CONAN_PKG::gtest)
target_link_libraries(Gtest-constexpr-ext_srcs PUBLIC ${CONAN_LIBS})
......@@ -16,7 +16,7 @@ macro(add_unit_test Executable Source)
target_compile_options(test_${Executable} PRIVATE -Wno-unused-private-field)
endif()
target_link_libraries(Gtest-constexpr-ext INTERFACE CONAN_PKG::gtest)
target_link_libraries(Gtest-constexpr-ext INTERFACE ${CONAN_LIBS})
add_dependencies(tests-compile test_${Executable})
endmacro(add_unit_test)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment