How to build an Illustrator C++-Plugin with CMake?
Hi
I'm currently developing a plugin for Illustrator. Because our ecosystem demands it (and for portability reasons) I have to do this on CMake.
I was successful to build a plugin for Mac with CMake, but now I'm struggeling with Windows.
For using an easy plugin, I took the MenuPlay-example from the samples delivered together with the SDK and build it in Visual Studio -> This Plugin was detected by the Illustrator
I then tried to port it to CMake. The build was successful, but Illustrator does not detect the plugin. What am I missing?
This is the CMake-Script:
cmake_minimum_required(VERSION 3.14)
project(MenuPlay)
add_compile_definitions(WIN_ENV=1)
set(CMAKE_AUTOMOC ON)
add_library(${PROJECT_NAME})
add_library(${PROJECT_NAME}::${PROJECT_NAME} ALIAS ${PROJECT_NAME})
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "" SUFFIX ".aip")
target_sources(${PROJECT_NAME} PRIVATE
"Source/MenuPlayID.h"
"Source/MenuPlayPlugin.h"
"Source/MenuPlayPlugin.cpp"
"Source/MenuPlaySuites.h"
"Source/MenuPlaySuites.cpp"
"../common/source/Main.cpp"
"../common/source/Plugin.cpp"
"../common/source/SDKAboutPluginsHelper.cpp"
"../common/source/Suites.cpp"
"Resources/Win/MenuPlay.rc"
)
target_include_directories(${PROJECT_NAME} PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}>)
target_include_directories(${PROJECT_NAME} PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/Source>)
target_include_directories(${PROJECT_NAME} PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/../common/includes>)
target_include_directories(${PROJECT_NAME} PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/../common/win>)
target_include_directories(${PROJECT_NAME} PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/../../illustratorapi/pica_sp>)
target_include_directories(${PROJECT_NAME} PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/../../illustratorapi/illustrator>)
target_include_directories(${PROJECT_NAME} PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/../../illustratorapi/ate>)
foreach(LANG C CXX RC)
set(CMAKE_${LANG}_STANDARD_INCLUDE_DIRECTORIES ${CUSTOM_INCLUDE_DIRECTORIES})
endforeach()
There is no step for building the plugin.pipl-file, I use the one which was generated via the VS-project.
I put this small sample under github:
https://github.com/Voronwe-the-guide/IllustratorPluginCmake
(The illustratorapi itself is not the, because I was unsure whether it is allowed by Adobe to publish it there. If it is ok, I can also upload it
