CMake - Creating a static library
build, c, c++, clion, cmake
Solution
I had same issue. What I missed is the location where build files are created.
CLion makes libraries or exectables under `cmake-build-*` directory. If`Build, Execution, Deployment > CMake > Configuration` is `Debug`, the lib file (`.a`) is created under `cmake-build-debug`.
Problem
I have two files in my project called `Test4`: `Structure.h` `Structure.c` I want to create a static library that can be loaded by other projects who want to use those files. Here is my CMake file currently: ``` cmake_minimum_required(VERSION 3.6) project(Test4) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") set(SOURCE_FILES Structure.c Structure.h) add_library(Test4 STATIC ${SOURCE_FILES}) ``` When I build using that CMake file, no static library is generated. Nothing happens. Am I doing something wrong? I am using the CLion IDE.