Skip to content

Commit

Permalink
Update CMakeLists
Browse files Browse the repository at this point in the history
  • Loading branch information
TianZerL committed May 15, 2020
1 parent 4595f45 commit 3b225a8
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Anime4KCore/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ endif()

add_library(${PROJECT_NAME} SHARED ${INCLUDE} ${SOURCE})

include(../cmake/ThirdParty.cmake)
include(../cmake/ThirdPartyForCore.cmake)
7 changes: 3 additions & 4 deletions CLI/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@ project(Anime4KCPP_CLI LANGUAGES CXX)

if(Build_CLI)

find_package(OpenCL REQUIRED)

aux_source_directory(src SOURCE)

include_directories(../Anime4KCore/include ../ThirdParty/include ${OpenCL_INCLUDE_DIRS})
include_directories(../Anime4KCore/include)

add_compile_definitions(COMPILER="${CMAKE_CXX_COMPILER_ID}")

add_executable(${PROJECT_NAME} ${SOURCE})
target_link_libraries(${PROJECT_NAME} Anime4KCPPCore)

include(../cmake/ThirdPartyForCLI.cmake)

endif()
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,11 @@ set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)

option(Build_GUI "Build GUI or not" ON)
option(Build_CLI "Build CLI or not" ON)
option(Build_VapourSynth_plugin "Build Anime4KCPP for VapourSynth plugin or not" OFF)
option(Built_in_kernel "Built-in kernel or not" ON)

set(VapourSynth_SDK_PATH "VapourSynth SDK PATH" CACHE PATH "Where to look for VapourSynth SDK")

macro(SUBDIRLIST result curdir)
file(GLOB children RELATIVE ${curdir} ${curdir}/*)
set(dirlist "")
Expand Down
12 changes: 2 additions & 10 deletions GUI/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ if(Build_GUI)
set(TS_FILES ./src/Anime4KCPP_GUI_zh_CN.ts)
set(UI_FILE ./src/mainwindow.ui)

include_directories(include ../ThirdParty/include ../Anime4KCore/include)
include_directories(include ../Anime4KCore/include)
file(GLOB INCLUDE include/*.h)

aux_source_directory(src SOURCE)
Expand All @@ -24,15 +24,7 @@ if(Build_GUI)
${UI_FILE}
)

find_package(Qt5 COMPONENTS Widgets LinguistTools REQUIRED)
find_package(OpenCV REQUIRED)
find_package(OpenCL REQUIRED)

include_directories(${OpenCV_INCLUDE_DIRS} ${OpenCL_INCLUDE_DIRS})

target_link_libraries(Anime4KCPP_GUI PRIVATE Qt5::Widgets)
target_link_libraries(${PROJECT_NAME} PRIVATE ${OpenCV_LIBS})
target_link_libraries(${PROJECT_NAME} PRIVATE Anime4KCPPCore)
include(../cmake/ThirdPartyForGUI.cmake)

qt5_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} ${TS_FILES})

Expand Down
16 changes: 16 additions & 0 deletions VapourSynth/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
project(Anime4KCPP_VapourSynth LANGUAGES CXX)

if(Build_VapourSynth_plugin)

aux_source_directory(src SOURCE)
aux_source_directory(../Anime4KCore/src Anime4KCPPCoreSource)

include_directories(../Anime4KCore/include)

add_compile_definitions(BUILT_IN_KERNEL PARALLEL_SUPPORTS)

add_library(${PROJECT_NAME} SHARED ${SOURCE} ${Anime4KCPPCoreSource})

include(../cmake/ThirdPartyForVS.cmake)

endif()
5 changes: 5 additions & 0 deletions cmake/ThirdPartyForCLI.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
find_package(OpenCL REQUIRED)

include_directories(../ThirdParty/include ${OpenCL_INCLUDE_DIRS})

target_link_libraries(${PROJECT_NAME} Anime4KCPPCore)
File renamed without changes.
9 changes: 9 additions & 0 deletions cmake/ThirdPartyForGUI.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
find_package(Qt5 COMPONENTS Widgets LinguistTools REQUIRED)
find_package(OpenCV REQUIRED)
find_package(OpenCL REQUIRED)

include_directories(${OpenCV_INCLUDE_DIRS} ${OpenCL_INCLUDE_DIRS})

target_link_libraries(Anime4KCPP_GUI PRIVATE Qt5::Widgets)
target_link_libraries(${PROJECT_NAME} PRIVATE ${OpenCV_LIBS})
target_link_libraries(${PROJECT_NAME} PRIVATE Anime4KCPPCore)
7 changes: 7 additions & 0 deletions cmake/ThirdPartyForVS.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
include_directories(${VapourSynth_SDK_PATH}/include)

target_link_directories(${PROJECT_NAME} PRIVATE ${VapourSynth_SDK_PATH}/lib64)

target_link_libraries(${PROJECT_NAME} VapourSynth)

include(../cmake/ThirdPartyForCore.cmake)

0 comments on commit 3b225a8

Please sign in to comment.