cmake - How to set BUILD_SHARED_LIBS for included directory -
I have a very basic cement project that uses Google Test, I want to make it as DLL and CMeCelist's TATT file gate indicates that in order to create GITE as a shared library, you have to set My problem is that I can not understand how to set up Below is my CMakeLists.txt. I would appreciate the suggestions on how to set it up BUILD_SHARED_LIBS. Google tests will only be created as Shared Library (DLL) if BUILD_SHARED_LIBS is set. That's why I call it this CMKL list. I want to set in the file. I know how my own library has been shared, but I did not know how to set that variable so that the guest CMakeLists.txt file sees it. in your code for this line above BUILD_SHARED_LIBS .
BUILD_SHARED_LIBS to show that if I set the value in the cache using Sentake-Gaya I actually see the Generated Build attempt to make DLL.
CMAKE_MINIMUM_REQUIRED (VERSION 3.0 FATAL_ERROR) Project (MyProj) SET (BUILD_SHARED_LIBS on) ADD_EXECUTABLE (MyProj main.cpp) ADD_LIBRARY (MyLib STATIC mylib .CPP) TARGET_LINK_LIBRARIES (MyProj MyLib) ADD_SUBDIRECTORY (gtest-1.7 .0)
ADD_LIBRARY (MyLib STATIC mylib.cpp) // your code STATIC Lib
ADD_LIBRARY (MyLib SHARED mylib.cpp) // Shared Libs Added
Comments
Post a Comment