Skip to content

Instantly share code, notes, and snippets.

@StanleyGoldman
StanleyGoldman / CMakeLists.txt
Last active March 27, 2025 14:53
Using swig_add_library in cmake
cmake_minimum_required(VERSION 3.21)
project(codebase_wrapper LANGUAGES CXX)
find_package(SWIG REQUIRED)
include(${SWIG_USE_FILE})
include_directories(${CMAKE_SOURCE_DIR})
set(SOURCES codebase_wrapper.i codebase.c)
set_property(SOURCE codebase_wrapper.i PROPERTY CPLUSPLUS ON)