My project Test4
contains two files named:
Structure.h
Structure.c
I am using this project to create a static library that can be used by other software projects.
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 the Test4
project using the CMake configuration file above, no static library is generated. It seems as if nothing happens. Does anyone know what I am doing wrong?
My IDE is JetBrains CLion.
I had same issue. What I missed is the location where build files are created.
CLion makes libraries or exectables under cmake-build-*
directory. IfBuild, Execution, Deployment > CMake > Configuration
is Debug
, the lib file (.a
) is created under cmake-build-debug
.