-
Notifications
You must be signed in to change notification settings - Fork 257
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
Conversation
Fixes #646 Signed-off-by: The MathWorks, Inc. <alchrist@mathworks.com>
Codecov Report
@@ 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
|
# 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() |
There was a problem hiding this comment.
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()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It’s not.
…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
* 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>
Fixes #646
Also fixes #625
Signed-off-by: The MathWorks, Inc. alchrist@mathworks.com