update cmake files

This commit is contained in:
arm64v8a
2023-01-29 11:06:44 +09:00
parent f0b8c4ec02
commit e9e105e050
8 changed files with 36 additions and 31 deletions

View File

@@ -29,8 +29,14 @@ if (NKR_CROSS)
set_property(TARGET Qt5::lupdate PROPERTY IMPORTED_LOCATION /usr/bin/lupdate)
endif ()
# Windows
include("cmake/fuck_windows/fuck.cmake")
#### Platform Variables ####
if (APPLE)
include("cmake/macos/macos.cmake")
elseif (WIN32)
include("cmake/windows/windows.cmake")
else ()
include("cmake/linux/linux.cmake")
endif ()
#### default prefix path ####
@@ -129,7 +135,7 @@ endif ()
# Sources
set(PROJECT_SOURCES
${PLATFORM_FUCKING_SOURCES}
${PLATFORM_SOURCES}
main/main.cpp
main/NekoRay.cpp
@@ -310,7 +316,7 @@ target_link_libraries(nekoray PRIVATE
Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Network Qt${QT_VERSION_MAJOR}::Svg
Threads::Threads
${NKR_EXTERNAL_TARGETS}
${PLATFORM_FUCKING_LIBRARIES}
${PLATFORM_LIBRARIES}
)
if (QT_VERSION_MAJOR EQUAL 6)

View File

@@ -1,27 +0,0 @@
if (WIN32)
set(PLATFORM_FUCKING_SOURCES 3rdparty/WinCommander.cpp sys/windows/guihelper.cpp)
set(PLATFORM_FUCKING_LIBRARIES wininet wsock32 ws2_32 user32 rasapi32 iphlpapi)
include(cmake/fuck_windows/generate_product_version.cmake)
generate_product_version(
QV2RAY_RC
ICON "${CMAKE_SOURCE_DIR}/res/nekoray.ico"
NAME "nekoray"
BUNDLE "nekoray"
COMPANY_NAME "nekoray"
COMPANY_COPYRIGHT "nekoray"
FILE_DESCRIPTION "nekoray"
)
add_definitions(-DUNICODE -D_UNICODE -DNOMINMAX)
set(GUI_TYPE WIN32)
if (MINGW)
if (NOT DEFINED MinGW_ROOT)
set(MinGW_ROOT "C:/msys64/mingw64")
endif ()
else ()
add_compile_options("/utf-8")
add_compile_options("/std:c++17")
add_definitions(-D_WIN32_WINNT=0x600 -D_SCL_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS)
list(APPEND PLATFORM_FUCKING_SOURCES sys/windows/MiniDump.cpp)
endif ()
endif ()

1
cmake/linux/linux.cmake Normal file
View File

@@ -0,0 +1 @@
set(PLATFORM_LIBRARIES dl)

0
cmake/macos/macos.cmake Normal file
View File

View File

@@ -0,0 +1,25 @@
set(PLATFORM_SOURCES 3rdparty/WinCommander.cpp sys/windows/guihelper.cpp)
set(PLATFORM_LIBRARIES wininet wsock32 ws2_32 user32 rasapi32 iphlpapi)
include(cmake/windows/generate_product_version.cmake)
generate_product_version(
QV2RAY_RC
ICON "${CMAKE_SOURCE_DIR}/res/nekoray.ico"
NAME "nekoray"
BUNDLE "nekoray"
COMPANY_NAME "nekoray"
COMPANY_COPYRIGHT "nekoray"
FILE_DESCRIPTION "nekoray"
)
add_definitions(-DUNICODE -D_UNICODE -DNOMINMAX)
set(GUI_TYPE WIN32)
if (MINGW)
if (NOT DEFINED MinGW_ROOT)
set(MinGW_ROOT "C:/msys64/mingw64")
endif ()
else ()
add_compile_options("/utf-8")
add_compile_options("/std:c++17")
add_definitions(-D_WIN32_WINNT=0x600 -D_SCL_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS)
list(APPEND PLATFORM_SOURCES sys/windows/MiniDump.cpp)
endif ()