When I build SFML with CMake I receive both
.dll and
.lib files. This is what I want to do with an own library I am working on but I can't get it to work. Currently only the
.dll files are being generated.
This is my CMakeLists.txt
cmake_minimum_required(VERSION 3.0)
set(project_name dxm)
project(dxm)
file(GLOB source_files "src/*.cpp")
file(GLOB include_files "include/DXM/*.hpp")
add_library(dxm SHARED ${include_files} ${source_files})
My directory tree looks like this
include/
DXM/
Math.hpp
Config.hpp
src/
Math.cpp
CMakeLists.txt
Math.hpp
#include "Config.hpp"
namespace dxm
{
int DXM_API random(int min, int max);
}
Math.cpp
#include "Math.h"
namespace dxm
{
int random(int min, int max)
{
return 3;
}
}
Config.hpp
#pragma once
#define DMX_API __declspec(dllexport)
Why is only a .dll file being generated and not .lib?