Skip to content

Commit

Permalink
CMake - Better Windows Build
Browse files Browse the repository at this point in the history
  • Loading branch information
nlogozzo committed Jan 6, 2024
1 parent 3e4c547 commit 7b8477a
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 11 deletions.
13 changes: 7 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ if(DEFINED ENV{VCPKG_ROOT})
endif()
if(WIN32)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON)
set(BUILD_SHARED_LIBS ON)
endif()
if (POLICY CMP0141)
cmake_policy(SET CMP0141 NEW)
Expand Down Expand Up @@ -71,12 +70,14 @@ endif()
#libaura Packages
find_package(Boost REQUIRED COMPONENTS locale)
find_package(CURL REQUIRED)
find_package(jsoncpp REQUIRED)
find_package(jsoncpp CONFIG REQUIRED)
find_package(Intl REQUIRED)
find_package(OpenSSL REQUIRED)
find_package(unofficial-maddy REQUIRED)
find_package(unofficial-maddy CONFIG REQUIRED)
target_link_libraries(${PROJECT_NAME} PUBLIC Boost::boost Boost::locale CURL::libcurl JsonCpp::JsonCpp Intl::Intl OpenSSL::SSL OpenSSL::Crypto unofficial::maddy::maddy)
if(LINUX)
if(WIN32)
target_link_libraries(${PROJECT_NAME} PUBLIC Advapi32 Dwmapi Gdiplus Shell32)
elseif(LINUX)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
find_package(PkgConfig REQUIRED)
Expand Down Expand Up @@ -120,6 +121,6 @@ if (NOT BUILD_TESTING STREQUAL OFF)
"tests/updatertests.cpp"
"tests/versiontests.cpp"
"tests/webtests.cpp")
find_package(GTest REQUIRED)
target_link_libraries(${PROJECT_NAME}_test PRIVATE GTest::gtest_main GTest::gmock_main ${PROJECT_NAME})
find_package(GTest CONFIG REQUIRED)
target_link_libraries(${PROJECT_NAME}_test PRIVATE GTest::gtest GTest::gtest_main GTest::gmock GTest::gmock_main ${PROJECT_NAME})
endif()
1 change: 0 additions & 1 deletion include/notifications/notifyicon.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include <shellapi.h>
#include "notifyiconmenu.h"
#include "shellnotificationsenteventargs.h"
#pragma comment(lib,"shell32.lib")

namespace Nickvision::Aura::Notifications
{
Expand Down
2 changes: 0 additions & 2 deletions include/taskbar/taskbaritem.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
#include <atlbase.h>
#include <gdiplus.h>
#include <shlobj_core.h>
#pragma comment(lib,"shell32.lib")
#pragma comment(lib,"gdiplus.lib")
#elif defined(__linux__)
#include <gio/gio.h>
#endif
Expand Down
1 change: 0 additions & 1 deletion src/keyring/systemcredentials.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#ifdef _WIN32
#include <windows.h>
#include <wincred.h>
#pragma comment(lib,"advapi32.lib")
#elif defined(__linux__)
#include <libsecret/secret.h>
#endif
Expand Down
1 change: 0 additions & 1 deletion src/taskbar/taskbaritem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#include <limits>
#ifdef _WIN32
#include <dwmapi.h>
#pragma comment(lib,"dwmapi.lib")
using namespace Gdiplus;
#elif defined(__linux__)
#include <stdlib.h>
Expand Down

0 comments on commit 7b8477a

Please sign in to comment.