Skip to content

Instantly share code, notes, and snippets.

@cjhanks
Created February 21, 2018 19:26
Show Gist options
  • Save cjhanks/a4a2363400a2da48cf7519cae84eca4a to your computer and use it in GitHub Desktop.
Save cjhanks/a4a2363400a2da48cf7519cae84eca4a to your computer and use it in GitHub Desktop.
Beginning attempt at nim and cmakelist.
# vim: ts=2 sw=2 et ai tw=80
CMAKE_MINIMUM_REQUIRED(VERSION 3.9)
FILE(GLOB NIM_SOURCES "*.nim")
ADD_CUSTOM_COMMAND(
OUTPUT
libtest.a
COMMAND
nim c --app:staticlib -o:libtest.a $(SOURCES)
DEPENDS
${NIM_SOURCES}
)
FILE(GLOB CPP_SOURCES "*.cc")
ADD_LIBRARY(
shared
SHARED
${CPP_SOURCES}
)
LINK_DIRECTORIES(${CMAKE_SOURCE_DIR})
TARGET_LINK_LIBRARIES(
shared
libtest.a
)
ADD_DEPENDENCIES(
shared
libtest.a
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment