| 1 |
include(CheckCXXSourceCompiles) |
| 2 |
|
| 3 |
set(SOURCES squigglevision.cpp) |
| 4 |
set(TARGET squigglevision) |
| 5 |
|
| 6 |
if(MSVC) |
| 7 |
set(SOURCES ${SOURCES} ${FREI0R_DEF}) |
| 8 |
endif() |
| 9 |
|
| 10 |
add_library(${TARGET} MODULE ${SOURCES}) |
| 11 |
set_target_properties(${TARGET} PROPERTIES PREFIX "") |
| 12 |
|
| 13 |
# multithreading based on the kaleid0sc0pe filter: std::async over row bands, |
| 14 |
# with a serial fallback where std::future is unavailable. |
| 15 |
if(NOT WIN32) |
| 16 |
set(THREADS_PREFER_PTHREAD_FLAG ON) |
| 17 |
find_package(Threads REQUIRED) |
| 18 |
target_link_libraries(${TARGET} PRIVATE Threads::Threads) |
| 19 |
endif() |
| 20 |
|
| 21 |
check_cxx_source_compiles(" |
| 22 |
#include <future> |
| 23 |
int main() { std::future<void> f; return 0; }" HAS_WORKING_FUTURE) |
| 24 |
if(NOT HAS_WORKING_FUTURE) |
| 25 |
target_compile_definitions(${TARGET} PRIVATE NO_FUTURE) |
| 26 |
endif() |
| 27 |
|
| 28 |
install(TARGETS ${TARGET} LIBRARY DESTINATION ${LIBDIR}) |