build: improve the Linux aspect of things (#75)

Improved, fixed and streamlined cmake files. Optionally use system libraries instead of vcpkg (-DENABLE_VCPKG=OFF)
This commit is contained in:
Andrea Pappacoda 2022-08-29 07:19:48 +02:00 committed by GitHub
parent 0f24b0663e
commit f51a51df3b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 368 additions and 96 deletions

View file

@ -1,7 +1,5 @@
project(CemuCommon)
#include_directories(".")
file(GLOB CPP_FILES *.cpp)
file(GLOB H_FILES *.h)
add_library(CemuCommon ${CPP_FILES} ${H_FILES})
@ -29,4 +27,22 @@ target_sources(CemuCommon
)
target_precompile_headers(CemuCommon PUBLIC precompiled.h)
target_include_directories(CemuCommon PRIVATE ../)
target_include_directories(CemuCommon PUBLIC "../")
target_link_libraries(CemuCommon PRIVATE
CemuCafe
CemuConfig
CemuComponents
Boost::nowide
Boost::filesystem
glm::glm
)
if (UNIX)
target_link_libraries(CemuCommon PRIVATE X11::X11 X11::Xrender X11::Xutil)
endif()
# PUBLIC because:
# - boost/predef/os.h is included in platform.h
# - fmt/core.h is included in precompiled.h
target_link_libraries(CemuCommon PUBLIC Boost::headers fmt::fmt)