Skip to content

Commit

Permalink
update cmake files
Browse files Browse the repository at this point in the history
  • Loading branch information
arm64v8a committed Jan 29, 2023
1 parent f0b8c4e commit e9e105e
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 31 deletions.
14 changes: 10 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 ####

Expand Down Expand Up @@ -129,7 +135,7 @@ endif ()

# Sources
set(PROJECT_SOURCES
${PLATFORM_FUCKING_SOURCES}
${PLATFORM_SOURCES}

main/main.cpp
main/NekoRay.cpp
Expand Down Expand Up @@ -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)
Expand Down
27 changes: 0 additions & 27 deletions cmake/fuck_windows/fuck.cmake

This file was deleted.

1 change: 1 addition & 0 deletions cmake/linux/linux.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
set(PLATFORM_LIBRARIES dl)
Empty file added cmake/macos/macos.cmake
Empty file.
File renamed without changes.
File renamed without changes.
25 changes: 25 additions & 0 deletions cmake/windows/windows.cmake
Original file line number Diff line number Diff line change
@@ -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 ()

0 comments on commit e9e105e

Please sign in to comment.