void-packages/srcpkgs/waifu2x-converter-cpp/patches/fix-cross.patch
2019-01-25 23:38:28 -02:00

30 lines
773 B
Diff

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 12884cc..6139ae2 100644
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -36,7 +36,14 @@ if(UNIX OR MINGW)
set(FILE_SYSTEM_LIB "stdc++fs")
endif()
-add_executable(conv conv.c)
+add_custom_target("conv")
+add_custom_command(
+ OUTPUT "build/conv"
+ COMMAND cc
+ ARGS -o conv conv.c
+ DEPENDS "build/conv"
+ COMMENT "Generator"
+)
if(UNIX)
set(OPENCV_PREFIX "/usr" CACHE FILEPATH "OpenCV path")
find_package(OpenCV)
@@ -269,7 +276,7 @@ else() # We are on linux and build for linux
target_link_libraries(w2xc ${OpenCV_LIBS} ${CMAKE_DL_LIBS} pthread stdc++fs stdc++)
endif()
-set(CONV_EXE "$<TARGET_FILE_DIR:conv>/conv")
+set(CONV_EXE ${CMAKE_BINARY_DIR}/conv)
add_custom_command(
OUTPUT modelHandler_OpenCL.cl.h