I have the project with many subprojects, and one of them is google test project.
I must build google test library as shared library every time when I build the main project, but single way to build the google test as shared is setting global option "BUILD_SHARED_LIBS=ON
". Unfortunately, other projects are depended of this option. So, how to build google test as shared library in this case?
I tried to replace
cxx_library(gtest "${cxx_strict}" src/gtest-all.cc)
cxx_library(gtest_main "${cxx_strict}" src/gtest_main.cc)
with
add_library(gtest SHARED src/gtest-all.cc)
add_library(gtest_main "SHARED src/gtest_main.cc)
but it is no effect.