Open isabelgk opened 1 year ago
For now, how I'd do it something like this in your external's CMakeLists.txt. I haven't tested this exact set up, but I've done it similarly to this in the past.
cmake_minimum_required(VERSION 3.0)
set(C74_MIN_API_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../min-api)
include(${C74_MIN_API_DIR}/script/min-pretarget.cmake)
include_directories(
"${C74_INCLUDES}"
)
set( SOURCE_FILES
${PROJECT_NAME}.cpp
)
add_library(
${PROJECT_NAME}
MODULE
${SOURCE_FILES}
)
# ====== see this section
# /
# v
if (MSVC)
# include any headers needed by your library that's kept at <repository root>/libs/include,
# and you can change for your situation
include_directories("${CMAKE_SOURCE_DIR}/libs/include")
# this links to a library that's kept at <repository root>/libs/foo.lib, and you can change for your situation
target_link_libraries(${PROJECT_NAME} PUBLIC "${CMAKE_SOURCE_DIR}/libs/foo.lib")
endif()
include(${C74_MIN_API_DIR}/script/min-posttarget.cmake)
Originally posted by @scblakely in https://github.com/Cycling74/min-devkit/issues/204#issuecomment-1437506468