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 BUILD_SHARED_LIBS . My problem is that I can not understand how to set up 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. Below is my CMakeLists.txt. I would appreciate the suggestions on how to set it up BUILD_SHARED_LIBS. 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) 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...