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)
......@@ -3,15 +3,15 @@ project(exple_cmake_build CXX)
option(DOWNLOAD_DEPS ON)
# download dependency 'explelibx_common' or find it locally
# download dependency 'explelibx-common' or find it locally
if (DOWNLOAD_DEPS)
include(FetchContent)
FetchContent_Declare(
explelibx_common
explelibx-common
GIT_REPOSITORY http://tesla.parallel.ru/vonopr/explelibx-common.git
GIT_TAG e45b60782a6414125c7300d9b7a77d34a8404d6e)
FetchContent_MakeAvailable(explelibx_common)
set(COMMON_DIR "${explelibx_common_SOURCE_DIR}")
GIT_TAG 8894a45aa251420fbee723673c8a8d8bf2ac281d)
FetchContent_MakeAvailable(explelibx-common)
set(COMMON_DIR "${explelibx-common_SOURCE_DIR}")
else()
if (NOT DEFINED COMMON_DIR)
file(REAL_PATH "${PROJECT_SOURCE_DIR}/../../explelibx-common" COMMON_DIR)
......@@ -24,15 +24,15 @@ else()
message(" COMMON_DIR: ${COMMON_DIR}")
endif()
# download dependency 'explelibx_mgrid' or find it locally
# download dependency 'explelibx-mgrid' or find it locally
if (DOWNLOAD_DEPS)
include(FetchContent)
FetchContent_Declare(
explelibx_mgrid
explelibx-mgrid
GIT_REPOSITORY http://tesla.parallel.ru/vonopr/explelibx-mgrid.git
GIT_TAG c345859b9ebca2227e3b3faea4cc2380fdbb054f)
FetchContent_MakeAvailable(explelibx_mgrid)
set(GRID_DIR "${explelibx_mgrid_SOURCE_DIR}")
GIT_TAG f8c22c3e0e0c1d3f138ce7cdf08b75fee059f724)
FetchContent_MakeAvailable(explelibx-mgrid)
set(GRID_DIR "${explelibx-mgrid_SOURCE_DIR}")
else()
if (NOT DEFINED GRID_DIR)
file(REAL_PATH "${PROJECT_SOURCE_DIR}/../../explelibx-mgrid" GRID_DIR)
......@@ -48,8 +48,8 @@ endif()
# set paths to 'explelibx-common' sources
set(COMMON_SOURCE_DIR "${COMMON_DIR}/explelibx-common")
set(COMMON_HEADER_DIR "${COMMON_DIR}/explelibx-common")
set(COMMON_SOURCES exple-add.cpp)
set(COMMON_HEADERS exple-add.h)
set(COMMON_SOURCES exple-add.cpp exple-substract.cpp)
set(COMMON_HEADERS exple-add.h exple-substract.h)
list(TRANSFORM COMMON_SOURCES PREPEND "${COMMON_SOURCE_DIR}/")
list(TRANSFORM COMMON_HEADERS PREPEND "${COMMON_HEADER_DIR}/")
......@@ -70,7 +70,7 @@ list(TRANSFORM CURRENT_SOURCES PREPEND "${SOURCE_DIR}/")
list(TRANSFORM CURRENT_HEADERS PREPEND "${HEADER_DIR}/")
# set targets
add_executable(exple_add_numbers
add_executable(exple-add-numbers
"${CURRENT_SOURCES}"
"${CURRENT_HEADERS}"
"${COMMON_SOURCES}"
......@@ -78,9 +78,7 @@ add_executable(exple_add_numbers
"${GRID_SOURCES}"
"${GRID_HEADERS}") # headers should be explicitly added to the target to be shown in IDEs after mentioned in source_group()
# if using Visual Studio switch to project's target representation
set_property(TARGET exple_add_numbers PROPERTY OUTPUT_NAME "exple-add-numbers")
target_include_directories(exple_add_numbers PRIVATE
target_include_directories(exple-add-numbers PRIVATE
"${HEADER_DIR}"
"${COMMON_HEADER_DIR}"
"${GRID_HEADER_DIR}")
......
#include "exple-add.h"
#include "exple-mul.h"
#include "exple-substract.h"
namespace exple
{
int add_and_mul( int a, int b, int c);
int add_and_sub( int a, int b, int c);
}
int exple::add_and_mul( int a, int b, int c)
{
return exple::mul(exple::add(a, b), c);
}
int exple::add_and_sub( int a, int b, int c)
{
return exple::mul(exple::substract(a, b), c);
}
......@@ -8,7 +8,8 @@ int main()
int a = 2;
int b = 3;
int c = 4;
printf("Multiplication of sum of %i and %i by %i is... %i", a, b, c, exple::add_and_mul(2, 3, 4));
printf("Multiplication of sum of %i and %i by %i is... %i\n", a, b, c, exple::add_and_mul(2, 3, 4));
printf("Multiplication of substraction of %i and %i by %i is... %i\n", a, b, c, exple::add_and_sub(2, 3, 4));
return 0;
}