Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • develop
  • doc-conf-compiler
  • fix-test-issue
  • main
  • v0.0.1
5 results

Target

Select target project
  • vonopr/exple-cmake-build
1 result
Select Git revision
  • develop
  • doc-conf-compiler
  • fix-test-issue
  • main
  • v0.0.1
5 results
Show changes
Commits on Source (3)
  • Vladimir Onoprienko's avatar
    Fix bug · 37ffc42b
    Vladimir Onoprienko authored
    Automatic download of dependencies is considered to be the default
    behavior when building the project according to README.md.
    
    However, the automatic download is not enabled by default now due to
    the mistake in syntax of option() command in CMakeLists.txt.
    
    This commit fixes the bug.
    37ffc42b
  • Vladimir Onoprienko's avatar
    Add a config file · ac552c6a
    Vladimir Onoprienko authored
    Provide an example of how to copy non-source files into build
    directory.
    ac552c6a
  • Vladimir Onoprienko's avatar
    Add cmake cache variables to configure remote deps · 537ff20a
    Vladimir Onoprienko authored
    The main reason of this change is to place URLs and Git Tags of remote
    dependencies at the top of CMakeLists.txt
    
    Another outсome is that the user will be able to adjust these settings
    easily.
    537ff20a
cmake_minimum_required(VERSION 3.14)
project(exple_cmake_build CXX)
option(DOWNLOAD_DEPS ON)
option(DOWNLOAD_DEPS "Enable automatic download of dependencies" ON)
set(COMMON_LIB_URL "http://tesla.parallel.ru/vonopr/explelibx-common.git"
CACHE STRING "Git repository URL of the downloaded 'explelibx-common' dependency; used if DOWNLOAD_DEPS enabled")
set(COMMON_LIB_TAG "e45b60782a6414125c7300d9b7a77d34a8404d6e"
CACHE STRING "Specify the branch name, tag name or commit hash of the downloaded 'explelibx-common' dependency; used if DOWNLOAD_DEPS enabled")
set(GRID_LIB_URL "http://tesla.parallel.ru/vonopr/explelibx-mgrid.git"
CACHE STRING "Git repository URL of the downloaded 'explelibx-mgrid' dependency; used if DOWNLOAD_DEPS enabled")
set(GRID_LIB_TAG "c345859b9ebca2227e3b3faea4cc2380fdbb054f"
CACHE STRING "Specify the branch name, tag name or commit hash of the downloaded 'explelibx-mgrid' dependency; used if DOWNLOAD_DEPS enabled")
# download dependency 'explelibx_common' or find it locally
if (DOWNLOAD_DEPS)
include(FetchContent)
FetchContent_Declare(
explelibx_common
GIT_REPOSITORY http://tesla.parallel.ru/vonopr/explelibx-common.git
GIT_TAG e45b60782a6414125c7300d9b7a77d34a8404d6e)
GIT_REPOSITORY "${COMMON_LIB_URL}"
GIT_TAG "${COMMON_LIB_TAG}")
FetchContent_MakeAvailable(explelibx_common)
set(COMMON_DIR "${explelibx_common_SOURCE_DIR}")
else()
......@@ -29,8 +39,8 @@ if (DOWNLOAD_DEPS)
include(FetchContent)
FetchContent_Declare(
explelibx_mgrid
GIT_REPOSITORY http://tesla.parallel.ru/vonopr/explelibx-mgrid.git
GIT_TAG c345859b9ebca2227e3b3faea4cc2380fdbb054f)
GIT_REPOSITORY "${GRID_LIB_URL}"
GIT_TAG "${GRID_LIB_TAG}")
FetchContent_MakeAvailable(explelibx_mgrid)
set(GRID_DIR "${explelibx_mgrid_SOURCE_DIR}")
else()
......@@ -85,6 +95,10 @@ target_include_directories(exple_add_numbers PRIVATE
"${COMMON_HEADER_DIR}"
"${GRID_HEADER_DIR}")
add_custom_command(TARGET exple_add_numbers POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
"${PROJECT_SOURCE_DIR}/exple-cmake-build/config-examples" "$<TARGET_FILE_DIR:exple_add_numbers>/config-examples")
# set groups for better source representation in IDEs
source_group("Common\\Sources" FILES "${COMMON_SOURCES}")
......
#This is a config file
\ No newline at end of file