Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed build issues when building in "getting_started" dir #662

Merged
merged 2 commits into from
Apr 27, 2022

Conversation

achristoforides
Copy link
Member

@achristoforides achristoforides commented Apr 25, 2022

Fixes #646

Also fixes #625

Signed-off-by: The MathWorks, Inc. alchrist@mathworks.com

Fixes #646

Signed-off-by: The MathWorks, Inc. <alchrist@mathworks.com>
@codecov-commenter
Copy link

codecov-commenter commented Apr 26, 2022

Codecov Report

Merging #662 (80286a3) into development (7364c9a) will decrease coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@               Coverage Diff               @@
##           development     #662      +/-   ##
===============================================
- Coverage        90.49%   90.48%   -0.02%     
===============================================
  Files              249      249              
  Lines            13483    13478       -5     
===============================================
- Hits             12202    12195       -7     
- Misses            1281     1283       +2     
Impacted Files Coverage Δ
...include/cppmicroservices/detail/TrackedService.tpp 85.00% <0.00%> (-1.67%) ⬇️
...rativeServices/src/metadata/MetadataParserImpl.cpp 90.96% <0.00%> (-0.65%) ⬇️
.../ConfigurationAdmin/src/ConfigurationAdminImpl.cpp 92.93% <0.00%> (-0.04%) ⬇️
...ervices/src/manager/ComponentConfigurationImpl.cpp 97.33% <0.00%> (-0.02%) ⬇️

Comment on lines 11 to 26
# Detect "local" build (build from getting started directory)
if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
set(IS_LOCAL_BUILD ON)
endif()

if (IS_LOCAL_BUILD)
# Set binary and library output directories
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")

set(BUILD_SHARED_LIBS ON CACHE BOOL "Build shared libraries")
set(US_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})

set(CMAKE_ENABLE_EXPORTS ON)
endif()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the IS_LOCAL_BUILD variable needed? can't it be one if statement?

if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
  # Set binary and library output directories
  set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
  set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
  set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")

  set(BUILD_SHARED_LIBS ON CACHE BOOL "Build shared libraries")
  set(US_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})

  set(CMAKE_ENABLE_EXPORTS ON)
endif()

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It’s not.

@achristoforides achristoforides merged commit 47a3f92 into development Apr 27, 2022
@achristoforides achristoforides deleted the 646-build-fix branch April 27, 2022 21:49
insi-eb pushed a commit to insi-eb/CppMicroServices-cpp14 that referenced this pull request Oct 5, 2022
…rvices#662)

* Fixed build issues when building in "getting_started" dir

Fixes CppMicroServices#646

Signed-off-by: The MathWorks, Inc. <alchrist@mathworks.com>

* Made changes requested by reviewer
jeffdiclemente pushed a commit that referenced this pull request Oct 5, 2022
* Fixed build issues when building in "getting_started" dir

Fixes #646

Signed-off-by: The MathWorks, Inc. <alchrist@mathworks.com>

* Made changes requested by reviewer

Co-authored-by: Alexander Christoforides <38366659+achristoforides@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants