I'm developing an application in C ++, where I need to use a library I've developed before with CMake. But I do not want to call the binary directly because each platform will have to have a binary separately, and it's annoying to have to compile each one to later compile the project, my question is this, you can call CMake from my other project to compile the dependency to then compile this new project already linking dependency? If so, how will I do this miracle? Project that I want to use link . CMake the new project that will use this above:
cmake_minimum_required(VERSION 3.4)
project(DataBase)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(SOURCE_FILES main.cpp DataBase.cpp DataBase.h String.h libString.a)
add_executable(DataBase ${SOURCE_FILES})