Skip to content

Commit

Permalink
igsc: cmake: add option to download dependencies from conan
Browse files Browse the repository at this point in the history
Add option to download dependencies from conan.
Add metee as dependency in conan config.

Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
  • Loading branch information
ausyskin authored and tomasbw committed Jul 1, 2022
1 parent 630ffde commit 103f0c6
Show file tree
Hide file tree
Showing 3 changed files with 927 additions and 1 deletion.
14 changes: 13 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ cmake_minimum_required(VERSION 3.10)
project(igsc C)
set(LICENSE Apache)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_BINARY_DIR}")
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/Modules")

include(version.cmake)
add_definitions(-DIGSC_VERSION=\"${GSC_VERSION_STRING}\")
include(GNUInstallDirs)
include(metee.cmake)

if(NOT WIN32)
option(SYSLOG "Use syslog for logging" ON)
Expand All @@ -21,11 +21,23 @@ option(ENABLE_TESTS "Perform unit tests after build" OFF)
option(ENABLE_WERROR "Enable treat warnings as error" ON)
option(ENABLE_CLI "Enable command line tool build" ON)
option(ENABLE_ENUM "Enable enumeration build" ON)
option(BUILD_SHARED_LIBS "Build shared library" ON)
option (BUILD_USE_CONAN "Use Conan for dependencies download" NO)

include(CMakeDependentOption)
cmake_dependent_option(CLI_ENABLED "Enable command line tool build" ON "ENABLE_ENUM;ENABLE_CLI" OFF)
cmake_dependent_option(TESTS_ENABLED "Perform unit tests after build" ON "ENABLE_ENUM;ENABLE_CLI;ENABLE_TESTS" OFF)

if(BUILD_USE_CONAN)
include(conan)
conan_cmake_autodetect(settings)
# conan.cmake failed to detect MT, force-replace it
string(REPLACE "compiler.runtime=MD" "compiler.runtime=MT" flags "${settings}")
conan_cmake_install(PATH_OR_REFERENCE ${CMAKE_CURRENT_SOURCE_DIR} SETTINGS ${flags})
endif()
message(${CMAKE_MODULE_PATH})
include(metee.cmake)

set(COMPILE_OPTIONS_NX
-Wall
-Wextra
Expand Down
Loading

0 comments on commit 103f0c6

Please sign in to comment.