These are chat archives for ChaiScript/ChaiScript

19th
Dec 2018
vocaviking
@vocaviking
Dec 19 2018 09:55
Hi, I'm trying to import chaiscript using cmake, but I can't get the header files to work properly. Right now I'm doing it this way:
cmake_minimum_required(VERSION 3.1...3.11)
project(ace VERSION 5.0.0)
...
add_subdirectory(lib/ChaiScript/)
target_link_libraries(ace PRIVATE chaiscript)
What do I have to do to make this compile?
Arthur Brainville
@Ybalrid
Dec 19 2018 10:03
I use either include_directoires or target_include_directories for Chai. As it’s just a folder with a bunch of headers. Therés nothing to link against
« Link libraries » functions are for linking to .a, .lib, .so filles to your target. Nothing to do with headers.
vocaviking
@vocaviking
Dec 19 2018 10:10
Sure. However, that's the recommendation I found for including proper cmake projects... add_subdirectory and link against it
This helps you to include chaiscript into several projects depending on it, without duplicating the code. (Something I actually would need.)
StanEpp
@StanEpp
Dec 19 2018 11:13

I do it in my project like this:
Add an external_project
https://github.com/StanEpp/ChaiDwarfs/blob/master/deps/CMakeLists.txt#L221

Just add it as a dependency to the project
https://github.com/StanEpp/ChaiDwarfs/blob/master/CMakeLists.txt#L115

As @Ybalrid already said there's nothing to link against. You just include the header files and are good to go.

I hope the code helps. Unfortunately I haven't touched the project in a while
Oliver Dain
@oliverdain
Dec 19 2018 17:59
Hey - just posted a question on the forums (http://discourse.chaiscript.com/t/chaiscript-array-of-objects-without-copy-constructor/415) and then discovered there's a chat channel too! Hoping I can get a quicker answer here as I'm kinda stuck right now. Any help would be greatly appreciated.