Created
February 21, 2018 19:26
-
-
Save cjhanks/a4a2363400a2da48cf7519cae84eca4a to your computer and use it in GitHub Desktop.
Beginning attempt at nim and cmakelist.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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