diff --git a/CMakeLists.txt b/CMakeLists.txt index c747e77..a9f2caa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,6 +32,13 @@ if(NOT DEFINED LANGUAGE) set(LANGUAGE English) endif() +if(NOT DEFINED BUILD_CORE) + set(BUILD_CORE ON) +endif() +if(NOT DEFINED BUILD_PLUGIN) + set(BUILD_PLUGIN ON) +endif() + if(NOT DEFINED WINXP) set(WINXPAPP "") else() @@ -58,8 +65,12 @@ set(VERSION_MINOR 1) set(VERSION_PATCH 2) set(VERSION_REVISION 0) -if(NOT DEFINED PLUGIN) +if(BUILD_CORE) add_subdirectory(include) add_subdirectory(LunaHook) +add_subdirectory(LunaHost) endif() -add_subdirectory(LunaHost) \ No newline at end of file + +if(BUILD_PLUGIN) +add_subdirectory(LunaHost/GUI/Plugin) +endif() \ No newline at end of file diff --git a/LunaHost/CMakeLists.txt b/LunaHost/CMakeLists.txt index a03eb16..242676f 100644 --- a/LunaHost/CMakeLists.txt +++ b/LunaHost/CMakeLists.txt @@ -1,5 +1,4 @@ -if(NOT DEFINED PLUGIN) generate_product_version( versioninfohost NAME "LunaHost" @@ -29,5 +28,4 @@ set_target_properties(LunaHostCLI PROPERTIES OUTPUT_NAME "LunaHostCLI${bitappend set_target_properties(LunaHostDll PROPERTIES OUTPUT_NAME "LunaHost${bitappendix}") target_link_libraries(LunaHostCLI pch host ${YY_Thunks_for_WinXP}) target_link_libraries(LunaHostDll pch host ${YY_Thunks_for_WinXP}) -endif() add_subdirectory(GUI) \ No newline at end of file diff --git a/LunaHost/GUI/CMakeLists.txt b/LunaHost/GUI/CMakeLists.txt index 123b54c..57cd522 100644 --- a/LunaHost/GUI/CMakeLists.txt +++ b/LunaHost/GUI/CMakeLists.txt @@ -1,8 +1,5 @@ -if(NOT DEFINED PLUGIN) add_executable(LunaHost WIN32 confighelper.cpp controls.cpp main.cpp processlistwindow.cpp LunaHost.cpp window.cpp luna.rc pluginmanager.cpp Plugin/extensionimpl.cpp Plugin/copyclipboard.cpp QtLoader_inline.cpp app.manifest ${versioninfohost}) target_precompile_headers(LunaHost REUSE_FROM pch) set_target_properties(LunaHost PROPERTIES OUTPUT_NAME "LunaHost${bitappendix}") -target_link_libraries(LunaHost comctl32 winhttp version pch host ${YY_Thunks_for_WinXP}) -endif() -add_subdirectory(Plugin) \ No newline at end of file +target_link_libraries(LunaHost comctl32 winhttp version pch host ${YY_Thunks_for_WinXP}) \ No newline at end of file diff --git a/LunaHost/GUI/Plugin/CMakeLists.txt b/LunaHost/GUI/Plugin/CMakeLists.txt index 8dc5628..a3448f7 100644 --- a/LunaHost/GUI/Plugin/CMakeLists.txt +++ b/LunaHost/GUI/Plugin/CMakeLists.txt @@ -11,11 +11,11 @@ if(Qt5_DIR) set_target_properties(QtLoader PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/plugin${bitappendix}") endif() endif() -if(DEFINED PLUGIN) - include(QtUtils.cmake) - #msvc_registry_search() - #if(Qt5_DIR) - find_qt5(Core Widgets WebSockets) - add_subdirectory(extensions) - #endif() -endif() \ No newline at end of file + +include(QtUtils.cmake) +if(NOT DEFINED USESYSQTPATH) +msvc_registry_search() +endif() + +find_qt5(Core Widgets WebSockets) +add_subdirectory(extensions) diff --git a/LunaHost/GUI/Plugin/QtUtils.cmake b/LunaHost/GUI/Plugin/QtUtils.cmake index 4a36ec4..1c7011f 100644 --- a/LunaHost/GUI/Plugin/QtUtils.cmake +++ b/LunaHost/GUI/Plugin/QtUtils.cmake @@ -62,7 +62,7 @@ macro(find_qt5) set(CMAKE_AUTOUIC ON) #add_definitions(-DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x060000) find_package(Qt5 COMPONENTS ${ARGN}) - + set(CMAKE_PREFIX_PATH "C:/Qt/Qt5.14.2/5.14.2/msvc2017/lib/cmake/Qt5" ${CMAKE_PREFIX_PATH}) if(Qt5_FOUND) if(WIN32 AND TARGET Qt5::qmake AND NOT TARGET Qt5::windeployqt) get_target_property(_qt5_qmake_location Qt5::qmake IMPORTED_LOCATION) diff --git a/scripts/build32xp_local.bat b/scripts/build32xp_local.bat index bed9151..d7c9b54 100644 --- a/scripts/build32xp_local.bat +++ b/scripts/build32xp_local.bat @@ -1,3 +1,3 @@ -cmake -DWINXP=1 ../CMakeLists.txt -G "Visual Studio 17 2022" -A win32 -T host=x86 -B ../build/x86_xp -cmake -DWINXP=1 -DLANGUAGE=Chinese ../CMakeLists.txt -G "Visual Studio 17 2022" -A win32 -T host=x86 -B ../build/x86_zh_xp +cmake -DBUILD_PLUGIN=OFF -DWINXP=1 ../CMakeLists.txt -G "Visual Studio 17 2022" -A win32 -T host=x86 -B ../build/x86_xp +cmake -DBUILD_PLUGIN=OFF -DWINXP=1 -DLANGUAGE=Chinese ../CMakeLists.txt -G "Visual Studio 17 2022" -A win32 -T host=x86 -B ../build/x86_zh_xp call dobuildxp.bat \ No newline at end of file diff --git a/scripts/builden.bat b/scripts/builden.bat index 4a1125e..f28c4ac 100644 --- a/scripts/builden.bat +++ b/scripts/builden.bat @@ -1,5 +1,5 @@ -cmake ../CMakeLists.txt -G "Visual Studio 17 2022" -A win32 -T host=x86 -B ../build/x86 +cmake -DBUILD_PLUGIN=OFF ../CMakeLists.txt -G "Visual Studio 17 2022" -A win32 -T host=x86 -B ../build/x86 cmake --build ../build/x86 --config Release --target ALL_BUILD -j 14 -cmake ../CMakeLists.txt -G "Visual Studio 17 2022" -A x64 -T host=x64 -B ../build/x64 +cmake -DBUILD_PLUGIN=OFF ../CMakeLists.txt -G "Visual Studio 17 2022" -A x64 -T host=x64 -B ../build/x64 cmake --build ../build/x64 --config Release --target ALL_BUILD -j 14 \ No newline at end of file diff --git a/scripts/buildplugin32.bat b/scripts/buildplugin32.bat index 82e55dc..11604b6 100644 --- a/scripts/buildplugin32.bat +++ b/scripts/buildplugin32.bat @@ -1,2 +1,2 @@ -cmake -DPLUGIN=1 ../CMakeLists.txt -G "Visual Studio 17 2022" -A win32 -T host=x86 -B ../build/plugin32 +cmake -DBUILD_CORE=OFF -DUSESYSQTPATH=1 -DPLUGIN=1 ../CMakeLists.txt -G "Visual Studio 17 2022" -A win32 -T host=x86 -B ../build/plugin32 cmake --build ../build/plugin32 --config Release --target ALL_BUILD -j 14 \ No newline at end of file diff --git a/scripts/buildplugin32_local.bat b/scripts/buildplugin32_local.bat new file mode 100644 index 0000000..d801790 --- /dev/null +++ b/scripts/buildplugin32_local.bat @@ -0,0 +1,2 @@ +cmake -DBUILD_CORE=OFF -DPLUGIN=1 ../CMakeLists.txt -G "Visual Studio 17 2022" -A win32 -T host=x86 -B ../build/plugin32 +cmake --build ../build/plugin32 --config Release --target ALL_BUILD -j 14 \ No newline at end of file diff --git a/scripts/buildplugin64.bat b/scripts/buildplugin64.bat index ff1265b..d3140b2 100644 --- a/scripts/buildplugin64.bat +++ b/scripts/buildplugin64.bat @@ -1,2 +1,2 @@ -cmake -DPLUGIN=1 ../CMakeLists.txt -G "Visual Studio 17 2022" -A x64 -T host=x64 -B ../build/plugin64 +cmake -DBUILD_CORE=OFF -DPLUGIN=1 ../CMakeLists.txt -G "Visual Studio 17 2022" -A x64 -T host=x64 -B ../build/plugin64 cmake --build ../build/plugin64 --config Release --target ALL_BUILD -j 14 \ No newline at end of file diff --git a/scripts/buildxpen.bat b/scripts/buildxpen.bat index 6b3f8d8..ca5d634 100644 --- a/scripts/buildxpen.bat +++ b/scripts/buildxpen.bat @@ -1,3 +1,3 @@ -cmake -DWINXP=1 ../CMakeLists.txt -G "Visual Studio 16 2019" -A win32 -T v141_xp -B ../build/x86_xp +cmake -DBUILD_PLUGIN=OFF -DWINXP=1 ../CMakeLists.txt -G "Visual Studio 16 2019" -A win32 -T v141_xp -B ../build/x86_xp cmake --build ../build/x86_xp --config Release --target ALL_BUILD -j 14 call dobuildxp.bat \ No newline at end of file diff --git a/scripts/buildxpzh.bat b/scripts/buildxpzh.bat index d0c46f2..656335c 100644 --- a/scripts/buildxpzh.bat +++ b/scripts/buildxpzh.bat @@ -1,4 +1,4 @@ -cmake -DWINXP=1 -DLANGUAGE=Chinese ../CMakeLists.txt -G "Visual Studio 16 2019" -A win32 -T v141_xp -B ../build/x86_zh_xp +cmake -DBUILD_PLUGIN=OFF -DWINXP=1 -DLANGUAGE=Chinese ../CMakeLists.txt -G "Visual Studio 16 2019" -A win32 -T v141_xp -B ../build/x86_zh_xp cmake --build ../build/x86_zh_xp --config Release --target ALL_BUILD -j 14 call dobuildxp.bat \ No newline at end of file diff --git a/scripts/buildzh.bat b/scripts/buildzh.bat index d0e1e7b..a43da61 100644 --- a/scripts/buildzh.bat +++ b/scripts/buildzh.bat @@ -1,5 +1,5 @@ -cmake -DLANGUAGE=Chinese ../CMakeLists.txt -G "Visual Studio 17 2022" -A win32 -T host=x86 -B ../build/x86_zh +cmake -DBUILD_PLUGIN=OFF -DLANGUAGE=Chinese ../CMakeLists.txt -G "Visual Studio 17 2022" -A win32 -T host=x86 -B ../build/x86_zh cmake --build ../build/x86_zh --config Release --target ALL_BUILD -j 14 -cmake -DLANGUAGE=Chinese ../CMakeLists.txt -G "Visual Studio 17 2022" -A x64 -T host=x64 -B ../build/x64_zh +cmake -DBUILD_PLUGIN=OFF -DLANGUAGE=Chinese ../CMakeLists.txt -G "Visual Studio 17 2022" -A x64 -T host=x64 -B ../build/x64_zh cmake --build ../build/x64_zh --config Release --target ALL_BUILD -j 14