diff --git a/CMakeLists.txt b/CMakeLists.txt index 38a3db3..ee9c0db 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,6 +8,7 @@ add_compile_options(-Wall -Wextra -Werror) option(WINDOWS "Whether the build target is Windows or not." OFF) option(SHARED "Whether we should build a shared library, instead of a static one." OFF) +option(DEMO "Whether or not the demo should be built." OFF) if (NOT WINDOWS) set(CMAKE_POSITION_INDEPENDENT_CODE ON) @@ -44,3 +45,9 @@ if (STATICC) set(LINKS -static-libgcc -static-libstdc++ -Wl,-Bstatic -lm -lstdc++ -lpthread -Wl,-Bdynamic ${LINKS}) endif(STATICC) target_link_libraries(atomorph ${LINKS}) + +if (DEMO) + file(GLOB_RECURSE DEMO_SRC_FILES "demo/*.cpp") + add_executable(atomorph_demo ${DEMO_SRC_FILES}) + target_link_libraries(atomorph_demo atomorph -lpthread) +endif() \ No newline at end of file diff --git a/demo/main.cpp b/demo/main.cpp index 8a79ef6..e70fd30 100644 --- a/demo/main.cpp +++ b/demo/main.cpp @@ -8,6 +8,7 @@ #include "main.h" #include "lodepng.h" +#include "../src/atomorph.h" MORPH_OPTIONS options; diff --git a/demo/main.h b/demo/main.h index 2d0d77b..15f9097 100644 --- a/demo/main.h +++ b/demo/main.h @@ -3,7 +3,7 @@ * See Copyright Notice at the end of this file. */ -#include "../atomorph.h" +#include "../src/atomorph.h" #include "options.h" bool init (int argc, char **argv);