Archicad C++ API
About Archicad add-on development using the C++ API.

CMake Template for Archicad Add-Ons

Viktor Kovacs
Graphisoft
Graphisoft
We are happy to announce our latest development to make Archicad Add-On developers' life easier — a CMake template for C++ Add-On development.

With this solution you can easily generate IDE projects for Archicad Add-Ons, so you can work in your favorite environment. CMake supports Visual Studio and XCode projects, or you may use Visual Studio Code for development.

You can find detailed instructions on the link below. Please let us know if you have any questions or recommendations.

You can access the CMake template on GitHub:
https://github.com/GRAPHISOFT/archicad-addon-cmake-template
10 REPLIES 10
Jay Chung
Newcomer
Hi,

I'm new to coding and add on development in general

I tried following these steps but when I run the commands in visual studio 17 I get an error message saying my visual studio is missing cmakelists.txt?

How do I fix this issue?

Thanks
Viktor Kovacs
Graphisoft
Graphisoft
You have to run the commands from the root directory of the Add-On.
dushyant
Enthusiast

I am trying to include a sub-folder under Sources/AddOn  which has some header files that I need to include in some CPP files. 

Path to additional header files: Sources/AddOn/SubDir/Include

I tried the following in the CMakeLists.txt:

  1. On line 112, changed GLOB to GLOB_RECURSE
  2. Added another include dir in: files (GLOB AddOnHeaderFiles ... like so:

 

file (GLOB AddOnHeaderFiles
	${AddOnSourcesFolder}/*.h
	${AddOnSourcesFolder}/*.hpp
        ${AddOnSourcesFolder}/SubDir/Include/*.h
)​

 

  • Added include_directories():

 

include_directories("Sources/AddOn/SubDir/Include")​

 

But none of these help cmake include the additional header files in the sub-dir.

For the additional .lib that I need to include, I edited line 171, like so:

 

file (GLOB LibFilesInFolder ${AC_API_DEVKIT_DIR}/Support/Modules/*/*/*.lib ${AddOnSourcesFolder}/SubDir/Lib/*.lib)

 

Please tell what's the right way to include source files in sub-directories under Sources/AddOn.

 

Thanks!

dushyant
Enthusiast

Anyone? Need help with this..

@Viktor Kovacs  , @Tibor Lorantfy ?

LeeJaeYoung
Virtuoso

LeeJaeYoung_1-1675056091785.png

I downloaded the template file and installed it.
But I don't know which file this is.
Is there any way to know?

LeeJaeYoung_0-1675056060145.png

 

AC27 on window 11
dushyant
Enthusiast

Try to open the "archicad-addon-cmake-master" folder as a project in Visual Studio.

Could you please explain a little longer for the translator?

 

1. Can I just click the Create a new project button?

LeeJaeYoung_0-1675070309865.png

 

2. There are choices like the picture above, but I'm asking because I don't know which one it is.
Are you saying to unzip it differently than before and proceed to Open a project or solution?

 

AC27 on window 11

Decompress/Unzip the archicad-addon-cmake-master.zip folder if you downloaded it. Select "Open a local folder" option in VS to open the unzipped folder. Then probably try: Project > CMake Settings.

1

LeeJaeYoung_0-1675079668488.png

LeeJaeYoung_1-1675079697421.png

is this right?

 

1. Strange point Can I go to the support folder at this point?
Doesn't it seem to me that it should be installed on the example?

 

2. Is there anything else I need to set up next?
Can I just proceed as before?

 

AC27 on window 11