I have never worked with CMake before, so please forgive any rookie mistakes. Most of the following working frame has been given to me by my project group. The goal is to build GoogleTest into a .dll, to be used in different, indepentent parts of our project. I'm having troubles setting up CMake the right way.
The work-flow so far has been:
- Clone gtest from git --> also downloads a CMake List file
- Alter variables in
CMakeCache.txtto have it produce a Code::Blocks project file - Compile the project file in Code::Blocks
So far, it produces a static library (.a files) that can be used in our project. I'm having troubles genereating .dll files. Variables I have tried changing:
BUILD_SHARED_LIBS:BOOL=ON--> the files generated by Code::Blocks now have a .dll.a double extensionCMAKE_C_FLAGSand all the corresponding C++ flags where set to-DGTEST_CREATE_SHARED_LIBRARY=1as given hereCMAKE_EXE_LINKER_FLAGShas been set to-sharedto make the linker produce .dll files
I have worked my way through the GoogleTest documentation here and here but in both, building it into a .dll is merely a 2-sentence-topic.