cmake: Convert indentation to tabs

Previously was a random mix of tabs and spaces
This commit is contained in:
TellowKrinkle 2021-07-04 00:24:21 -05:00
parent d1344fdd91
commit 5bfd48c65c
26 changed files with 1848 additions and 1845 deletions

View File

@ -35,58 +35,58 @@ get_git_version_info()
write_svnrev_h() write_svnrev_h()
if(NOT NO_TRANSLATION) if(NOT NO_TRANSLATION)
# make the translation # make the translation
if(EXISTS "${CMAKE_SOURCE_DIR}/locales") if(EXISTS "${CMAKE_SOURCE_DIR}/locales")
add_subdirectory(locales) add_subdirectory(locales)
endif() endif()
endif() endif()
# make common # make common
if(common_libs) if(common_libs)
add_subdirectory(common/src/Utilities) add_subdirectory(common/src/Utilities)
add_subdirectory(common/src/x86emitter) add_subdirectory(common/src/x86emitter)
endif() endif()
# make pcsx2 # make pcsx2
if(EXISTS "${CMAKE_SOURCE_DIR}/pcsx2" AND pcsx2_core) if(EXISTS "${CMAKE_SOURCE_DIR}/pcsx2" AND pcsx2_core)
add_subdirectory(pcsx2) add_subdirectory(pcsx2)
endif() endif()
# tests # tests
if(ACTUALLY_ENABLE_TESTS) if(ACTUALLY_ENABLE_TESTS)
add_subdirectory(3rdparty/gtest EXCLUDE_FROM_ALL) add_subdirectory(3rdparty/gtest EXCLUDE_FROM_ALL)
add_subdirectory(tests/ctest) add_subdirectory(tests/ctest)
endif() endif()
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# Install some files to ease package creation # Install some files to ease package creation
if(PACKAGE_MODE) if(PACKAGE_MODE)
if(NOT DISABLE_CHEATS_ZIP) if(NOT DISABLE_CHEATS_ZIP)
INSTALL(FILES "${CMAKE_SOURCE_DIR}/bin/cheats_ws.zip" DESTINATION "${CMAKE_INSTALL_DATADIR}/PCSX2") INSTALL(FILES "${CMAKE_SOURCE_DIR}/bin/cheats_ws.zip" DESTINATION "${CMAKE_INSTALL_DATADIR}/PCSX2")
endif() endif()
INSTALL(FILES "${CMAKE_SOURCE_DIR}/bin/GameIndex.yaml" DESTINATION "${CMAKE_INSTALL_DATADIR}/PCSX2") INSTALL(FILES "${CMAKE_SOURCE_DIR}/bin/GameIndex.yaml" DESTINATION "${CMAKE_INSTALL_DATADIR}/PCSX2")
# set categories depending on system/distribution in pcsx2.desktop # set categories depending on system/distribution in pcsx2.desktop
if(openSUSE) if(openSUSE)
set(PCSX2_MENU_CATEGORIES "System;Emulator;") set(PCSX2_MENU_CATEGORIES "System;Emulator;")
else() else()
set(PCSX2_MENU_CATEGORIES "Game;Emulator;") set(PCSX2_MENU_CATEGORIES "Game;Emulator;")
endif() endif()
configure_file("${CMAKE_SOURCE_DIR}/linux_various/PCSX2.desktop.in" "${CMAKE_BINARY_DIR}/linux_various/PCSX2.desktop" @ONLY) configure_file("${CMAKE_SOURCE_DIR}/linux_various/PCSX2.desktop.in" "${CMAKE_BINARY_DIR}/linux_various/PCSX2.desktop" @ONLY)
INSTALL(FILES "${CMAKE_BINARY_DIR}/linux_various/PCSX2.desktop" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications") INSTALL(FILES "${CMAKE_BINARY_DIR}/linux_various/PCSX2.desktop" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications")
INSTALL(FILES "${CMAKE_SOURCE_DIR}/linux_various/PCSX2.xpm" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/pixmaps") INSTALL(FILES "${CMAKE_SOURCE_DIR}/linux_various/PCSX2.xpm" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/pixmaps")
INSTALL(FILES "${CMAKE_SOURCE_DIR}/bin/docs/PCSX2_FAQ.pdf" DESTINATION "${CMAKE_INSTALL_DOCDIR}") INSTALL(FILES "${CMAKE_SOURCE_DIR}/bin/docs/PCSX2_FAQ.pdf" DESTINATION "${CMAKE_INSTALL_DOCDIR}")
INSTALL(FILES "${CMAKE_SOURCE_DIR}/bin/docs/Configuration_Guide.pdf" DESTINATION "${CMAKE_INSTALL_DOCDIR}") INSTALL(FILES "${CMAKE_SOURCE_DIR}/bin/docs/Configuration_Guide.pdf" DESTINATION "${CMAKE_INSTALL_DOCDIR}")
INSTALL(FILES "${CMAKE_SOURCE_DIR}/bin/docs/PCSX2.1" DESTINATION "${CMAKE_INSTALL_MANDIR}/man1") INSTALL(FILES "${CMAKE_SOURCE_DIR}/bin/docs/PCSX2.1" DESTINATION "${CMAKE_INSTALL_MANDIR}/man1")
if(NOT DISABLE_PCSX2_WRAPPER) if(NOT DISABLE_PCSX2_WRAPPER)
INSTALL(FILES "${CMAKE_SOURCE_DIR}/linux_various/PCSX2-linux.sh" DESTINATION "${CMAKE_INSTALL_BINDIR}") INSTALL(FILES "${CMAKE_SOURCE_DIR}/linux_various/PCSX2-linux.sh" DESTINATION "${CMAKE_INSTALL_BINDIR}")
endif() endif()
else() else()
if(NOT DISABLE_PCSX2_WRAPPER) if(NOT DISABLE_PCSX2_WRAPPER)
# special case to avoid having linux files in windows # special case to avoid having linux files in windows
INSTALL(FILES "${CMAKE_SOURCE_DIR}/linux_various/PCSX2-linux.sh" DESTINATION "${CMAKE_SOURCE_DIR}/bin") INSTALL(FILES "${CMAKE_SOURCE_DIR}/linux_various/PCSX2-linux.sh" DESTINATION "${CMAKE_SOURCE_DIR}/bin")
endif() endif()
endif() endif()

View File

@ -7,7 +7,7 @@ set(wx_sdl_c_code "
int main() int main()
{ {
return 0; return 0;
} }
") ")
@ -20,7 +20,7 @@ set(gcc7_mmx_code "
class alignas(16) GSVector4i class alignas(16) GSVector4i
{ {
public: public:
__m128i m; __m128i m;
explicit GSVector4i(__m128i m) explicit GSVector4i(__m128i m)
{ {
@ -59,7 +59,7 @@ void GIFRegHandlerTRXPOS(const GIFRegTRXPOS& p)
{ {
if(p != TRXPOS) if(p != TRXPOS)
{ {
printf(\"foo\"); printf(\"foo\");
} }
TRXPOS = (GSVector4i)p; TRXPOS = (GSVector4i)p;
@ -67,77 +67,77 @@ void GIFRegHandlerTRXPOS(const GIFRegTRXPOS& p)
int main() int main()
{ {
GIFRegTRXPOS r = {}; GIFRegTRXPOS r = {};
GIFRegHandlerTRXPOS(r); GIFRegHandlerTRXPOS(r);
uint16_t fpu[16] = {0}; uint16_t fpu[16] = {0};
__asm__ __volatile__(\"fstenv %0\" : \"=m\"(fpu)); __asm__ __volatile__(\"fstenv %0\" : \"=m\"(fpu));
bool ok = fpu[4] == 0xFFFF; bool ok = fpu[4] == 0xFFFF;
if (!ok) { if (!ok) {
printf(\"Wrong MMX state !\"); printf(\"Wrong MMX state !\");
exit(1); exit(1);
} }
return 0; return 0;
} }
") ")
function(WX_vs_SDL) function(WX_vs_SDL)
file(WRITE "${CMAKE_BINARY_DIR}/wx_sdl.c" "${wx_sdl_c_code}") file(WRITE "${CMAKE_BINARY_DIR}/wx_sdl.c" "${wx_sdl_c_code}")
enable_language(C) enable_language(C)
try_compile( try_compile(
wx_linked_to_sdl wx_linked_to_sdl
"${CMAKE_BINARY_DIR}" "${CMAKE_BINARY_DIR}"
"${CMAKE_BINARY_DIR}/wx_sdl.c" "${CMAKE_BINARY_DIR}/wx_sdl.c"
CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:STRING=${wxWidgets_INCLUDE_DIRS}" CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:STRING=${wxWidgets_INCLUDE_DIRS}"
LINK_LIBRARIES "${wxWidgets_LIBRARIES}" LINK_LIBRARIES "${wxWidgets_LIBRARIES}"
COPY_FILE "${CMAKE_BINARY_DIR}/wx_sdl" COPY_FILE "${CMAKE_BINARY_DIR}/wx_sdl"
) )
if (NOT wx_linked_to_sdl) if (NOT wx_linked_to_sdl)
return() return()
endif() endif()
execute_process( execute_process(
COMMAND ldd "${CMAKE_BINARY_DIR}/wx_sdl" COMMAND ldd "${CMAKE_BINARY_DIR}/wx_sdl"
COMMAND grep -c SDL2 COMMAND grep -c SDL2
OUTPUT_VARIABLE sdl2_count OUTPUT_VARIABLE sdl2_count
) )
if (SDL2_API AND sdl2_count STREQUAL "0") if (SDL2_API AND sdl2_count STREQUAL "0")
message(FATAL_ERROR "wxWidgets is linked to SDL1.2. Please use -DSDL2_API=FALSE.") message(FATAL_ERROR "wxWidgets is linked to SDL1.2. Please use -DSDL2_API=FALSE.")
elseif (NOT SDL2_API AND NOT sdl2_count STREQUAL "0") elseif (NOT SDL2_API AND NOT sdl2_count STREQUAL "0")
message(FATAL_ERROR "wxWidgets is linked to SDL2. Please use -DSDL2_API=TRUE") message(FATAL_ERROR "wxWidgets is linked to SDL2. Please use -DSDL2_API=TRUE")
endif() endif()
endfunction() endfunction()
function(GCC7_BUG) function(GCC7_BUG)
# try_run doesn't work when cross-compiling is enabled. It is completely silly in our case # try_run doesn't work when cross-compiling is enabled. It is completely silly in our case
# as i386 binaries are 100% fine on x64. # as i386 binaries are 100% fine on x64.
set(OLD_CMAKE_CROSSCOMPILING ${CMAKE_CROSSCOMPILING}) set(OLD_CMAKE_CROSSCOMPILING ${CMAKE_CROSSCOMPILING})
set(CMAKE_CROSSCOMPILING 0) set(CMAKE_CROSSCOMPILING 0)
set(IN "${CMAKE_BINARY_DIR}/gcc7_mmx.cpp") set(IN "${CMAKE_BINARY_DIR}/gcc7_mmx.cpp")
file(WRITE "${IN}" "${gcc7_mmx_code}") file(WRITE "${IN}" "${gcc7_mmx_code}")
enable_language(CXX) enable_language(CXX)
try_run( try_run(
run_result run_result
compile_result_unused compile_result_unused
"${CMAKE_BINARY_DIR}" "${CMAKE_BINARY_DIR}"
"${IN}" "${IN}"
CMAKE_FLAGS "-DCOMPILE_DEFINITIONS:STRING=-msse -msse2 -O2 -m32 -march=i686" CMAKE_FLAGS "-DCOMPILE_DEFINITIONS:STRING=-msse -msse2 -O2 -m32 -march=i686"
) )
if (${run_result}) if (${run_result})
message(FATAL_ERROR "GCC 7.0/7.1 generates invalid code => https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80799\n" message(FATAL_ERROR "GCC 7.0/7.1 generates invalid code => https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80799\n"
"You can either backport the fix or swith to another version of GCC.") "You can either backport the fix or swith to another version of GCC.")
endif() endif()
set(CMAKE_CROSSCOMPILING ${OLD_CMAKE_CROSSCOMPILING}) set(CMAKE_CROSSCOMPILING ${OLD_CMAKE_CROSSCOMPILING})
endfunction() endfunction()

View File

@ -17,8 +17,8 @@ option(ENABLE_TESTS "Enables building the unit tests" ON)
option(USE_SYSTEM_YAML "Uses a system version of yaml, if found") option(USE_SYSTEM_YAML "Uses a system version of yaml, if found")
if(DISABLE_BUILD_DATE OR openSUSE) if(DISABLE_BUILD_DATE OR openSUSE)
message(STATUS "Disabling the inclusion of the binary compile date.") message(STATUS "Disabling the inclusion of the binary compile date.")
add_definitions(-DDISABLE_BUILD_DATE) add_definitions(-DDISABLE_BUILD_DATE)
endif() endif()
option(USE_VTUNE "Plug VTUNE to profile GS JIT.") option(USE_VTUNE "Plug VTUNE to profile GS JIT.")
@ -42,17 +42,17 @@ option(SDL2_API "Use SDL2 on SPU2 and PAD Linux (wxWidget mustn't be built with
option(GTK2_API "Use GTK2 api (legacy)") option(GTK2_API "Use GTK2 api (legacy)")
if(PACKAGE_MODE) if(PACKAGE_MODE)
# Compile all source codes with those defines # Compile all source codes with those defines
add_definitions( add_definitions(
-DPLUGIN_DIR_COMPILATION=${CMAKE_INSTALL_FULL_LIBDIR}/PCSX2 -DPLUGIN_DIR_COMPILATION=${CMAKE_INSTALL_FULL_LIBDIR}/PCSX2
-DGAMEINDEX_DIR_COMPILATION=${CMAKE_INSTALL_FULL_DATADIR}/PCSX2 -DGAMEINDEX_DIR_COMPILATION=${CMAKE_INSTALL_FULL_DATADIR}/PCSX2
-DDOC_DIR_COMPILATION=${CMAKE_INSTALL_FULL_DOCDIR} -DDOC_DIR_COMPILATION=${CMAKE_INSTALL_FULL_DOCDIR}
) )
endif() endif()
if(APPLE) if(APPLE)
option(OSX_USE_DEFAULT_SEARCH_PATH "Don't prioritize system library paths" OFF) option(OSX_USE_DEFAULT_SEARCH_PATH "Don't prioritize system library paths" OFF)
option(SKIP_POSTPROCESS_BUNDLE "Skip postprocessing bundle for redistributability" OFF) option(SKIP_POSTPROCESS_BUNDLE "Skip postprocessing bundle for redistributability" OFF)
endif() endif()
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
@ -61,16 +61,16 @@ endif()
option(USE_ASAN "Enable address sanitizer") option(USE_ASAN "Enable address sanitizer")
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(USE_CLANG TRUE) set(USE_CLANG TRUE)
message(STATUS "Building with Clang/LLVM.") message(STATUS "Building with Clang/LLVM.")
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Intel") elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Intel")
set(USE_ICC TRUE) set(USE_ICC TRUE)
message(STATUS "Building with Intel's ICC.") message(STATUS "Building with Intel's ICC.")
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(USE_GCC TRUE) set(USE_GCC TRUE)
message(STATUS "Building with GNU GCC") message(STATUS "Building with GNU GCC")
else() else()
message(FATAL_ERROR "Unknown compiler: ${CMAKE_CXX_COMPILER_ID}") message(FATAL_ERROR "Unknown compiler: ${CMAKE_CXX_COMPILER_ID}")
endif() endif()
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
@ -82,13 +82,13 @@ option(BUILTIN_USB "Disable support of USB plugin (developer option)")
set(PLUGIN_SUPPORT "") set(PLUGIN_SUPPORT "")
if(BUILTIN_GS) if(BUILTIN_GS)
set(PLUGIN_SUPPORT "${PLUGIN_SUPPORT} -DBUILTIN_GS_PLUGIN") set(PLUGIN_SUPPORT "${PLUGIN_SUPPORT} -DBUILTIN_GS_PLUGIN")
endif() endif()
if(BUILTIN_PAD) if(BUILTIN_PAD)
set(PLUGIN_SUPPORT "${PLUGIN_SUPPORT} -DBUILTIN_PAD_PLUGIN") set(PLUGIN_SUPPORT "${PLUGIN_SUPPORT} -DBUILTIN_PAD_PLUGIN")
endif() endif()
if(BUILTIN_USB) if(BUILTIN_USB)
set(PLUGIN_SUPPORT "${PLUGIN_SUPPORT} -DBUILTIN_USB_PLUGIN") set(PLUGIN_SUPPORT "${PLUGIN_SUPPORT} -DBUILTIN_USB_PLUGIN")
endif() endif()
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
@ -102,7 +102,7 @@ if(NOT CMAKE_BUILD_TYPE MATCHES "Debug|Devel|Release|Prof")
endif() endif()
# AVX2 doesn't play well with gdb # AVX2 doesn't play well with gdb
if(CMAKE_BUILD_TYPE MATCHES "Debug") if(CMAKE_BUILD_TYPE MATCHES "Debug")
SET(DISABLE_ADVANCE_SIMD ON) SET(DISABLE_ADVANCE_SIMD ON)
endif() endif()
# Initially strip was disabled on release build but it is not stackstrace friendly! # Initially strip was disabled on release build but it is not stackstrace friendly!
@ -110,13 +110,13 @@ endif()
option(CMAKE_BUILD_STRIP "Srip binaries to save a couple of MB (developer option)") option(CMAKE_BUILD_STRIP "Srip binaries to save a couple of MB (developer option)")
if(NOT DEFINED CMAKE_BUILD_PO) if(NOT DEFINED CMAKE_BUILD_PO)
if(CMAKE_BUILD_TYPE STREQUAL "Release") if(CMAKE_BUILD_TYPE STREQUAL "Release")
set(CMAKE_BUILD_PO TRUE) set(CMAKE_BUILD_PO TRUE)
message(STATUS "Enable the building of po files by default in ${CMAKE_BUILD_TYPE} build !!!") message(STATUS "Enable the building of po files by default in ${CMAKE_BUILD_TYPE} build !!!")
else() else()
set(CMAKE_BUILD_PO FALSE) set(CMAKE_BUILD_PO FALSE)
message(STATUS "Disable the building of po files by default in ${CMAKE_BUILD_TYPE} build !!!") message(STATUS "Disable the building of po files by default in ${CMAKE_BUILD_TYPE} build !!!")
endif() endif()
endif() endif()
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
@ -126,9 +126,9 @@ option(DISABLE_ADVANCE_SIMD "Disable advance use of SIMD (SSE2+ & AVX)" OFF)
# Print if we are cross compiling. # Print if we are cross compiling.
if(CMAKE_CROSSCOMPILING) if(CMAKE_CROSSCOMPILING)
message(STATUS "Cross compilation is enabled.") message(STATUS "Cross compilation is enabled.")
else() else()
message(STATUS "Cross compilation is disabled.") message(STATUS "Cross compilation is disabled.")
endif() endif()
# Architecture bitness detection # Architecture bitness detection
@ -141,57 +141,57 @@ else()
endif() endif()
if(${PCSX2_TARGET_ARCHITECTURES} MATCHES "i386") if(${PCSX2_TARGET_ARCHITECTURES} MATCHES "i386")
# * -fPIC option was removed for multiple reasons. # * -fPIC option was removed for multiple reasons.
# - Code only supports the x86 architecture. # - Code only supports the x86 architecture.
# - code uses the ebx register so it's not compliant with PIC. # - code uses the ebx register so it's not compliant with PIC.
# - Impacts the performance too much. # - Impacts the performance too much.
# - Only plugins. No package will link to them. # - Only plugins. No package will link to them.
set(CMAKE_POSITION_INDEPENDENT_CODE OFF) set(CMAKE_POSITION_INDEPENDENT_CODE OFF)
if(NOT DEFINED ARCH_FLAG) if(NOT DEFINED ARCH_FLAG)
if (DISABLE_ADVANCE_SIMD) if (DISABLE_ADVANCE_SIMD)
if (USE_ICC) if (USE_ICC)
set(ARCH_FLAG "-msse2 -msse4.1") set(ARCH_FLAG "-msse2 -msse4.1")
else() else()
set(ARCH_FLAG "-msse -msse2 -msse4.1 -mfxsr -march=i686") set(ARCH_FLAG "-msse -msse2 -msse4.1 -mfxsr -march=i686")
endif() endif()
else() else()
# AVX requires some fix of the ABI (mangling) (default 2) # AVX requires some fix of the ABI (mangling) (default 2)
# Note: V6 requires GCC 4.7 # Note: V6 requires GCC 4.7
#set(ARCH_FLAG "-march=native -fabi-version=6") #set(ARCH_FLAG "-march=native -fabi-version=6")
set(ARCH_FLAG "-mfxsr -march=native") set(ARCH_FLAG "-mfxsr -march=native")
endif() endif()
endif() endif()
add_definitions(-D_ARCH_32=1 -D_M_X86=1 -D_M_X86_32=1) add_definitions(-D_ARCH_32=1 -D_M_X86=1 -D_M_X86_32=1)
set(_ARCH_32 1) set(_ARCH_32 1)
set(_M_X86 1) set(_M_X86 1)
set(_M_X86_32 1) set(_M_X86_32 1)
elseif(${PCSX2_TARGET_ARCHITECTURES} MATCHES "x86_64") elseif(${PCSX2_TARGET_ARCHITECTURES} MATCHES "x86_64")
# x86_64 requires -fPIC # x86_64 requires -fPIC
set(CMAKE_POSITION_INDEPENDENT_CODE ON) set(CMAKE_POSITION_INDEPENDENT_CODE ON)
if(NOT DEFINED ARCH_FLAG) if(NOT DEFINED ARCH_FLAG)
if (DISABLE_ADVANCE_SIMD) if (DISABLE_ADVANCE_SIMD)
if (USE_ICC) if (USE_ICC)
set(ARCH_FLAG "-msse2 -msse4.1") set(ARCH_FLAG "-msse2 -msse4.1")
else() else()
set(ARCH_FLAG "-msse -msse2 -msse4.1 -mfxsr") set(ARCH_FLAG "-msse -msse2 -msse4.1 -mfxsr")
endif() endif()
else() else()
#set(ARCH_FLAG "-march=native -fabi-version=6") #set(ARCH_FLAG "-march=native -fabi-version=6")
set(ARCH_FLAG "-march=native") set(ARCH_FLAG "-march=native")
endif() endif()
endif() endif()
add_definitions(-D_ARCH_64=1 -D_M_X86=1 -D_M_X86_64=1 -D__M_X86_64=1) add_definitions(-D_ARCH_64=1 -D_M_X86=1 -D_M_X86_64=1 -D__M_X86_64=1)
set(_ARCH_64 1) set(_ARCH_64 1)
set(_M_X86 1) set(_M_X86 1)
set(_M_X86_64 1) set(_M_X86_64 1)
else() else()
# All but i386 requires -fPIC # All but i386 requires -fPIC
set(CMAKE_POSITION_INDEPENDENT_CODE ON) set(CMAKE_POSITION_INDEPENDENT_CODE ON)
message(FATAL_ERROR "Unsupported architecture: ${PCSX2_TARGET_ARCHITECTURES}") message(FATAL_ERROR "Unsupported architecture: ${PCSX2_TARGET_ARCHITECTURES}")
endif() endif()
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
@ -244,7 +244,7 @@ option(USE_PGO_OPTIMIZE "Enable PGO optimization (use profile)")
set(COMMON_FLAG "-pipe -fvisibility=hidden -pthread -fno-builtin-strcmp -fno-builtin-memcmp -mfpmath=sse -fno-operator-names") set(COMMON_FLAG "-pipe -fvisibility=hidden -pthread -fno-builtin-strcmp -fno-builtin-memcmp -mfpmath=sse -fno-operator-names")
if(USE_VTUNE) if(USE_VTUNE)
set(COMMON_FLAG "${COMMON_FLAG} -DENABLE_VTUNE") set(COMMON_FLAG "${COMMON_FLAG} -DENABLE_VTUNE")
endif() endif()
# Remove FORTIFY_SOURCE when compiling as debug, because it spams a lot of warnings on clang due to no optimization. # Remove FORTIFY_SOURCE when compiling as debug, because it spams a lot of warnings on clang due to no optimization.
@ -268,11 +268,11 @@ endif()
set(DEFAULT_WARNINGS "-Wall -Wextra -Wno-attributes -Wno-unused-function -Wno-unused-parameter -Wno-missing-field-initializers -Wno-deprecated-declarations -Wno-format -Wno-format-security -Wno-overloaded-virtual") set(DEFAULT_WARNINGS "-Wall -Wextra -Wno-attributes -Wno-unused-function -Wno-unused-parameter -Wno-missing-field-initializers -Wno-deprecated-declarations -Wno-format -Wno-format-security -Wno-overloaded-virtual")
if (NOT USE_ICC) if (NOT USE_ICC)
set(DEFAULT_WARNINGS "${DEFAULT_WARNINGS} -Wno-unused-value ") set(DEFAULT_WARNINGS "${DEFAULT_WARNINGS} -Wno-unused-value ")
endif() endif()
if (USE_CLANG) if (USE_CLANG)
set(DEFAULT_WARNINGS "${DEFAULT_WARNINGS} -Wno-overloaded-virtual ") set(DEFAULT_WARNINGS "${DEFAULT_WARNINGS} -Wno-overloaded-virtual ")
endif() endif()
if (USE_GCC) if (USE_GCC)
@ -282,85 +282,85 @@ endif()
# -Wstrict-aliasing=n: to fix one day aliasing issue. n=1/2/3 # -Wstrict-aliasing=n: to fix one day aliasing issue. n=1/2/3
if (USE_ICC) if (USE_ICC)
set(AGGRESSIVE_WARNING "-Wstrict-aliasing ") set(AGGRESSIVE_WARNING "-Wstrict-aliasing ")
else() else()
set(AGGRESSIVE_WARNING "-Wstrict-aliasing -Wstrict-overflow=1 ") set(AGGRESSIVE_WARNING "-Wstrict-aliasing -Wstrict-overflow=1 ")
endif() endif()
if (USE_CLANG) if (USE_CLANG)
# -Wno-deprecated-register: glib issue... # -Wno-deprecated-register: glib issue...
set(DEFAULT_WARNINGS "${DEFAULT_WARNINGS} -Wno-deprecated-register -Wno-c++14-extensions") set(DEFAULT_WARNINGS "${DEFAULT_WARNINGS} -Wno-deprecated-register -Wno-c++14-extensions")
set(DBG "-g -fno-omit-frame-pointer") set(DBG "-g -fno-omit-frame-pointer")
elseif (USE_ICC) elseif (USE_ICC)
set(DBG "-g -fno-omit-frame-pointer") set(DBG "-g -fno-omit-frame-pointer")
elseif (USE_GCC) elseif (USE_GCC)
set(DBG "-ggdb3 -fno-omit-frame-pointer") set(DBG "-ggdb3 -fno-omit-frame-pointer")
endif() endif()
if (USE_LTO) if (USE_LTO)
include(ProcessorCount) include(ProcessorCount)
ProcessorCount(ncpu) ProcessorCount(ncpu)
set(LTO_FLAGS "-fuse-linker-plugin -flto=${ncpu}") set(LTO_FLAGS "-fuse-linker-plugin -flto=${ncpu}")
set(DBG "") # not supported with LTO set(DBG "") # not supported with LTO
set(CMAKE_AR /usr/bin/gcc-ar CACHE STRING "Archiver" FORCE) set(CMAKE_AR /usr/bin/gcc-ar CACHE STRING "Archiver" FORCE)
set(CMAKE_RANLIB /usr/bin/gcc-ranlib CACHE STRING "ranlib" FORCE) set(CMAKE_RANLIB /usr/bin/gcc-ranlib CACHE STRING "ranlib" FORCE)
set(CMAKE_NM /usr/bin/gcc-nm CACHE STRING "nm" FORCE) set(CMAKE_NM /usr/bin/gcc-nm CACHE STRING "nm" FORCE)
else() else()
set(LTO_FLAGS "") set(LTO_FLAGS "")
endif() endif()
if (USE_PGO_GENERATE OR USE_PGO_OPTIMIZE) if (USE_PGO_GENERATE OR USE_PGO_OPTIMIZE)
set(PGO_FLAGS "-fprofile-dir=${CMAKE_SOURCE_DIR}/profile") set(PGO_FLAGS "-fprofile-dir=${CMAKE_SOURCE_DIR}/profile")
endif() endif()
if (USE_PGO_GENERATE) if (USE_PGO_GENERATE)
set(PGO_FLAGS "${PGO_FLAGS} -fprofile-generate") set(PGO_FLAGS "${PGO_FLAGS} -fprofile-generate")
endif() endif()
if(USE_PGO_OPTIMIZE) if(USE_PGO_OPTIMIZE)
set(PGO_FLAGS "${PGO_FLAGS} -fprofile-use") set(PGO_FLAGS "${PGO_FLAGS} -fprofile-use")
endif() endif()
if(CMAKE_BUILD_TYPE MATCHES "Debug") if(CMAKE_BUILD_TYPE MATCHES "Debug")
set(DEBUG_FLAG "${DBG} -DPCSX2_DEVBUILD -DPCSX2_DEBUG -D_DEBUG") set(DEBUG_FLAG "${DBG} -DPCSX2_DEVBUILD -DPCSX2_DEBUG -D_DEBUG")
elseif(CMAKE_BUILD_TYPE MATCHES "Devel") elseif(CMAKE_BUILD_TYPE MATCHES "Devel")
set(DEBUG_FLAG "${DBG} -DNDEBUG -DPCSX2_DEVBUILD -D_DEVEL") set(DEBUG_FLAG "${DBG} -DNDEBUG -DPCSX2_DEVBUILD -D_DEVEL")
elseif(CMAKE_BUILD_TYPE MATCHES "Release") elseif(CMAKE_BUILD_TYPE MATCHES "Release")
set(DEBUG_FLAG "-DNDEBUG") set(DEBUG_FLAG "-DNDEBUG")
elseif(CMAKE_BUILD_TYPE MATCHES "Prof") elseif(CMAKE_BUILD_TYPE MATCHES "Prof")
# Keep frame pointer and debug information for profiler tool # Keep frame pointer and debug information for profiler tool
set(DEBUG_FLAG "-g -fno-omit-frame-pointer -DNDEBUG") set(DEBUG_FLAG "-g -fno-omit-frame-pointer -DNDEBUG")
endif() endif()
if (USE_ASAN) if (USE_ASAN)
set(ASAN_FLAG "-fsanitize=address ${DBG} -DASAN_WORKAROUND") set(ASAN_FLAG "-fsanitize=address ${DBG} -DASAN_WORKAROUND")
else() else()
set(ASAN_FLAG "") set(ASAN_FLAG "")
endif() endif()
if(NOT DEFINED OPTIMIZATION_FLAG) if(NOT DEFINED OPTIMIZATION_FLAG)
if (CMAKE_BUILD_TYPE STREQUAL Debug) if (CMAKE_BUILD_TYPE STREQUAL Debug)
if (USE_GCC) if (USE_GCC)
set(OPTIMIZATION_FLAG -Og) set(OPTIMIZATION_FLAG -Og)
else() else()
set(OPTIMIZATION_FLAG -O0) set(OPTIMIZATION_FLAG -O0)
endif() endif()
else() else()
set(OPTIMIZATION_FLAG -O2) set(OPTIMIZATION_FLAG -O2)
endif() endif()
endif() endif()
if (NOT DEFINED PGO) if (NOT DEFINED PGO)
set(PGO "none") set(PGO "none")
set(GCOV_LIBRARIES "") set(GCOV_LIBRARIES "")
else() else()
set(GCOV_LIBRARIES "-lgcov") set(GCOV_LIBRARIES "-lgcov")
endif() endif()
if(USE_CLANG) if(USE_CLANG)
if(TIMETRACE) if(TIMETRACE)
set(COMMON_FLAG "${COMMON_FLAG} -ftime-trace ") set(COMMON_FLAG "${COMMON_FLAG} -ftime-trace ")
endif() endif()
endif() endif()
# Note: -DGTK_DISABLE_DEPRECATED can be used to test a build without gtk deprecated feature. It could be useful to port to a newer API # Note: -DGTK_DISABLE_DEPRECATED can be used to test a build without gtk deprecated feature. It could be useful to port to a newer API
@ -377,15 +377,15 @@ set(DEFAULT_CPP_FLAG "${DEFAULT_GCC_FLAG} -Wno-invalid-offsetof")
# TODO: once we completely clean all flags management, this mess could be cleaned ;) # TODO: once we completely clean all flags management, this mess could be cleaned ;)
### linker flags ### linker flags
if(DEFINED USER_CMAKE_LD_FLAGS) if(DEFINED USER_CMAKE_LD_FLAGS)
message(STATUS "Pcsx2 is very sensible with gcc flags, so use USER_CMAKE_LD_FLAGS at your own risk !!!") message(STATUS "Pcsx2 is very sensible with gcc flags, so use USER_CMAKE_LD_FLAGS at your own risk !!!")
string(STRIP "${USER_CMAKE_LD_FLAGS}" USER_CMAKE_LD_FLAGS) string(STRIP "${USER_CMAKE_LD_FLAGS}" USER_CMAKE_LD_FLAGS)
else() else()
set(USER_CMAKE_LD_FLAGS "") set(USER_CMAKE_LD_FLAGS "")
endif() endif()
# ask the linker to strip the binary # ask the linker to strip the binary
if(CMAKE_BUILD_STRIP) if(CMAKE_BUILD_STRIP)
string(STRIP "${USER_CMAKE_LD_FLAGS} -s" USER_CMAKE_LD_FLAGS) string(STRIP "${USER_CMAKE_LD_FLAGS} -s" USER_CMAKE_LD_FLAGS)
endif() endif()
@ -393,8 +393,8 @@ endif()
# Note CMAKE_C_FLAGS is also send to the linker. # Note CMAKE_C_FLAGS is also send to the linker.
# By default allow build on amd64 machine # By default allow build on amd64 machine
if(DEFINED USER_CMAKE_C_FLAGS) if(DEFINED USER_CMAKE_C_FLAGS)
message(STATUS "Pcsx2 is very sensible with gcc flags, so use USER_CMAKE_C_FLAGS at your own risk !!!") message(STATUS "Pcsx2 is very sensible with gcc flags, so use USER_CMAKE_C_FLAGS at your own risk !!!")
string(STRIP "${USER_CMAKE_C_FLAGS}" CMAKE_C_FLAGS) string(STRIP "${USER_CMAKE_C_FLAGS}" CMAKE_C_FLAGS)
endif() endif()
# Use some default machine flags # Use some default machine flags
string(STRIP "${CMAKE_C_FLAGS} ${DEFAULT_GCC_FLAG}" CMAKE_C_FLAGS) string(STRIP "${CMAKE_C_FLAGS} ${DEFAULT_GCC_FLAG}" CMAKE_C_FLAGS)
@ -404,8 +404,8 @@ string(STRIP "${CMAKE_C_FLAGS} ${DEFAULT_GCC_FLAG}" CMAKE_C_FLAGS)
# Note CMAKE_CXX_FLAGS is also send to the linker. # Note CMAKE_CXX_FLAGS is also send to the linker.
# By default allow build on amd64 machine # By default allow build on amd64 machine
if(DEFINED USER_CMAKE_CXX_FLAGS) if(DEFINED USER_CMAKE_CXX_FLAGS)
message(STATUS "Pcsx2 is very sensible with gcc flags, so use USER_CMAKE_CXX_FLAGS at your own risk !!!") message(STATUS "Pcsx2 is very sensible with gcc flags, so use USER_CMAKE_CXX_FLAGS at your own risk !!!")
string(STRIP "${USER_CMAKE_CXX_FLAGS}" CMAKE_CXX_FLAGS) string(STRIP "${USER_CMAKE_CXX_FLAGS}" CMAKE_CXX_FLAGS)
endif() endif()
# Use some default machine flags # Use some default machine flags
string(STRIP "${CMAKE_CXX_FLAGS} ${DEFAULT_CPP_FLAG}" CMAKE_CXX_FLAGS) string(STRIP "${CMAKE_CXX_FLAGS} ${DEFAULT_CPP_FLAG}" CMAKE_CXX_FLAGS)
@ -417,31 +417,31 @@ string(STRIP "${CMAKE_CXX_FLAGS} ${DEFAULT_CPP_FLAG}" CMAKE_CXX_FLAGS)
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.9) set(CMAKE_OSX_DEPLOYMENT_TARGET 10.9)
if (APPLE AND ${CMAKE_OSX_DEPLOYMENT_TARGET} VERSION_LESS 10.14) if (APPLE AND ${CMAKE_OSX_DEPLOYMENT_TARGET} VERSION_LESS 10.14)
# Older versions of the macOS stdlib don't have operator new(size_t, align_val_t) # Older versions of the macOS stdlib don't have operator new(size_t, align_val_t)
# Disable use of them with this flag # Disable use of them with this flag
# Not great, but also no worse that what we were getting before we turned on C++17 # Not great, but also no worse that what we were getting before we turned on C++17
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-aligned-allocation") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-aligned-allocation")
endif() endif()
# CMake defaults the suffix for modules to .so on macOS but wx tells us that the # CMake defaults the suffix for modules to .so on macOS but wx tells us that the
# extension is .dylib (so that's what we search for) # extension is .dylib (so that's what we search for)
if(APPLE) if(APPLE)
set(CMAKE_SHARED_MODULE_SUFFIX ".dylib") set(CMAKE_SHARED_MODULE_SUFFIX ".dylib")
endif() endif()
if(CMAKE_SYSTEM_NAME MATCHES "Darwin") if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
if(NOT OSX_USE_DEFAULT_SEARCH_PATH) if(NOT OSX_USE_DEFAULT_SEARCH_PATH)
# Hack up the path to prioritize the path to built-in OS libraries to # Hack up the path to prioritize the path to built-in OS libraries to
# increase the chance of not depending on a bunch of copies of them # increase the chance of not depending on a bunch of copies of them
# installed by MacPorts, Fink, Homebrew, etc, and ending up copying # installed by MacPorts, Fink, Homebrew, etc, and ending up copying
# them into the bundle. Since we depend on libraries which are not # them into the bundle. Since we depend on libraries which are not
# part of OS X (wx, etc.), however, don't remove the default path # part of OS X (wx, etc.), however, don't remove the default path
# entirely. This is still kinda evil, since it defeats the user's # entirely. This is still kinda evil, since it defeats the user's
# path settings... # path settings...
# See http://www.cmake.org/cmake/help/v3.0/command/find_program.html # See http://www.cmake.org/cmake/help/v3.0/command/find_program.html
list(APPEND CMAKE_PREFIX_PATH "/usr") list(APPEND CMAKE_PREFIX_PATH "/usr")
endif() endif()
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-dead_strip,-dead_strip_dylibs") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-dead_strip,-dead_strip_dylibs")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,-dead_strip,-dead_strip_dylibs") set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,-dead_strip,-dead_strip_dylibs")
endif() endif()

View File

@ -19,23 +19,23 @@ macro(check_lib var lib)
include_directories(${${var}_INCLUDE}) include_directories(${${var}_INCLUDE})
_internal_message("-- ${var} found pkg") _internal_message("-- ${var} found pkg")
else() else()
find_library(${var}_LIBRARIES ${lib}) find_library(${var}_LIBRARIES ${lib})
if(_arg_list) if(_arg_list)
find_path(${var}_INCLUDE ${_arg_list}) find_path(${var}_INCLUDE ${_arg_list})
else() else()
set(${var}_INCLUDE FALSE) set(${var}_INCLUDE FALSE)
endif() endif()
if(${var}_LIBRARIES AND ${var}_INCLUDE) if(${var}_LIBRARIES AND ${var}_INCLUDE)
include_directories(${${var}_INCLUDE}) include_directories(${${var}_INCLUDE})
_internal_message("-- ${var} found") _internal_message("-- ${var} found")
set(${var}_FOUND 1 CACHE INTERNAL "") set(${var}_FOUND 1 CACHE INTERNAL "")
elseif(${var}_LIBRARIES) elseif(${var}_LIBRARIES)
_internal_message("-- ${var} not found (miss include)") _internal_message("-- ${var} not found (miss include)")
elseif(${var}_INCLUDE) elseif(${var}_INCLUDE)
_internal_message("-- ${var} not found (miss lib)") _internal_message("-- ${var} not found (miss lib)")
else() else()
_internal_message("-- ${var} not found") _internal_message("-- ${var} not found")
endif() endif()
endif() endif()
endmacro() endmacro()

File diff suppressed because it is too large Load Diff

View File

@ -72,110 +72,110 @@ set(HarfBuzz_COMPILE_OPTIONS ${PC_HARFBUZZ_CFLAGS_OTHER})
set(HarfBuzz_VERSION ${PC_HARFBUZZ_CFLAGS_VERSION}) set(HarfBuzz_VERSION ${PC_HARFBUZZ_CFLAGS_VERSION})
find_path(HarfBuzz_INCLUDE_DIR find_path(HarfBuzz_INCLUDE_DIR
NAMES hb.h NAMES hb.h
HINTS ${PC_HARFBUZZ_INCLUDEDIR} ${PC_HARFBUZZ_INCLUDE_DIRS} HINTS ${PC_HARFBUZZ_INCLUDEDIR} ${PC_HARFBUZZ_INCLUDE_DIRS}
PATH_SUFFIXES harfbuzz PATH_SUFFIXES harfbuzz
) )
find_library(HarfBuzz_LIBRARY find_library(HarfBuzz_LIBRARY
NAMES ${HarfBuzz_NAMES} harfbuzz NAMES ${HarfBuzz_NAMES} harfbuzz
HINTS ${PC_HARFBUZZ_LIBDIR} ${PC_HARFBUZZ_LIBRARY_DIRS} HINTS ${PC_HARFBUZZ_LIBDIR} ${PC_HARFBUZZ_LIBRARY_DIRS}
) )
if (HarfBuzz_INCLUDE_DIR AND NOT HarfBuzz_VERSION) if (HarfBuzz_INCLUDE_DIR AND NOT HarfBuzz_VERSION)
if (EXISTS "${HarfBuzz_INCLUDE_DIR}/hb-version.h") if (EXISTS "${HarfBuzz_INCLUDE_DIR}/hb-version.h")
file(READ "${HarfBuzz_INCLUDE_DIR}/hb-version.h" _harfbuzz_version_content) file(READ "${HarfBuzz_INCLUDE_DIR}/hb-version.h" _harfbuzz_version_content)
string(REGEX MATCH "#define +HB_VERSION_STRING +\"([0-9]+\\.[0-9]+\\.[0-9]+)\"" _dummy "${_harfbuzz_version_content}") string(REGEX MATCH "#define +HB_VERSION_STRING +\"([0-9]+\\.[0-9]+\\.[0-9]+)\"" _dummy "${_harfbuzz_version_content}")
set(HarfBuzz_VERSION "${CMAKE_MATCH_1}") set(HarfBuzz_VERSION "${CMAKE_MATCH_1}")
endif () endif ()
endif () endif ()
if ("${HarfBuzz_FIND_VERSION}" VERSION_GREATER "${HarfBuzz_VERSION}") if ("${HarfBuzz_FIND_VERSION}" VERSION_GREATER "${HarfBuzz_VERSION}")
message(FATAL_ERROR "Required version (" ${HarfBuzz_FIND_VERSION} ") is higher than found version (" ${HarfBuzz_VERSION} ")") message(FATAL_ERROR "Required version (" ${HarfBuzz_FIND_VERSION} ") is higher than found version (" ${HarfBuzz_VERSION} ")")
endif () endif ()
# Find components # Find components
if (HarfBuzz_INCLUDE_DIR AND HarfBuzz_LIBRARY) if (HarfBuzz_INCLUDE_DIR AND HarfBuzz_LIBRARY)
set(_HarfBuzz_REQUIRED_LIBS_FOUND ON) set(_HarfBuzz_REQUIRED_LIBS_FOUND ON)
set(HarfBuzz_LIBS_FOUND "HarfBuzz (required): ${HarfBuzz_LIBRARY}") set(HarfBuzz_LIBS_FOUND "HarfBuzz (required): ${HarfBuzz_LIBRARY}")
else () else ()
set(_HarfBuzz_REQUIRED_LIBS_FOUND OFF) set(_HarfBuzz_REQUIRED_LIBS_FOUND OFF)
set(HarfBuzz_LIBS_NOT_FOUND "HarfBuzz (required)") set(HarfBuzz_LIBS_NOT_FOUND "HarfBuzz (required)")
endif () endif ()
if ("ICU" IN_LIST HarfBuzz_FIND_COMPONENTS) if ("ICU" IN_LIST HarfBuzz_FIND_COMPONENTS)
pkg_check_modules(PC_HARFBUZZ_ICU QUIET harfbuzz-icu) pkg_check_modules(PC_HARFBUZZ_ICU QUIET harfbuzz-icu)
set(HarfBuzz_ICU_COMPILE_OPTIONS ${PC_HARFBUZZ_ICU_CFLAGS_OTHER}) set(HarfBuzz_ICU_COMPILE_OPTIONS ${PC_HARFBUZZ_ICU_CFLAGS_OTHER})
find_library(HarfBuzz_ICU_LIBRARY find_library(HarfBuzz_ICU_LIBRARY
NAMES ${HarfBuzz_ICU_NAMES} harfbuzz-icu NAMES ${HarfBuzz_ICU_NAMES} harfbuzz-icu
HINTS ${PC_HARFBUZZ_ICU_LIBDIR} ${PC_HARFBUZZ_ICU_LIBRARY_DIRS} HINTS ${PC_HARFBUZZ_ICU_LIBDIR} ${PC_HARFBUZZ_ICU_LIBRARY_DIRS}
) )
if (HarfBuzz_ICU_LIBRARY) if (HarfBuzz_ICU_LIBRARY)
if (HarfBuzz_FIND_REQUIRED_ICU) if (HarfBuzz_FIND_REQUIRED_ICU)
list(APPEND HarfBuzz_LIBS_FOUND "ICU (required): ${HarfBuzz_ICU_LIBRARY}") list(APPEND HarfBuzz_LIBS_FOUND "ICU (required): ${HarfBuzz_ICU_LIBRARY}")
else () else ()
list(APPEND HarfBuzz_LIBS_FOUND "ICU (optional): ${HarfBuzz_ICU_LIBRARY}") list(APPEND HarfBuzz_LIBS_FOUND "ICU (optional): ${HarfBuzz_ICU_LIBRARY}")
endif () endif ()
else () else ()
if (HarfBuzz_FIND_REQUIRED_ICU) if (HarfBuzz_FIND_REQUIRED_ICU)
set(_HarfBuzz_REQUIRED_LIBS_FOUND OFF) set(_HarfBuzz_REQUIRED_LIBS_FOUND OFF)
list(APPEND HarfBuzz_LIBS_NOT_FOUND "ICU (required)") list(APPEND HarfBuzz_LIBS_NOT_FOUND "ICU (required)")
else () else ()
list(APPEND HarfBuzz_LIBS_NOT_FOUND "ICU (optional)") list(APPEND HarfBuzz_LIBS_NOT_FOUND "ICU (optional)")
endif () endif ()
endif () endif ()
endif () endif ()
if (NOT HarfBuzz_FIND_QUIETLY) if (NOT HarfBuzz_FIND_QUIETLY)
if (HarfBuzz_LIBS_FOUND) if (HarfBuzz_LIBS_FOUND)
message(STATUS "Found the following HarfBuzz libraries:") message(STATUS "Found the following HarfBuzz libraries:")
foreach (found ${HarfBuzz_LIBS_FOUND}) foreach (found ${HarfBuzz_LIBS_FOUND})
message(STATUS " ${found}") message(STATUS " ${found}")
endforeach () endforeach ()
endif () endif ()
if (HarfBuzz_LIBS_NOT_FOUND) if (HarfBuzz_LIBS_NOT_FOUND)
message(STATUS "The following HarfBuzz libraries were not found:") message(STATUS "The following HarfBuzz libraries were not found:")
foreach (found ${HarfBuzz_LIBS_NOT_FOUND}) foreach (found ${HarfBuzz_LIBS_NOT_FOUND})
message(STATUS " ${found}") message(STATUS " ${found}")
endforeach () endforeach ()
endif () endif ()
endif () endif ()
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(HarfBuzz find_package_handle_standard_args(HarfBuzz
FOUND_VAR HarfBuzz_FOUND FOUND_VAR HarfBuzz_FOUND
REQUIRED_VARS HarfBuzz_INCLUDE_DIR HarfBuzz_LIBRARY _HarfBuzz_REQUIRED_LIBS_FOUND REQUIRED_VARS HarfBuzz_INCLUDE_DIR HarfBuzz_LIBRARY _HarfBuzz_REQUIRED_LIBS_FOUND
VERSION_VAR HarfBuzz_VERSION VERSION_VAR HarfBuzz_VERSION
) )
if (HarfBuzz_LIBRARY AND NOT TARGET HarfBuzz::HarfBuzz) if (HarfBuzz_LIBRARY AND NOT TARGET HarfBuzz::HarfBuzz)
add_library(HarfBuzz::HarfBuzz UNKNOWN IMPORTED GLOBAL) add_library(HarfBuzz::HarfBuzz UNKNOWN IMPORTED GLOBAL)
set_target_properties(HarfBuzz::HarfBuzz PROPERTIES set_target_properties(HarfBuzz::HarfBuzz PROPERTIES
IMPORTED_LOCATION "${HarfBuzz_LIBRARY}" IMPORTED_LOCATION "${HarfBuzz_LIBRARY}"
INTERFACE_COMPILE_OPTIONS "${HarfBuzz_COMPILE_OPTIONS}" INTERFACE_COMPILE_OPTIONS "${HarfBuzz_COMPILE_OPTIONS}"
INTERFACE_INCLUDE_DIRECTORIES "${HarfBuzz_INCLUDE_DIR}" INTERFACE_INCLUDE_DIRECTORIES "${HarfBuzz_INCLUDE_DIR}"
) )
endif () endif ()
if (HarfBuzz_ICU_LIBRARY AND NOT TARGET HarfBuzz::ICU) if (HarfBuzz_ICU_LIBRARY AND NOT TARGET HarfBuzz::ICU)
add_library(HarfBuzz::ICU UNKNOWN IMPORTED GLOBAL) add_library(HarfBuzz::ICU UNKNOWN IMPORTED GLOBAL)
set_target_properties(HarfBuzz::ICU PROPERTIES set_target_properties(HarfBuzz::ICU PROPERTIES
IMPORTED_LOCATION "${HarfBuzz_ICU_LIBRARY}" IMPORTED_LOCATION "${HarfBuzz_ICU_LIBRARY}"
INTERFACE_COMPILE_OPTIONS "${HarfBuzz_ICU_COMPILE_OPTIONS}" INTERFACE_COMPILE_OPTIONS "${HarfBuzz_ICU_COMPILE_OPTIONS}"
INTERFACE_INCLUDE_DIRECTORIES "${HarfBuzz_INCLUDE_DIR}" INTERFACE_INCLUDE_DIRECTORIES "${HarfBuzz_INCLUDE_DIR}"
) )
endif () endif ()
mark_as_advanced( mark_as_advanced(
HarfBuzz_INCLUDE_DIR HarfBuzz_INCLUDE_DIR
HarfBuzz_LIBRARY HarfBuzz_LIBRARY
HarfBuzz_ICU_LIBRARY HarfBuzz_ICU_LIBRARY
) )
if (HarfBuzz_FOUND) if (HarfBuzz_FOUND)
set(HarfBuzz_LIBRARIES ${HarfBuzz_LIBRARY} ${HarfBuzz_ICU_LIBRARY}) set(HarfBuzz_LIBRARIES ${HarfBuzz_LIBRARY} ${HarfBuzz_ICU_LIBRARY})
set(HarfBuzz_INCLUDE_DIRS ${HarfBuzz_INCLUDE_DIR}) set(HarfBuzz_INCLUDE_DIRS ${HarfBuzz_INCLUDE_DIR})
endif () endif ()

View File

@ -4,7 +4,7 @@
# LIBC_LIBRARIES - link these to use libc # LIBC_LIBRARIES - link these to use libc
if(LIBC_LIBRARIES) if(LIBC_LIBRARIES)
set(LIBC_FIND_QUIETLY TRUE) set(LIBC_FIND_QUIETLY TRUE)
endif(LIBC_LIBRARIES) endif(LIBC_LIBRARIES)
find_library(libm NAMES m) find_library(libm NAMES m)

View File

@ -20,23 +20,23 @@
# HAVE_PF_RING If a found version of libpcap supports PF_RING # HAVE_PF_RING If a found version of libpcap supports PF_RING
find_path(PCAP_ROOT_DIR find_path(PCAP_ROOT_DIR
NAMES include/pcap.h NAMES include/pcap.h
) )
find_path(PCAP_INCLUDE_DIR find_path(PCAP_INCLUDE_DIR
NAMES pcap.h NAMES pcap.h
HINTS ${PCAP_ROOT_DIR}/include HINTS ${PCAP_ROOT_DIR}/include
) )
find_library(PCAP_LIBRARY find_library(PCAP_LIBRARY
NAMES pcap NAMES pcap
HINTS ${PCAP_ROOT_DIR}/lib HINTS ${PCAP_ROOT_DIR}/lib
) )
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(PCAP DEFAULT_MSG find_package_handle_standard_args(PCAP DEFAULT_MSG
PCAP_LIBRARY PCAP_LIBRARY
PCAP_INCLUDE_DIR PCAP_INCLUDE_DIR
) )
include(CheckCSourceCompiles) include(CheckCSourceCompiles)
@ -46,20 +46,20 @@ set(CMAKE_REQUIRED_LIBRARIES)
# check if linking against libpcap also needs to link against a thread library # check if linking against libpcap also needs to link against a thread library
if (NOT PCAP_LINKS_SOLO) if (NOT PCAP_LINKS_SOLO)
find_package(Threads) find_package(Threads)
if (THREADS_FOUND) if (THREADS_FOUND)
set(CMAKE_REQUIRED_LIBRARIES ${PCAP_LIBRARY} ${CMAKE_THREAD_LIBS_INIT}) set(CMAKE_REQUIRED_LIBRARIES ${PCAP_LIBRARY} ${CMAKE_THREAD_LIBS_INIT})
check_c_source_compiles("int main() { return 0; }" PCAP_NEEDS_THREADS) check_c_source_compiles("int main() { return 0; }" PCAP_NEEDS_THREADS)
set(CMAKE_REQUIRED_LIBRARIES) set(CMAKE_REQUIRED_LIBRARIES)
endif () endif ()
if (THREADS_FOUND AND PCAP_NEEDS_THREADS) if (THREADS_FOUND AND PCAP_NEEDS_THREADS)
set(_tmp ${PCAP_LIBRARY} ${CMAKE_THREAD_LIBS_INIT}) set(_tmp ${PCAP_LIBRARY} ${CMAKE_THREAD_LIBS_INIT})
list(REMOVE_DUPLICATES _tmp) list(REMOVE_DUPLICATES _tmp)
set(PCAP_LIBRARY ${_tmp} set(PCAP_LIBRARY ${_tmp}
CACHE STRING "Libraries needed to link against libpcap" FORCE) CACHE STRING "Libraries needed to link against libpcap" FORCE)
else () else ()
message(FATAL_ERROR "Couldn't determine how to link against libpcap") message(FATAL_ERROR "Couldn't determine how to link against libpcap")
endif () endif ()
endif () endif ()
include(CheckFunctionExists) include(CheckFunctionExists)
@ -68,7 +68,7 @@ check_function_exists(pcap_get_pfring_id HAVE_PF_RING)
set(CMAKE_REQUIRED_LIBRARIES) set(CMAKE_REQUIRED_LIBRARIES)
mark_as_advanced( mark_as_advanced(
PCAP_ROOT_DIR PCAP_ROOT_DIR
PCAP_INCLUDE_DIR PCAP_INCLUDE_DIR
PCAP_LIBRARY PCAP_LIBRARY
) )

View File

@ -21,23 +21,23 @@ find_library(PULSEAUDIO_LIBRARY
) )
if(PULSEAUDIO_INCLUDE_DIR AND EXISTS "${PULSEAUDIO_INCLUDE_DIR}/pulse/version.h") if(PULSEAUDIO_INCLUDE_DIR AND EXISTS "${PULSEAUDIO_INCLUDE_DIR}/pulse/version.h")
file(STRINGS "${PULSEAUDIO_INCLUDE_DIR}/pulse/version.h" pulse_version_str file(STRINGS "${PULSEAUDIO_INCLUDE_DIR}/pulse/version.h" pulse_version_str
REGEX "^#define[\t ]+pa_get_headers_version\\(\\)[\t ]+\\(\".*\"\\)") REGEX "^#define[\t ]+pa_get_headers_version\\(\\)[\t ]+\\(\".*\"\\)")
string(REGEX REPLACE "^.*pa_get_headers_version\\(\\)[\t ]+\\(\"([^\"]*)\"\\).*$" "\\1" string(REGEX REPLACE "^.*pa_get_headers_version\\(\\)[\t ]+\\(\"([^\"]*)\"\\).*$" "\\1"
PULSEAUDIO_VERSION_STRING "${pulse_version_str}") PULSEAUDIO_VERSION_STRING "${pulse_version_str}")
unset(pulse_version_str) unset(pulse_version_str)
endif() endif()
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(PulseAudio find_package_handle_standard_args(PulseAudio
REQUIRED_VARS PULSEAUDIO_LIBRARY PULSEAUDIO_INCLUDE_DIR REQUIRED_VARS PULSEAUDIO_LIBRARY PULSEAUDIO_INCLUDE_DIR
VERSION_VAR PULSEAUDIO_VERSION_STRING VERSION_VAR PULSEAUDIO_VERSION_STRING
) )
if(PULSEAUDIO_FOUND) if(PULSEAUDIO_FOUND)
set(PULSEAUDIO_LIBRARIES ${PULSEAUDIO_LIBRARY}) set(PULSEAUDIO_LIBRARIES ${PULSEAUDIO_LIBRARY})
set(PULSEAUDIO_INCLUDE_DIRS ${PULSEAUDIO_INCLUDE_DIR}) set(PULSEAUDIO_INCLUDE_DIRS ${PULSEAUDIO_INCLUDE_DIR})
endif() endif()
mark_as_advanced(PULSEAUDIO_INCLUDE_DIR PULSEAUDIO_LIBRARY) mark_as_advanced(PULSEAUDIO_INCLUDE_DIR PULSEAUDIO_LIBRARY)

View File

@ -1,27 +1,27 @@
# Find Intel's VTUNE tool # Find Intel's VTUNE tool
# VTUNE_FOUND found Vtune # VTUNE_FOUND found Vtune
# VTUNE_INCLUDE_DIRS include path to jitprofiling.h # VTUNE_INCLUDE_DIRS include path to jitprofiling.h
# VTUNE_LIBRARIES path to vtune libs # VTUNE_LIBRARIES path to vtune libs
find_path(VTUNE_INCLUDE_DIRS NAMES jitprofiling.h PATHS find_path(VTUNE_INCLUDE_DIRS NAMES jitprofiling.h PATHS
/opt/intel/vtune_amplifier_xe_2018/include /opt/intel/vtune_amplifier_xe_2018/include
/opt/intel/vtune_amplifier_xe_2017/include /opt/intel/vtune_amplifier_xe_2017/include
/opt/intel/vtune_amplifier_xe_2016/include /opt/intel/vtune_amplifier_xe_2016/include
) )
if(${PCSX2_TARGET_ARCHITECTURES} MATCHES "i386") if(${PCSX2_TARGET_ARCHITECTURES} MATCHES "i386")
find_library(VTUNE_LIBRARIES NAMES libjitprofiling.a PATHS find_library(VTUNE_LIBRARIES NAMES libjitprofiling.a PATHS
/opt/intel/vtune_amplifier_xe_2018/lib32 /opt/intel/vtune_amplifier_xe_2018/lib32
/opt/intel/vtune_amplifier_xe_2017/lib32 /opt/intel/vtune_amplifier_xe_2017/lib32
/opt/intel/vtune_amplifier_xe_2016/lib32 /opt/intel/vtune_amplifier_xe_2016/lib32
) )
else() else()
find_library(VTUNE_LIBRARIES NAMES libjitprofiling.a PATHS find_library(VTUNE_LIBRARIES NAMES libjitprofiling.a PATHS
/opt/intel/vtune_amplifier_xe_2018/lib64 /opt/intel/vtune_amplifier_xe_2018/lib64
/opt/intel/vtune_amplifier_xe_2017/lib64 /opt/intel/vtune_amplifier_xe_2017/lib64
/opt/intel/vtune_amplifier_xe_2016/lib64 /opt/intel/vtune_amplifier_xe_2016/lib64
) )
endif() endif()
# handle the QUIETLY and REQUIRED arguments and set VTUNE_FOUND to TRUE if # handle the QUIETLY and REQUIRED arguments and set VTUNE_FOUND to TRUE if

View File

@ -31,8 +31,8 @@
include(FeatureSummary) include(FeatureSummary)
set_package_properties(XCB PROPERTIES set_package_properties(XCB PROPERTIES
URL "http://xcb.freedesktop.org/" URL "http://xcb.freedesktop.org/"
DESCRIPTION "X protocol C-language Binding") DESCRIPTION "X protocol C-language Binding")
find_package(PkgConfig) find_package(PkgConfig)
pkg_check_modules(PC_XCB QUIET xcb ${XCB_FIND_COMPONENTS}) pkg_check_modules(PC_XCB QUIET xcb ${XCB_FIND_COMPONENTS})

View File

@ -7,14 +7,14 @@
find_package(PkgConfig) find_package(PkgConfig)
if(PKG_CONFIG_FOUND) if(PKG_CONFIG_FOUND)
pkg_check_modules (LIBSAMPLERATE samplerate) pkg_check_modules (LIBSAMPLERATE samplerate)
list(APPEND LIBSAMPLERATE_INCLUDE_DIRS ${LIBSAMPLERATE_INCLUDEDIR}) list(APPEND LIBSAMPLERATE_INCLUDE_DIRS ${LIBSAMPLERATE_INCLUDEDIR})
endif() endif()
if(NOT LIBSAMPLERATE_FOUND) if(NOT LIBSAMPLERATE_FOUND)
find_path( LIBSAMPLERATE_INCLUDE_DIRS "samplerate.h" find_path( LIBSAMPLERATE_INCLUDE_DIRS "samplerate.h"
PATH_SUFFIXES "samplerate" ) PATH_SUFFIXES "samplerate" )
find_library( LIBSAMPLERATE_LIBRARIES samplerate) find_library( LIBSAMPLERATE_LIBRARIES samplerate)
endif() endif()
# handle the QUIETLY and REQUIRED arguments and set SAMPLERATE_FOUND to TRUE if # handle the QUIETLY and REQUIRED arguments and set SAMPLERATE_FOUND to TRUE if

View File

@ -1,5 +1,5 @@
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# detectOperatingSystem # detectOperatingSystem
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# This function detects on which OS cmake is run and set a flag to control the # This function detects on which OS cmake is run and set a flag to control the
# build process. Supported OS: Linux, MacOSX, Windows # build process. Supported OS: Linux, MacOSX, Windows
@ -7,176 +7,176 @@
# On linux, it also set a flag for specific distribution (ie Fedora) # On linux, it also set a flag for specific distribution (ie Fedora)
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
function(detectOperatingSystem) function(detectOperatingSystem)
if(WIN32) if(WIN32)
set(Windows TRUE PARENT_SCOPE) set(Windows TRUE PARENT_SCOPE)
elseif(UNIX AND APPLE) elseif(UNIX AND APPLE)
# No easy way to filter out iOS. # No easy way to filter out iOS.
message(WARNING "OS X/iOS isn't supported, the build will most likely fail") message(WARNING "OS X/iOS isn't supported, the build will most likely fail")
set(MacOSX TRUE PARENT_SCOPE) set(MacOSX TRUE PARENT_SCOPE)
elseif(UNIX) elseif(UNIX)
if(CMAKE_SYSTEM_NAME MATCHES "Linux") if(CMAKE_SYSTEM_NAME MATCHES "Linux")
set(Linux TRUE PARENT_SCOPE) set(Linux TRUE PARENT_SCOPE)
if (EXISTS /etc/os-release) if (EXISTS /etc/os-release)
# Read the file without CR character # Read the file without CR character
file(STRINGS /etc/os-release OS_RELEASE) file(STRINGS /etc/os-release OS_RELEASE)
if("${OS_RELEASE}" MATCHES "^.*ID=fedora.*$") if("${OS_RELEASE}" MATCHES "^.*ID=fedora.*$")
set(Fedora TRUE PARENT_SCOPE) set(Fedora TRUE PARENT_SCOPE)
message(STATUS "Build Fedora specific") message(STATUS "Build Fedora specific")
elseif("${OS_RELEASE}" MATCHES "^.*ID=.*suse.*$") elseif("${OS_RELEASE}" MATCHES "^.*ID=.*suse.*$")
set(openSUSE TRUE PARENT_SCOPE) set(openSUSE TRUE PARENT_SCOPE)
message(STATUS "Build openSUSE specific") message(STATUS "Build openSUSE specific")
endif() endif()
endif() endif()
elseif(CMAKE_SYSTEM_NAME MATCHES "kFreeBSD") elseif(CMAKE_SYSTEM_NAME MATCHES "kFreeBSD")
set(kFreeBSD TRUE PARENT_SCOPE) set(kFreeBSD TRUE PARENT_SCOPE)
elseif(CMAKE_SYSTEM_NAME STREQUAL "GNU") elseif(CMAKE_SYSTEM_NAME STREQUAL "GNU")
set(GNU TRUE PARENT_SCOPE) set(GNU TRUE PARENT_SCOPE)
endif() endif()
endif() endif()
endfunction() endfunction()
function(get_git_version_info) function(get_git_version_info)
set(PCSX2_WC_TIME 0) set(PCSX2_WC_TIME 0)
set(PCSX2_GIT_REV "") set(PCSX2_GIT_REV "")
if (GIT_FOUND AND EXISTS ${PROJECT_SOURCE_DIR}/.git) if (GIT_FOUND AND EXISTS ${PROJECT_SOURCE_DIR}/.git)
EXECUTE_PROCESS(WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} show -s --format=%ci HEAD EXECUTE_PROCESS(WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} show -s --format=%ci HEAD
OUTPUT_VARIABLE PCSX2_WC_TIME OUTPUT_VARIABLE PCSX2_WC_TIME
OUTPUT_STRIP_TRAILING_WHITESPACE) OUTPUT_STRIP_TRAILING_WHITESPACE)
# Output: "YYYY-MM-DD HH:MM:SS +HHMM" (last part is time zone, offset from UTC) # Output: "YYYY-MM-DD HH:MM:SS +HHMM" (last part is time zone, offset from UTC)
string(REGEX REPLACE "[%:\\-]" "" PCSX2_WC_TIME "${PCSX2_WC_TIME}") string(REGEX REPLACE "[%:\\-]" "" PCSX2_WC_TIME "${PCSX2_WC_TIME}")
string(REGEX REPLACE "([0-9]+) ([0-9]+).*" "\\1\\2" PCSX2_WC_TIME "${PCSX2_WC_TIME}") string(REGEX REPLACE "([0-9]+) ([0-9]+).*" "\\1\\2" PCSX2_WC_TIME "${PCSX2_WC_TIME}")
EXECUTE_PROCESS(WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} describe --always EXECUTE_PROCESS(WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} describe --always
OUTPUT_VARIABLE PCSX2_GIT_REV OUTPUT_VARIABLE PCSX2_GIT_REV
OUTPUT_STRIP_TRAILING_WHITESPACE) OUTPUT_STRIP_TRAILING_WHITESPACE)
endif() endif()
if(PCSX2_GIT_REV) if(PCSX2_GIT_REV)
set(PCSX2_VERSION_LONG "${PCSX2_GIT_REV}") set(PCSX2_VERSION_LONG "${PCSX2_GIT_REV}")
string(REGEX MATCH "[0-9]+\\.[0-9]+(\\.[0-9]+)?(-[a-z][a-z0-9]+)?" PCSX2_VERSION_SHORT "${PCSX2_VERSION_LONG}") string(REGEX MATCH "[0-9]+\\.[0-9]+(\\.[0-9]+)?(-[a-z][a-z0-9]+)?" PCSX2_VERSION_SHORT "${PCSX2_VERSION_LONG}")
else() else()
set(PCSX2_VERSION_LONG "Unknown (git unavailable)") set(PCSX2_VERSION_LONG "Unknown (git unavailable)")
set(PCSX2_VERSION_SHORT "Unknown") set(PCSX2_VERSION_SHORT "Unknown")
endif() endif()
if ("${PCSX2_WC_TIME}" STREQUAL "") if ("${PCSX2_WC_TIME}" STREQUAL "")
set(PCSX2_WC_TIME 0) set(PCSX2_WC_TIME 0)
endif() endif()
set(PCSX2_WC_TIME "${PCSX2_WC_TIME}" PARENT_SCOPE) set(PCSX2_WC_TIME "${PCSX2_WC_TIME}" PARENT_SCOPE)
set(PCSX2_GIT_REV "${PCSX2_GIT_REV}" PARENT_SCOPE) set(PCSX2_GIT_REV "${PCSX2_GIT_REV}" PARENT_SCOPE)
set(PCSX2_VERSION_LONG "${PCSX2_VERSION_LONG}" PARENT_SCOPE) set(PCSX2_VERSION_LONG "${PCSX2_VERSION_LONG}" PARENT_SCOPE)
set(PCSX2_VERSION_SHORT "${PCSX2_VERSION_SHORT}" PARENT_SCOPE) set(PCSX2_VERSION_SHORT "${PCSX2_VERSION_SHORT}" PARENT_SCOPE)
endfunction() endfunction()
function(write_svnrev_h) function(write_svnrev_h)
file(WRITE ${CMAKE_BINARY_DIR}/common/include/svnrev.h "#define SVN_REV ${PCSX2_WC_TIME}ll \n#define SVN_MODS 0\n#define GIT_REV \"${PCSX2_GIT_REV}\"") file(WRITE ${CMAKE_BINARY_DIR}/common/include/svnrev.h "#define SVN_REV ${PCSX2_WC_TIME}ll \n#define SVN_MODS 0\n#define GIT_REV \"${PCSX2_GIT_REV}\"")
endfunction() endfunction()
function(check_compiler_version version_warn version_err) function(check_compiler_version version_warn version_err)
if(CMAKE_COMPILER_IS_GNUCXX) if(CMAKE_COMPILER_IS_GNUCXX)
execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION) execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
string(STRIP "${GCC_VERSION}" GCC_VERSION) string(STRIP "${GCC_VERSION}" GCC_VERSION)
if(GCC_VERSION VERSION_LESS ${version_err}) if(GCC_VERSION VERSION_LESS ${version_err})
message(FATAL_ERROR "PCSX2 doesn't support your old GCC ${GCC_VERSION}! Please upgrade it! message(FATAL_ERROR "PCSX2 doesn't support your old GCC ${GCC_VERSION}! Please upgrade it!
The minimum supported version is ${version_err} but ${version_warn} is warmly recommended") The minimum supported version is ${version_err} but ${version_warn} is warmly recommended")
else() else()
if(GCC_VERSION VERSION_LESS ${version_warn}) if(GCC_VERSION VERSION_LESS ${version_warn})
message(WARNING "PCSX2 will stop supporting GCC ${GCC_VERSION} in the near future. Please upgrade to at least GCC ${version_warn}.") message(WARNING "PCSX2 will stop supporting GCC ${GCC_VERSION} in the near future. Please upgrade to at least GCC ${version_warn}.")
endif() endif()
endif() endif()
set(GCC_VERSION "${GCC_VERSION}" PARENT_SCOPE) set(GCC_VERSION "${GCC_VERSION}" PARENT_SCOPE)
endif() endif()
endfunction() endfunction()
function(check_no_parenthesis_in_path) function(check_no_parenthesis_in_path)
if ("${CMAKE_BINARY_DIR}" MATCHES "[()]" OR "${CMAKE_SOURCE_DIR}" MATCHES "[()]") if ("${CMAKE_BINARY_DIR}" MATCHES "[()]" OR "${CMAKE_SOURCE_DIR}" MATCHES "[()]")
message(FATAL_ERROR "Your path contains some parenthesis. Unfortunately Cmake doesn't support them correctly.\nPlease rename your directory to avoid '(' and ')' characters\n") message(FATAL_ERROR "Your path contains some parenthesis. Unfortunately Cmake doesn't support them correctly.\nPlease rename your directory to avoid '(' and ')' characters\n")
endif() endif()
endfunction() endfunction()
#NOTE: this macro is used to get rid of whitespace and newlines. #NOTE: this macro is used to get rid of whitespace and newlines.
macro(append_flags target flags) macro(append_flags target flags)
if(flags STREQUAL "") if(flags STREQUAL "")
set(flags " ") # set to space to avoid error set(flags " ") # set to space to avoid error
endif() endif()
get_target_property(TEMP ${target} COMPILE_FLAGS) get_target_property(TEMP ${target} COMPILE_FLAGS)
if(TEMP STREQUAL "TEMP-NOTFOUND") if(TEMP STREQUAL "TEMP-NOTFOUND")
set(TEMP "") # set to empty string set(TEMP "") # set to empty string
else() else()
set(TEMP "${TEMP} ") # a space to cleanly separate from existing content set(TEMP "${TEMP} ") # a space to cleanly separate from existing content
endif() endif()
# append our values # append our values
set(TEMP "${TEMP}${flags}") set(TEMP "${TEMP}${flags}")
# fix arg list # fix arg list
set(TEMP2 "") set(TEMP2 "")
foreach(_arg ${TEMP}) foreach(_arg ${TEMP})
set(TEMP2 "${TEMP2} ${_arg}") set(TEMP2 "${TEMP2} ${_arg}")
endforeach() endforeach()
set_target_properties(${target} PROPERTIES COMPILE_FLAGS "${TEMP2}") set_target_properties(${target} PROPERTIES COMPILE_FLAGS "${TEMP2}")
endmacro(append_flags) endmacro(append_flags)
macro(add_pcsx2_plugin lib srcs libs flags) macro(add_pcsx2_plugin lib srcs libs flags)
include_directories(.) include_directories(.)
add_library(${lib} MODULE ${srcs}) add_library(${lib} MODULE ${srcs})
target_link_libraries(${lib} ${libs}) target_link_libraries(${lib} ${libs})
append_flags(${lib} "${flags}") append_flags(${lib} "${flags}")
if(NOT USER_CMAKE_LD_FLAGS STREQUAL "") if(NOT USER_CMAKE_LD_FLAGS STREQUAL "")
target_link_libraries(${lib} "${USER_CMAKE_LD_FLAGS}") target_link_libraries(${lib} "${USER_CMAKE_LD_FLAGS}")
endif(NOT USER_CMAKE_LD_FLAGS STREQUAL "") endif(NOT USER_CMAKE_LD_FLAGS STREQUAL "")
if(PACKAGE_MODE) if(PACKAGE_MODE)
install(TARGETS ${lib} DESTINATION ${CMAKE_INSTALL_LIBDIR}/PCSX2) install(TARGETS ${lib} DESTINATION ${CMAKE_INSTALL_LIBDIR}/PCSX2)
else(PACKAGE_MODE) else(PACKAGE_MODE)
install(TARGETS ${lib} DESTINATION ${CMAKE_SOURCE_DIR}/bin/plugins) install(TARGETS ${lib} DESTINATION ${CMAKE_SOURCE_DIR}/bin/plugins)
endif(PACKAGE_MODE) endif(PACKAGE_MODE)
if (APPLE) if (APPLE)
# Output to app bundle # Output to app bundle
set_target_properties(${lib} PROPERTIES LIBRARY_OUTPUT_DIRECTORY "$<TARGET_FILE_DIR:PCSX2>/plugins") set_target_properties(${lib} PROPERTIES LIBRARY_OUTPUT_DIRECTORY "$<TARGET_FILE_DIR:PCSX2>/plugins")
add_dependencies(pcsx2-postprocess-bundle ${lib}) add_dependencies(pcsx2-postprocess-bundle ${lib})
endif() endif()
endmacro(add_pcsx2_plugin) endmacro(add_pcsx2_plugin)
macro(add_pcsx2_lib lib srcs libs flags) macro(add_pcsx2_lib lib srcs libs flags)
include_directories(.) include_directories(.)
add_library(${lib} STATIC ${srcs}) add_library(${lib} STATIC ${srcs})
target_link_libraries(${lib} ${libs}) target_link_libraries(${lib} ${libs})
append_flags(${lib} "${flags}") append_flags(${lib} "${flags}")
if(NOT USER_CMAKE_LD_FLAGS STREQUAL "") if(NOT USER_CMAKE_LD_FLAGS STREQUAL "")
target_link_libraries(${lib} "${USER_CMAKE_LD_FLAGS}") target_link_libraries(${lib} "${USER_CMAKE_LD_FLAGS}")
endif(NOT USER_CMAKE_LD_FLAGS STREQUAL "") endif(NOT USER_CMAKE_LD_FLAGS STREQUAL "")
endmacro(add_pcsx2_lib) endmacro(add_pcsx2_lib)
macro(add_pcsx2_executable exe srcs libs flags) macro(add_pcsx2_executable exe srcs libs flags)
add_definitions(${flags}) add_definitions(${flags})
include_directories(.) include_directories(.)
add_executable(${exe} ${srcs}) add_executable(${exe} ${srcs})
target_link_libraries(${exe} ${libs}) target_link_libraries(${exe} ${libs})
append_flags(${exe} "${flags}") append_flags(${exe} "${flags}")
if(NOT USER_CMAKE_LD_FLAGS STREQUAL "") if(NOT USER_CMAKE_LD_FLAGS STREQUAL "")
target_link_libraries(${exe} "${USER_CMAKE_LD_FLAGS}") target_link_libraries(${exe} "${USER_CMAKE_LD_FLAGS}")
endif(NOT USER_CMAKE_LD_FLAGS STREQUAL "") endif(NOT USER_CMAKE_LD_FLAGS STREQUAL "")
if(PACKAGE_MODE) if(PACKAGE_MODE)
install(TARGETS ${exe} DESTINATION ${CMAKE_INSTALL_BINDIR}) install(TARGETS ${exe} DESTINATION ${CMAKE_INSTALL_BINDIR})
else(PACKAGE_MODE) else(PACKAGE_MODE)
install(TARGETS ${exe} DESTINATION ${CMAKE_SOURCE_DIR}/bin) install(TARGETS ${exe} DESTINATION ${CMAKE_SOURCE_DIR}/bin)
endif(PACKAGE_MODE) endif(PACKAGE_MODE)
endmacro(add_pcsx2_executable) endmacro(add_pcsx2_executable)
# Helper macro to generate resources on linux (based on glib) # Helper macro to generate resources on linux (based on glib)
macro(add_custom_glib_res out xml prefix) macro(add_custom_glib_res out xml prefix)
set(RESOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/res") set(RESOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/res")
set(RESOURCE_FILES "${ARGN}") set(RESOURCE_FILES "${ARGN}")
# Note: trying to combine --generate-source and --generate-header doesn't work. # Note: trying to combine --generate-source and --generate-header doesn't work.
# It outputs whichever one comes last into the file named by the first # It outputs whichever one comes last into the file named by the first
add_custom_command( add_custom_command(
OUTPUT ${out}.h OUTPUT ${out}.h
COMMAND glib-compile-resources --sourcedir "${RESOURCE_DIR}" --generate-header COMMAND glib-compile-resources --sourcedir "${RESOURCE_DIR}" --generate-header
--c-name ${prefix} "${RESOURCE_DIR}/${xml}" --target=${out}.h --c-name ${prefix} "${RESOURCE_DIR}/${xml}" --target=${out}.h
DEPENDS res/${xml} ${RESOURCE_FILES}) DEPENDS res/${xml} ${RESOURCE_FILES})
add_custom_command( add_custom_command(
OUTPUT ${out}.cpp OUTPUT ${out}.cpp
COMMAND glib-compile-resources --sourcedir "${RESOURCE_DIR}" --generate-source COMMAND glib-compile-resources --sourcedir "${RESOURCE_DIR}" --generate-source
--c-name ${prefix} "${RESOURCE_DIR}/${xml}" --target=${out}.cpp --c-name ${prefix} "${RESOURCE_DIR}/${xml}" --target=${out}.cpp
DEPENDS res/${xml} ${RESOURCE_FILES}) DEPENDS res/${xml} ${RESOURCE_FILES})
endmacro() endmacro()

View File

@ -1,16 +1,16 @@
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# Search all libraries on the system # Search all libraries on the system
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
## Use cmake package to find module ## Use cmake package to find module
if (Linux) if (Linux)
find_package(ALSA) find_package(ALSA)
endif() endif()
find_package(PCAP) find_package(PCAP)
find_package(LibXml2) find_package(LibXml2)
find_package(Freetype) # GS OSD find_package(Freetype) # GS OSD
find_package(Gettext) # translation tool find_package(Gettext) # translation tool
if(EXISTS ${PROJECT_SOURCE_DIR}/.git) if(EXISTS ${PROJECT_SOURCE_DIR}/.git)
find_package(Git) find_package(Git)
endif() endif()
find_package(LibLZMA) find_package(LibLZMA)
@ -30,9 +30,9 @@ find_package(Vtune)
# They do uname -m if missing so only fix for cross compilations. # They do uname -m if missing so only fix for cross compilations.
# http://pkgs.fedoraproject.org/cgit/wxGTK.git/plain/wx-config # http://pkgs.fedoraproject.org/cgit/wxGTK.git/plain/wx-config
if(Fedora AND CMAKE_CROSSCOMPILING) if(Fedora AND CMAKE_CROSSCOMPILING)
set(wxWidgets_CONFIG_OPTIONS --arch ${PCSX2_TARGET_ARCHITECTURES} --unicode=yes) set(wxWidgets_CONFIG_OPTIONS --arch ${PCSX2_TARGET_ARCHITECTURES} --unicode=yes)
else() else()
set(wxWidgets_CONFIG_OPTIONS --unicode=yes) set(wxWidgets_CONFIG_OPTIONS --unicode=yes)
endif() endif()
# I'm removing the version check, because it excludes newer versions and requires specifically 3.0. # I'm removing the version check, because it excludes newer versions and requires specifically 3.0.
@ -41,9 +41,9 @@ endif()
# The wx version must be specified so a mix of gtk2 and gtk3 isn't used # The wx version must be specified so a mix of gtk2 and gtk3 isn't used
# as that can cause compile errors. # as that can cause compile errors.
if(GTK2_API AND NOT APPLE) if(GTK2_API AND NOT APPLE)
list(APPEND wxWidgets_CONFIG_OPTIONS --toolkit=gtk2) list(APPEND wxWidgets_CONFIG_OPTIONS --toolkit=gtk2)
elseif(NOT APPLE) elseif(NOT APPLE)
list(APPEND wxWidgets_CONFIG_OPTIONS --toolkit=gtk3) list(APPEND wxWidgets_CONFIG_OPTIONS --toolkit=gtk3)
endif() endif()
# wx2.8 => /usr/bin/wx-config-2.8 # wx2.8 => /usr/bin/wx-config-2.8
@ -53,37 +53,37 @@ endif()
# lib32-wx3.0 => /usr/bin/wx-config32-3.0 # lib32-wx3.0 => /usr/bin/wx-config32-3.0
# FindwxWidgets only searches for wx-config. # FindwxWidgets only searches for wx-config.
if(CMAKE_CROSSCOMPILING) if(CMAKE_CROSSCOMPILING)
# May need to fix the filenames for lib32-wx3.0. # May need to fix the filenames for lib32-wx3.0.
if(${PCSX2_TARGET_ARCHITECTURES} MATCHES "i386") if(${PCSX2_TARGET_ARCHITECTURES} MATCHES "i386")
if (Fedora AND EXISTS "/usr/bin/wx-config-3.0") if (Fedora AND EXISTS "/usr/bin/wx-config-3.0")
set(wxWidgets_CONFIG_EXECUTABLE "/usr/bin/wx-config-3.0") set(wxWidgets_CONFIG_EXECUTABLE "/usr/bin/wx-config-3.0")
endif() endif()
if (EXISTS "/usr/bin/wx-config32") if (EXISTS "/usr/bin/wx-config32")
set(wxWidgets_CONFIG_EXECUTABLE "/usr/bin/wx-config32") set(wxWidgets_CONFIG_EXECUTABLE "/usr/bin/wx-config32")
endif() endif()
if (EXISTS "/usr/bin/wx-config32-3.0") if (EXISTS "/usr/bin/wx-config32-3.0")
set(wxWidgets_CONFIG_EXECUTABLE "/usr/bin/wx-config32-3.0") set(wxWidgets_CONFIG_EXECUTABLE "/usr/bin/wx-config32-3.0")
endif() endif()
endif() endif()
else() else()
if (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD") if (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
set(wxWidgets_CONFIG_EXECUTABLE "/usr/local/bin/wxgtk3u-3.0-config") set(wxWidgets_CONFIG_EXECUTABLE "/usr/local/bin/wxgtk3u-3.0-config")
endif() endif()
if(EXISTS "/usr/bin/wx-config-3.2") if(EXISTS "/usr/bin/wx-config-3.2")
set(wxWidgets_CONFIG_EXECUTABLE "/usr/bin/wx-config-3.2") set(wxWidgets_CONFIG_EXECUTABLE "/usr/bin/wx-config-3.2")
endif() endif()
if(EXISTS "/usr/bin/wx-config-3.1") if(EXISTS "/usr/bin/wx-config-3.1")
set(wxWidgets_CONFIG_EXECUTABLE "/usr/bin/wx-config-3.1") set(wxWidgets_CONFIG_EXECUTABLE "/usr/bin/wx-config-3.1")
endif() endif()
if(EXISTS "/usr/bin/wx-config-3.0") if(EXISTS "/usr/bin/wx-config-3.0")
set(wxWidgets_CONFIG_EXECUTABLE "/usr/bin/wx-config-3.0") set(wxWidgets_CONFIG_EXECUTABLE "/usr/bin/wx-config-3.0")
endif() endif()
if(EXISTS "/usr/bin/wx-config") if(EXISTS "/usr/bin/wx-config")
set(wxWidgets_CONFIG_EXECUTABLE "/usr/bin/wx-config") set(wxWidgets_CONFIG_EXECUTABLE "/usr/bin/wx-config")
endif() endif()
if(NOT GTK2_API AND EXISTS "/usr/bin/wx-config-gtk3") if(NOT GTK2_API AND EXISTS "/usr/bin/wx-config-gtk3")
set(wxWidgets_CONFIG_EXECUTABLE "/usr/bin/wx-config-gtk3") set(wxWidgets_CONFIG_EXECUTABLE "/usr/bin/wx-config-gtk3")
endif() endif()
endif() endif()
find_package(wxWidgets COMPONENTS base core adv) find_package(wxWidgets COMPONENTS base core adv)
@ -101,57 +101,57 @@ include(FindPulseAudio)
## Use CheckLib package to find module ## Use CheckLib package to find module
include(CheckLib) include(CheckLib)
if(Linux) if(Linux)
check_lib(EGL EGL EGL/egl.h) check_lib(EGL EGL EGL/egl.h)
check_lib(X11_XCB X11-xcb X11/Xlib-xcb.h) check_lib(X11_XCB X11-xcb X11/Xlib-xcb.h)
check_lib(AIO aio libaio.h) check_lib(AIO aio libaio.h)
# There are two udev pkg config files - udev.pc (wrong), libudev.pc (correct) # There are two udev pkg config files - udev.pc (wrong), libudev.pc (correct)
# When cross compiling, pkg-config will be skipped so we have to look for # When cross compiling, pkg-config will be skipped so we have to look for
# udev (it'll automatically be prefixed with lib). But when not cross # udev (it'll automatically be prefixed with lib). But when not cross
# compiling, we have to look for libudev.pc. Argh. Hence the silliness below. # compiling, we have to look for libudev.pc. Argh. Hence the silliness below.
if(CMAKE_CROSSCOMPILING) if(CMAKE_CROSSCOMPILING)
check_lib(LIBUDEV udev libudev.h) check_lib(LIBUDEV udev libudev.h)
else() else()
check_lib(LIBUDEV libudev libudev.h) check_lib(LIBUDEV libudev libudev.h)
endif() endif()
endif() endif()
if(PORTAUDIO_API) if(PORTAUDIO_API)
check_lib(PORTAUDIO portaudio portaudio.h pa_linux_alsa.h) check_lib(PORTAUDIO portaudio portaudio.h pa_linux_alsa.h)
endif() endif()
check_lib(SOUNDTOUCH SoundTouch soundtouch/SoundTouch.h) check_lib(SOUNDTOUCH SoundTouch soundtouch/SoundTouch.h)
if(SDL2_API) if(SDL2_API)
check_lib(SDL2 SDL2 SDL.h PATH_SUFFIXES SDL2) check_lib(SDL2 SDL2 SDL.h PATH_SUFFIXES SDL2)
else() else()
# Tell cmake that we use SDL as a library and not as an application # Tell cmake that we use SDL as a library and not as an application
set(SDL_BUILDING_LIBRARY TRUE) set(SDL_BUILDING_LIBRARY TRUE)
find_package(SDL) find_package(SDL)
endif() endif()
if(UNIX) if(UNIX)
find_package(X11) find_package(X11)
# Most plugins (if not all) and PCSX2 core need gtk2, so set the required flags # Most plugins (if not all) and PCSX2 core need gtk2, so set the required flags
if (GTK2_API) if (GTK2_API)
find_package(GTK2 REQUIRED gtk) find_package(GTK2 REQUIRED gtk)
else() else()
if(CMAKE_CROSSCOMPILING) if(CMAKE_CROSSCOMPILING)
find_package(GTK3 REQUIRED gtk) find_package(GTK3 REQUIRED gtk)
else() else()
check_lib(GTK3 gtk+-3.0 gtk/gtk.h) check_lib(GTK3 gtk+-3.0 gtk/gtk.h)
endif() endif()
endif() endif()
find_package(XCB) find_package(XCB)
endif() endif()
#---------------------------------------- #----------------------------------------
# Use system include # Use system include
#---------------------------------------- #----------------------------------------
if(UNIX) if(UNIX)
if(GTK3_FOUND) if(GTK3_FOUND)
include_directories(${GTK3_INCLUDE_DIRS}) include_directories(${GTK3_INCLUDE_DIRS})
# A lazy solution # A lazy solution
set(GTK2_LIBRARIES ${GTK3_LIBRARIES}) set(GTK2_LIBRARIES ${GTK3_LIBRARIES})
elseif(GTK2_FOUND) elseif(GTK2_FOUND)
include_directories(${GTK2_INCLUDE_DIRS}) include_directories(${GTK2_INCLUDE_DIRS})
endif() endif()
if(X11_FOUND) if(X11_FOUND)
@ -172,7 +172,7 @@ if(JPEG_FOUND)
endif() endif()
if(GLEW_FOUND) if(GLEW_FOUND)
include_directories(${GLEW_INCLUDE_DIR}) include_directories(${GLEW_INCLUDE_DIR})
endif() endif()
if(OPENGL_FOUND) if(OPENGL_FOUND)
@ -184,7 +184,7 @@ if(SDL_FOUND AND NOT SDL2_API)
endif() endif()
if(USE_VTUNE AND VTUNE_FOUND) if(USE_VTUNE AND VTUNE_FOUND)
include_directories(${VTUNE_INCLUDE_DIRS}) include_directories(${VTUNE_INCLUDE_DIRS})
endif() endif()
if(wxWidgets_FOUND) if(wxWidgets_FOUND)
@ -196,11 +196,11 @@ if(PCAP_FOUND)
endif() endif()
if(LIBSAMPLERATE_FOUND) if(LIBSAMPLERATE_FOUND)
include_directories(${LIBSAMPLERATE_INCLUDE_DIR}) include_directories(${LIBSAMPLERATE_INCLUDE_DIR})
endif() endif()
if(PULSEAUDIO_FOUND) if(PULSEAUDIO_FOUND)
include_directories(${PULSEAUDIO_INCLUDE_DIR}) include_directories(${PULSEAUDIO_INCLUDE_DIR})
endif() endif()
if(LIBXML2_FOUND) if(LIBXML2_FOUND)
@ -228,12 +228,13 @@ endif()
#---------------------------------------- #----------------------------------------
# Use project-wide include directories # Use project-wide include directories
#---------------------------------------- #----------------------------------------
include_directories(${CMAKE_SOURCE_DIR}/common/include include_directories(
${CMAKE_SOURCE_DIR}/common/include/Utilities ${CMAKE_SOURCE_DIR}/common/include
${CMAKE_SOURCE_DIR}/common/include/x86emitter ${CMAKE_SOURCE_DIR}/common/include/Utilities
# File generated by Cmake ${CMAKE_SOURCE_DIR}/common/include/x86emitter
${CMAKE_BINARY_DIR}/common/include # File generated by Cmake
) ${CMAKE_BINARY_DIR}/common/include
)
#---------------------------------------- #----------------------------------------
# Check correctness of the parameter # Check correctness of the parameter
@ -245,48 +246,48 @@ WX_vs_SDL()
# Blacklist bad GCC # Blacklist bad GCC
if(GCC_VERSION VERSION_EQUAL "7.0" OR GCC_VERSION VERSION_EQUAL "7.1") if(GCC_VERSION VERSION_EQUAL "7.0" OR GCC_VERSION VERSION_EQUAL "7.1")
GCC7_BUG() GCC7_BUG()
endif() endif()
if((GCC_VERSION VERSION_EQUAL "9.0" OR GCC_VERSION VERSION_GREATER "9.0") AND GCC_VERSION LESS "9.2") if((GCC_VERSION VERSION_EQUAL "9.0" OR GCC_VERSION VERSION_GREATER "9.0") AND GCC_VERSION LESS "9.2")
message(WARNING " message(WARNING "
It looks like you are compiling with 9.0.x or 9.1.x. Using these versions is not recommended, It looks like you are compiling with 9.0.x or 9.1.x. Using these versions is not recommended,
as there is a bug known to cause the compiler to segfault while compiling. See patch as there is a bug known to cause the compiler to segfault while compiling. See patch
https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=275ab714637a64672c6630cfd744af2c70957d5a https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=275ab714637a64672c6630cfd744af2c70957d5a
Even with that patch, compiling with LTO may still segfault. Use at your own risk! Even with that patch, compiling with LTO may still segfault. Use at your own risk!
This text being in a compile log in an open issue may cause it to be closed.") This text being in a compile log in an open issue may cause it to be closed.")
endif() endif()
find_package(fmt "7.1.3" QUIET) find_package(fmt "7.1.3" QUIET)
if(NOT fmt_FOUND) if(NOT fmt_FOUND)
if(EXISTS "${CMAKE_SOURCE_DIR}/3rdparty/fmt/fmt/CMakeLists.txt") if(EXISTS "${CMAKE_SOURCE_DIR}/3rdparty/fmt/fmt/CMakeLists.txt")
message(STATUS "No system fmt was found. Using bundled") message(STATUS "No system fmt was found. Using bundled")
add_subdirectory(3rdparty/fmt/fmt) add_subdirectory(3rdparty/fmt/fmt)
else() else()
message(FATAL_ERROR "No system or bundled fmt was found") message(FATAL_ERROR "No system or bundled fmt was found")
endif() endif()
else() else()
message(STATUS "Found fmt: ${fmt_VERSION}") message(STATUS "Found fmt: ${fmt_VERSION}")
endif() endif()
if(USE_SYSTEM_YAML) if(USE_SYSTEM_YAML)
find_package(yaml-cpp "0.6.3" QUIET) find_package(yaml-cpp "0.6.3" QUIET)
if(NOT yaml-cpp_FOUND) if(NOT yaml-cpp_FOUND)
message(STATUS "No system yaml-cpp was found") message(STATUS "No system yaml-cpp was found")
set(USE_SYSTEM_YAML OFF) set(USE_SYSTEM_YAML OFF)
else() else()
message(STATUS "Found yaml-cpp: ${yaml-cpp_VERSION}") message(STATUS "Found yaml-cpp: ${yaml-cpp_VERSION}")
message(STATUS "Note that the latest release of yaml-cpp is very outdated, and the bundled submodule in the repo has over a year of bug fixes and as such is preferred.") message(STATUS "Note that the latest release of yaml-cpp is very outdated, and the bundled submodule in the repo has over a year of bug fixes and as such is preferred.")
endif() endif()
endif() endif()
if(NOT USE_SYSTEM_YAML) if(NOT USE_SYSTEM_YAML)
if(EXISTS "${CMAKE_SOURCE_DIR}/3rdparty/yaml-cpp/yaml-cpp/CMakeLists.txt") if(EXISTS "${CMAKE_SOURCE_DIR}/3rdparty/yaml-cpp/yaml-cpp/CMakeLists.txt")
message(STATUS "Using bundled yaml-cpp") message(STATUS "Using bundled yaml-cpp")
add_subdirectory(3rdparty/yaml-cpp/yaml-cpp EXCLUDE_FROM_ALL) add_subdirectory(3rdparty/yaml-cpp/yaml-cpp EXCLUDE_FROM_ALL)
else() else()
message(FATAL_ERROR "No bundled yaml-cpp was found") message(FATAL_ERROR "No bundled yaml-cpp was found")
endif() endif()
endif() endif()
add_subdirectory(3rdparty/libchdr/libchdr EXCLUDE_FROM_ALL) add_subdirectory(3rdparty/libchdr/libchdr EXCLUDE_FROM_ALL)
@ -301,61 +302,61 @@ set(msg_dep_common_libs "check these libraries -> wxWidgets (>=3.0), aio")
set(msg_dep_pcsx2 "check these libraries -> wxWidgets (>=3.0), gtk2, zlib (>=1.2.4), pcsx2 common libs") set(msg_dep_pcsx2 "check these libraries -> wxWidgets (>=3.0), gtk2, zlib (>=1.2.4), pcsx2 common libs")
macro(print_dep str dep) macro(print_dep str dep)
if (PACKAGE_MODE) if (PACKAGE_MODE)
message(FATAL_ERROR "${str}:${dep}") message(FATAL_ERROR "${str}:${dep}")
else() else()
message(STATUS "${str}:${dep}") message(STATUS "${str}:${dep}")
endif() endif()
endmacro(print_dep) endmacro(print_dep)
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# Pcsx2 core & common libs # Pcsx2 core & common libs
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# Check for additional dependencies. # Check for additional dependencies.
# If all dependencies are available, including OS, build it # If all dependencies are available, including OS, build it
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
if (GTK2_FOUND OR GTK3_FOUND) if (GTK2_FOUND OR GTK3_FOUND)
set(GTKn_FOUND TRUE) set(GTKn_FOUND TRUE)
elseif(APPLE) # Not we have but that we don't change all if(gtkn) entries elseif(APPLE) # Not we have but that we don't change all if(gtkn) entries
set(GTKn_FOUND TRUE) set(GTKn_FOUND TRUE)
else() else()
set(GTKn_FOUND FALSE) set(GTKn_FOUND FALSE)
endif() endif()
if(SDL_FOUND OR SDL2_FOUND) if(SDL_FOUND OR SDL2_FOUND)
set(SDLn_FOUND TRUE) set(SDLn_FOUND TRUE)
else() else()
set(SDLn_FOUND FALSE) set(SDLn_FOUND FALSE)
endif() endif()
if(wxWidgets_FOUND) if(wxWidgets_FOUND)
set(common_libs TRUE) set(common_libs TRUE)
elseif(NOT EXISTS "${CMAKE_SOURCE_DIR}/common/src") elseif(NOT EXISTS "${CMAKE_SOURCE_DIR}/common/src")
set(common_libs FALSE) set(common_libs FALSE)
else() else()
set(common_libs FALSE) set(common_libs FALSE)
print_dep("Skip build of common libraries: missing dependencies" "${msg_dep_common_libs}") print_dep("Skip build of common libraries: missing dependencies" "${msg_dep_common_libs}")
endif() endif()
# Common dependancy # Common dependancy
if(wxWidgets_FOUND AND ZLIB_FOUND AND common_libs AND NOT (Linux AND NOT AIO_FOUND)) if(wxWidgets_FOUND AND ZLIB_FOUND AND common_libs AND NOT (Linux AND NOT AIO_FOUND))
if(OPENGL_FOUND AND X11_FOUND AND GTKn_FOUND AND ZLIB_FOUND AND PNG_FOUND AND FREETYPE_FOUND AND LIBLZMA_FOUND AND ((EGL_FOUND AND X11_XCB_FOUND) OR APPLE)) if(OPENGL_FOUND AND X11_FOUND AND GTKn_FOUND AND ZLIB_FOUND AND PNG_FOUND AND FREETYPE_FOUND AND LIBLZMA_FOUND AND ((EGL_FOUND AND X11_XCB_FOUND) OR APPLE))
set(pcsx2_core TRUE) set(pcsx2_core TRUE)
else() else()
print_dep("Skip build of pcsx2 core: missing dependencies" "${msg_dep_pcsx2}") print_dep("Skip build of pcsx2 core: missing dependencies" "${msg_dep_pcsx2}")
set(pcsx2_core FALSE) set(pcsx2_core FALSE)
endif() endif()
elseif(NOT EXISTS "${CMAKE_SOURCE_DIR}/pcsx2") elseif(NOT EXISTS "${CMAKE_SOURCE_DIR}/pcsx2")
set(pcsx2_core FALSE) set(pcsx2_core FALSE)
else() else()
set(pcsx2_core FALSE) set(pcsx2_core FALSE)
print_dep("Skip build of pcsx2 core: missing dependencies" "${msg_dep_pcsx2}") print_dep("Skip build of pcsx2 core: missing dependencies" "${msg_dep_pcsx2}")
endif() endif()
# Linux, BSD, use gtk2, but not OSX # Linux, BSD, use gtk2, but not OSX
if(UNIX AND pcsx2_core AND NOT GTKn_FOUND AND NOT APPLE) if(UNIX AND pcsx2_core AND NOT GTKn_FOUND AND NOT APPLE)
set(pcsx2_core FALSE) set(pcsx2_core FALSE)
print_dep("Skip build of pcsx2 core: missing dependencies" "${msg_dep_pcsx2}") print_dep("Skip build of pcsx2 core: missing dependencies" "${msg_dep_pcsx2}")
endif() endif()

View File

@ -32,41 +32,41 @@
set(archdetect_c_code " set(archdetect_c_code "
#if defined(__arm__) || defined(__TARGET_ARCH_ARM) #if defined(__arm__) || defined(__TARGET_ARCH_ARM)
#if defined(__ARM_ARCH_7__) \\ #if defined(__ARM_ARCH_7__) \\
|| defined(__ARM_ARCH_7A__) \\ || defined(__ARM_ARCH_7A__) \\
|| defined(__ARM_ARCH_7R__) \\ || defined(__ARM_ARCH_7R__) \\
|| defined(__ARM_ARCH_7M__) \\ || defined(__ARM_ARCH_7M__) \\
|| (defined(__TARGET_ARCH_ARM) && __TARGET_ARCH_ARM-0 >= 7) || (defined(__TARGET_ARCH_ARM) && __TARGET_ARCH_ARM-0 >= 7)
#error cmake_ARCH armv7 #error cmake_ARCH armv7
#elif defined(__ARM_ARCH_6__) \\ #elif defined(__ARM_ARCH_6__) \\
|| defined(__ARM_ARCH_6J__) \\ || defined(__ARM_ARCH_6J__) \\
|| defined(__ARM_ARCH_6T2__) \\ || defined(__ARM_ARCH_6T2__) \\
|| defined(__ARM_ARCH_6Z__) \\ || defined(__ARM_ARCH_6Z__) \\
|| defined(__ARM_ARCH_6K__) \\ || defined(__ARM_ARCH_6K__) \\
|| defined(__ARM_ARCH_6ZK__) \\ || defined(__ARM_ARCH_6ZK__) \\
|| defined(__ARM_ARCH_6M__) \\ || defined(__ARM_ARCH_6M__) \\
|| (defined(__TARGET_ARCH_ARM) && __TARGET_ARCH_ARM-0 >= 6) || (defined(__TARGET_ARCH_ARM) && __TARGET_ARCH_ARM-0 >= 6)
#error cmake_ARCH armv6 #error cmake_ARCH armv6
#elif defined(__ARM_ARCH_5TEJ__) \\ #elif defined(__ARM_ARCH_5TEJ__) \\
|| (defined(__TARGET_ARCH_ARM) && __TARGET_ARCH_ARM-0 >= 5) || (defined(__TARGET_ARCH_ARM) && __TARGET_ARCH_ARM-0 >= 5)
#error cmake_ARCH armv5 #error cmake_ARCH armv5
#else #else
#error cmake_ARCH arm #error cmake_ARCH arm
#endif #endif
#elif defined(__i386) || defined(__i386__) || defined(_M_IX86) #elif defined(__i386) || defined(__i386__) || defined(_M_IX86)
#error cmake_ARCH i386 #error cmake_ARCH i386
#elif defined(__x86_64) || defined(__x86_64__) || defined(__amd64) || defined(_M_X64) #elif defined(__x86_64) || defined(__x86_64__) || defined(__amd64) || defined(_M_X64)
#error cmake_ARCH x86_64 #error cmake_ARCH x86_64
#elif defined(__ia64) || defined(__ia64__) || defined(_M_IA64) #elif defined(__ia64) || defined(__ia64__) || defined(_M_IA64)
#error cmake_ARCH ia64 #error cmake_ARCH ia64
#elif defined(__ppc__) || defined(__ppc) || defined(__powerpc__) \\ #elif defined(__ppc__) || defined(__ppc) || defined(__powerpc__) \\
|| defined(_ARCH_COM) || defined(_ARCH_PWR) || defined(_ARCH_PPC) \\ || defined(_ARCH_COM) || defined(_ARCH_PWR) || defined(_ARCH_PPC) \\
|| defined(_M_MPPC) || defined(_M_PPC) || defined(_M_MPPC) || defined(_M_PPC)
#if defined(__ppc64__) || defined(__powerpc64__) || defined(__64BIT__) #if defined(__ppc64__) || defined(__powerpc64__) || defined(__64BIT__)
#error cmake_ARCH ppc64 #error cmake_ARCH ppc64
#else #else
#error cmake_ARCH ppc #error cmake_ARCH ppc
#endif #endif
#endif #endif
#error cmake_ARCH unknown #error cmake_ARCH unknown
@ -76,94 +76,94 @@ set(archdetect_c_code "
# will be treated as invalid architectures since they are no longer supported by Apple # will be treated as invalid architectures since they are no longer supported by Apple
function(target_architecture output_var) function(target_architecture output_var)
if(APPLE AND CMAKE_OSX_ARCHITECTURES) if(APPLE AND CMAKE_OSX_ARCHITECTURES)
# On OS X we use CMAKE_OSX_ARCHITECTURES *if* it was set # On OS X we use CMAKE_OSX_ARCHITECTURES *if* it was set
# First let's normalize the order of the values # First let's normalize the order of the values
# Note that it's not possible to compile PowerPC applications if you are using # Note that it's not possible to compile PowerPC applications if you are using
# the OS X SDK version 10.6 or later - you'll need 10.4/10.5 for that, so we # the OS X SDK version 10.6 or later - you'll need 10.4/10.5 for that, so we
# disable it by default # disable it by default
# See this page for more information: # See this page for more information:
# http://stackoverflow.com/questions/5333490/how-can-we-restore-ppc-ppc64-as-well-as-full-10-4-10-5-sdk-support-to-xcode-4 # http://stackoverflow.com/questions/5333490/how-can-we-restore-ppc-ppc64-as-well-as-full-10-4-10-5-sdk-support-to-xcode-4
# Architecture defaults to i386 or ppc on OS X 10.5 and earlier, depending on the CPU type detected at runtime. # Architecture defaults to i386 or ppc on OS X 10.5 and earlier, depending on the CPU type detected at runtime.
# On OS X 10.6+ the default is x86_64 if the CPU supports it, i386 otherwise. # On OS X 10.6+ the default is x86_64 if the CPU supports it, i386 otherwise.
LIST(LENGTH CMAKE_OSX_ARCHITECTURES osx_arch_num) LIST(LENGTH CMAKE_OSX_ARCHITECTURES osx_arch_num)
if(NOT (osx_arch_num EQUAL 1)) if(NOT (osx_arch_num EQUAL 1))
message(FATAL_ERROR "Currently ${CMAKE_PROJECT_NAME} does not support multiple architectures in CMAKE_OSX_ARCHITECTURES") message(FATAL_ERROR "Currently ${CMAKE_PROJECT_NAME} does not support multiple architectures in CMAKE_OSX_ARCHITECTURES")
endif() endif()
foreach(osx_arch ${CMAKE_OSX_ARCHITECTURES}) foreach(osx_arch ${CMAKE_OSX_ARCHITECTURES})
if("${osx_arch}" STREQUAL "ppc" AND ppc_support) if("${osx_arch}" STREQUAL "ppc" AND ppc_support)
set(osx_arch_ppc TRUE) set(osx_arch_ppc TRUE)
elseif("${osx_arch}" STREQUAL "i386") elseif("${osx_arch}" STREQUAL "i386")
set(osx_arch_i386 TRUE) set(osx_arch_i386 TRUE)
elseif("${osx_arch}" STREQUAL "x86_64") elseif("${osx_arch}" STREQUAL "x86_64")
set(osx_arch_x86_64 TRUE) set(osx_arch_x86_64 TRUE)
elseif("${osx_arch}" STREQUAL "ppc64" AND ppc_support) elseif("${osx_arch}" STREQUAL "ppc64" AND ppc_support)
set(osx_arch_ppc64 TRUE) set(osx_arch_ppc64 TRUE)
else() else()
message(FATAL_ERROR "Invalid OS X arch name: ${osx_arch}") message(FATAL_ERROR "Invalid OS X arch name: ${osx_arch}")
endif() endif()
endforeach() endforeach()
# Now add all the architectures in our normalized order # Now add all the architectures in our normalized order
if(osx_arch_ppc) if(osx_arch_ppc)
list(APPEND ARCH ppc) list(APPEND ARCH ppc)
endif() endif()
if(osx_arch_i386) if(osx_arch_i386)
list(APPEND ARCH i386) list(APPEND ARCH i386)
endif() endif()
if(osx_arch_x86_64) if(osx_arch_x86_64)
list(APPEND ARCH x86_64) list(APPEND ARCH x86_64)
endif() endif()
if(osx_arch_ppc64) if(osx_arch_ppc64)
list(APPEND ARCH ppc64) list(APPEND ARCH ppc64)
endif() endif()
LIST(LENGTH ARCH osx_arch_num) LIST(LENGTH ARCH osx_arch_num)
if(osx_arch_num LESS 1) if(osx_arch_num LESS 1)
message(FATAL_ERROR "Invalid CMAKE_OSX_ARCHITECTURES: ${CMAKE_OSX_ARCHITECTURES}") message(FATAL_ERROR "Invalid CMAKE_OSX_ARCHITECTURES: ${CMAKE_OSX_ARCHITECTURES}")
endif() endif()
else() else()
file(WRITE "${CMAKE_BINARY_DIR}/arch.c" "${archdetect_c_code}") file(WRITE "${CMAKE_BINARY_DIR}/arch.c" "${archdetect_c_code}")
enable_language(C) enable_language(C)
# Detect the architecture in a rather creative way... # Detect the architecture in a rather creative way...
# This compiles a small C program which is a series of ifdefs that selects a # This compiles a small C program which is a series of ifdefs that selects a
# particular #error preprocessor directive whose message string contains the # particular #error preprocessor directive whose message string contains the
# target architecture. The program will always fail to compile (both because # target architecture. The program will always fail to compile (both because
# file is not a valid C program, and obviously because of the presence of the # file is not a valid C program, and obviously because of the presence of the
# #error preprocessor directives... but by exploiting the preprocessor in this # #error preprocessor directives... but by exploiting the preprocessor in this
# way, we can detect the correct target architecture even when cross-compiling, # way, we can detect the correct target architecture even when cross-compiling,
# since the program itself never needs to be run (only the compiler/preprocessor) # since the program itself never needs to be run (only the compiler/preprocessor)
try_run( try_run(
run_result_unused run_result_unused
compile_result_unused compile_result_unused
"${CMAKE_BINARY_DIR}" "${CMAKE_BINARY_DIR}"
"${CMAKE_BINARY_DIR}/arch.c" "${CMAKE_BINARY_DIR}/arch.c"
COMPILE_OUTPUT_VARIABLE ARCH COMPILE_OUTPUT_VARIABLE ARCH
CMAKE_FLAGS CMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES} CMAKE_FLAGS CMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES}
) )
# Parse the architecture name from the compiler output # Parse the architecture name from the compiler output
string(REGEX MATCH "cmake_ARCH ([a-zA-Z0-9_]+)" ARCH "${ARCH}") string(REGEX MATCH "cmake_ARCH ([a-zA-Z0-9_]+)" ARCH "${ARCH}")
# Get rid of the value marker leaving just the architecture name # Get rid of the value marker leaving just the architecture name
string(REPLACE "cmake_ARCH " "" ARCH "${ARCH}") string(REPLACE "cmake_ARCH " "" ARCH "${ARCH}")
# If we are compiling with an unknown architecture this variable should # If we are compiling with an unknown architecture this variable should
# already be set to "unknown" but in the case that it's empty (i.e. due # already be set to "unknown" but in the case that it's empty (i.e. due
# to a typo in the code), then set it to unknown # to a typo in the code), then set it to unknown
if (NOT ARCH) if (NOT ARCH)
set(ARCH unknown) set(ARCH unknown)
endif() endif()
endif() endif()
set(${output_var} "${ARCH}" PARENT_SCOPE) set(${output_var} "${ARCH}" PARENT_SCOPE)
endfunction() endfunction()

View File

@ -33,70 +33,70 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
MACRO(GETTEXT_CREATE_TRANSLATIONS_PCSX2 _potFile _firstPoFileArg) MACRO(GETTEXT_CREATE_TRANSLATIONS_PCSX2 _potFile _firstPoFileArg)
# make it a real variable, so we can modify it here # make it a real variable, so we can modify it here
SET(_firstPoFile "${_firstPoFileArg}") SET(_firstPoFile "${_firstPoFileArg}")
SET(_gmoFiles) SET(_gmoFiles)
GET_FILENAME_COMPONENT(_potBasename ${_potFile} NAME_WE) GET_FILENAME_COMPONENT(_potBasename ${_potFile} NAME_WE)
GET_FILENAME_COMPONENT(_absPotFile ${_potFile} ABSOLUTE) GET_FILENAME_COMPONENT(_absPotFile ${_potFile} ABSOLUTE)
SET(_addToAll) SET(_addToAll)
IF(${_firstPoFile} STREQUAL "ALL") IF(${_firstPoFile} STREQUAL "ALL")
SET(_addToAll "ALL") SET(_addToAll "ALL")
SET(_firstPoFile) SET(_firstPoFile)
ENDIF(${_firstPoFile} STREQUAL "ALL") ENDIF(${_firstPoFile} STREQUAL "ALL")
FOREACH (_currentPoFile ${_firstPoFile} ${ARGN}) FOREACH (_currentPoFile ${_firstPoFile} ${ARGN})
GET_FILENAME_COMPONENT(_absFile ${_currentPoFile} ABSOLUTE) GET_FILENAME_COMPONENT(_absFile ${_currentPoFile} ABSOLUTE)
GET_FILENAME_COMPONENT(_abs_PATH ${_absFile} PATH) GET_FILENAME_COMPONENT(_abs_PATH ${_absFile} PATH)
GET_FILENAME_COMPONENT(_gmoBase ${_absFile} NAME_WE) GET_FILENAME_COMPONENT(_gmoBase ${_absFile} NAME_WE)
GET_FILENAME_COMPONENT(_lang ${_abs_PATH} NAME_WE) GET_FILENAME_COMPONENT(_lang ${_abs_PATH} NAME_WE)
SET(_gmoFile ${CMAKE_BINARY_DIR}/${_lang}__${_gmoBase}.gmo) SET(_gmoFile ${CMAKE_BINARY_DIR}/${_lang}__${_gmoBase}.gmo)
IF (APPLE) IF (APPLE)
# CMake doesn't support generator expressions as the OUTPUT of a custom command # CMake doesn't support generator expressions as the OUTPUT of a custom command
# Instead, use ${_gmoFile} to detect changes, and output to the bundle as a side effect # Instead, use ${_gmoFile} to detect changes, and output to the bundle as a side effect
# In addition, we have have to preprocess the po files to remove mnemonics: # In addition, we have have to preprocess the po files to remove mnemonics:
# On Windows, menu items have "mnemonics", the items with a letter underlined that you can use with alt to select menu items. MacOS doesn't do this. # On Windows, menu items have "mnemonics", the items with a letter underlined that you can use with alt to select menu items. MacOS doesn't do this.
# Some languages don't use easily-typable characters, so it's common to add a dedicated character for the mnemonic (e.g. in Japanese on Windows, the File menu would be "ファイル(&F)"). # Some languages don't use easily-typable characters, so it's common to add a dedicated character for the mnemonic (e.g. in Japanese on Windows, the File menu would be "ファイル(&F)").
# On MacOS, these extra letters in parentheses are useless and should be avoided. # On MacOS, these extra letters in parentheses are useless and should be avoided.
SET(_mnemonicless "${CMAKE_BINARY_DIR}/${_lang}__${_gmoBase}.nomnemonic.po") SET(_mnemonicless "${CMAKE_BINARY_DIR}/${_lang}__${_gmoBase}.nomnemonic.po")
SET(_extraCommands SET(_extraCommands
COMMAND sed -e "\"s/[(]&[A-Za-z][)]//g\"" "${_absFile}" > "${_mnemonicless}" COMMAND sed -e "\"s/[(]&[A-Za-z][)]//g\"" "${_absFile}" > "${_mnemonicless}"
COMMAND ${CMAKE_COMMAND} -E make_directory "$<TARGET_FILE_DIR:PCSX2>/../Resources/${_lang}/" COMMAND ${CMAKE_COMMAND} -E make_directory "$<TARGET_FILE_DIR:PCSX2>/../Resources/${_lang}/"
COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o "$<TARGET_FILE_DIR:PCSX2>/../Resources/${_lang}/${_potBasename}.mo" ${_mnemonicless}) COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o "$<TARGET_FILE_DIR:PCSX2>/../Resources/${_lang}/${_potBasename}.mo" ${_mnemonicless})
ELSE (APPLE) ELSE (APPLE)
SET(_extraCommands) SET(_extraCommands)
ENDIF (APPLE) ENDIF (APPLE)
IF (_currentPoFile MATCHES "\\.git") IF (_currentPoFile MATCHES "\\.git")
continue() continue()
ENDIF (_currentPoFile MATCHES "\\.git") ENDIF (_currentPoFile MATCHES "\\.git")
IF (CMAKE_BUILD_PO) IF (CMAKE_BUILD_PO)
ADD_CUSTOM_COMMAND( OUTPUT ${_gmoFile} ADD_CUSTOM_COMMAND( OUTPUT ${_gmoFile}
COMMAND ${GETTEXT_MSGMERGE_EXECUTABLE} --quiet --update --backup=none -s ${_absFile} ${_absPotFile} COMMAND ${GETTEXT_MSGMERGE_EXECUTABLE} --quiet --update --backup=none -s ${_absFile} ${_absPotFile}
COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${_gmoFile} ${_absFile} COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${_gmoFile} ${_absFile}
${_extraCommands} ${_extraCommands}
DEPENDS ${_absPotFile} ${_absFile} ) DEPENDS ${_absPotFile} ${_absFile} )
ELSE (CMAKE_BUILD_PO) ELSE (CMAKE_BUILD_PO)
ADD_CUSTOM_COMMAND( OUTPUT ${_gmoFile} ADD_CUSTOM_COMMAND( OUTPUT ${_gmoFile}
COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${_gmoFile} ${_absFile} COMMAND ${GETTEXT_MSGFMT_EXECUTABLE} -o ${_gmoFile} ${_absFile}
${_extraCommands} ${_extraCommands}
DEPENDS ${_absPotFile} ${_absFile} ) DEPENDS ${_absPotFile} ${_absFile} )
ENDIF (CMAKE_BUILD_PO) ENDIF (CMAKE_BUILD_PO)
IF (PACKAGE_MODE) IF (PACKAGE_MODE)
INSTALL(FILES ${_gmoFile} DESTINATION ${CMAKE_INSTALL_LOCALEDIR}/${_lang}/LC_MESSAGES RENAME ${_potBasename}.mo) INSTALL(FILES ${_gmoFile} DESTINATION ${CMAKE_INSTALL_LOCALEDIR}/${_lang}/LC_MESSAGES RENAME ${_potBasename}.mo)
ELSE (PACKAGE_MODE) ELSE (PACKAGE_MODE)
INSTALL(FILES ${_gmoFile} DESTINATION ${CMAKE_SOURCE_DIR}/bin/Langs/${_lang} RENAME ${_potBasename}.mo) INSTALL(FILES ${_gmoFile} DESTINATION ${CMAKE_SOURCE_DIR}/bin/Langs/${_lang} RENAME ${_potBasename}.mo)
ENDIF (PACKAGE_MODE) ENDIF (PACKAGE_MODE)
SET(_gmoFiles ${_gmoFiles} ${_gmoFile}) SET(_gmoFiles ${_gmoFiles} ${_gmoFile})
ENDFOREACH (_currentPoFile ) ENDFOREACH (_currentPoFile )
IF(NOT LINUX_PACKAGE) IF(NOT LINUX_PACKAGE)
ADD_CUSTOM_TARGET(translations_${_potBasename} ${_addToAll} DEPENDS ${_gmoFiles}) ADD_CUSTOM_TARGET(translations_${_potBasename} ${_addToAll} DEPENDS ${_gmoFiles})
ENDIF(NOT LINUX_PACKAGE) ENDIF(NOT LINUX_PACKAGE)
ENDMACRO(GETTEXT_CREATE_TRANSLATIONS_PCSX2 ) ENDMACRO(GETTEXT_CREATE_TRANSLATIONS_PCSX2 )

View File

@ -4,8 +4,8 @@ set(CMAKE_SYSTEM_PROCESSOR i686)
# Leave it generic since it could be clang, gnu, etc. # Leave it generic since it could be clang, gnu, etc.
if("$ENV{CC}" STREQUAL "" OR "$ENV{CXX}" STREQUAL "") if("$ENV{CC}" STREQUAL "" OR "$ENV{CXX}" STREQUAL "")
set(CMAKE_C_COMPILER cc -m32) set(CMAKE_C_COMPILER cc -m32)
set(CMAKE_CXX_COMPILER c++ -m32) set(CMAKE_CXX_COMPILER c++ -m32)
endif() endif()
# If given a CMAKE_FIND_ROOT_PATH then # If given a CMAKE_FIND_ROOT_PATH then

View File

@ -5,44 +5,44 @@ set(CMAKE_SYSTEM_PROCESSOR i686)
# It could be i?86-*linux-gnu, x86_64-*linux-gnu, x86_64-*linux-gnux32, etc. # It could be i?86-*linux-gnu, x86_64-*linux-gnu, x86_64-*linux-gnux32, etc.
# Leave it generic to only support amd64 or x32 to i386 with any compiler. # Leave it generic to only support amd64 or x32 to i386 with any compiler.
if ("$ENV{CC}" STREQUAL "") if ("$ENV{CC}" STREQUAL "")
set(CMAKE_C_COMPILER cc -m32) set(CMAKE_C_COMPILER cc -m32)
elseif(NOT "$ENV{CC}" MATCHES "-m32") elseif(NOT "$ENV{CC}" MATCHES "-m32")
set(CMAKE_C_COMPILER $ENV{CC} -m32) set(CMAKE_C_COMPILER $ENV{CC} -m32)
endif() endif()
if ("$ENV{CXX}" STREQUAL "") if ("$ENV{CXX}" STREQUAL "")
set(CMAKE_CXX_COMPILER c++ -m32) set(CMAKE_CXX_COMPILER c++ -m32)
elseif(NOT "$ENV{CXX}" MATCHES "-m32") elseif(NOT "$ENV{CXX}" MATCHES "-m32")
set(CMAKE_CXX_COMPILER $ENV{CXX} -m32) set(CMAKE_CXX_COMPILER $ENV{CXX} -m32)
endif() endif()
# cmake 2.8.5 correctly sets CMAKE_LIBRARY_ARCHITECTURE for Debian multiarch. # cmake 2.8.5 correctly sets CMAKE_LIBRARY_ARCHITECTURE for Debian multiarch.
# Be really strict about what gets used. # Be really strict about what gets used.
if(EXISTS /usr/lib/i386-linux-gnu) if(EXISTS /usr/lib/i386-linux-gnu)
set(CMAKE_SYSTEM_IGNORE_PATH set(CMAKE_SYSTEM_IGNORE_PATH
/lib /lib64 /lib32 /lib /lib64 /lib32
/usr/lib /usr/lib64 /usr/lib32 /usr/lib /usr/lib64 /usr/lib32
/usr/local/lib /usr/local/lib64 /usr/local/lib32) /usr/local/lib /usr/local/lib64 /usr/local/lib32)
list(APPEND CMAKE_LIBRARY_PATH /usr/local/lib/i386-linux-gnu) list(APPEND CMAKE_LIBRARY_PATH /usr/local/lib/i386-linux-gnu)
list(APPEND CMAKE_LIBRARY_PATH /usr/lib/i386-linux-gnu) list(APPEND CMAKE_LIBRARY_PATH /usr/lib/i386-linux-gnu)
list(APPEND CMAKE_LIBRARY_PATH /lib/i386-linux-gnu) list(APPEND CMAKE_LIBRARY_PATH /lib/i386-linux-gnu)
elseif(EXISTS /usr/lib32) elseif(EXISTS /usr/lib32)
set(CMAKE_SYSTEM_IGNORE_PATH set(CMAKE_SYSTEM_IGNORE_PATH
/lib /lib64 /lib /lib64
/usr/lib /usr/lib64 /usr/lib /usr/lib64
/usr/local/lib /usr/local/lib64) /usr/local/lib /usr/local/lib64)
set(CMAKE_LIBRARY_ARCHITECTURE "../lib32") set(CMAKE_LIBRARY_ARCHITECTURE "../lib32")
list(APPEND CMAKE_LIBRARY_PATH /usr/local/lib32) list(APPEND CMAKE_LIBRARY_PATH /usr/local/lib32)
list(APPEND CMAKE_LIBRARY_PATH /usr/lib32) list(APPEND CMAKE_LIBRARY_PATH /usr/lib32)
list(APPEND CMAKE_LIBRARY_PATH /lib32) list(APPEND CMAKE_LIBRARY_PATH /lib32)
else() else()
set(CMAKE_SYSTEM_IGNORE_PATH set(CMAKE_SYSTEM_IGNORE_PATH
/lib64 /lib64
/usr/lib64 /usr/lib64
/usr/local/lib64) /usr/local/lib64)
set(CMAKE_LIBRARY_ARCHITECTURE ".") set(CMAKE_LIBRARY_ARCHITECTURE ".")
list(APPEND CMAKE_LIBRARY_PATH /usr/local/lib) list(APPEND CMAKE_LIBRARY_PATH /usr/local/lib)
list(APPEND CMAKE_LIBRARY_PATH /usr/lib) list(APPEND CMAKE_LIBRARY_PATH /usr/lib)
list(APPEND CMAKE_LIBRARY_PATH /lib) list(APPEND CMAKE_LIBRARY_PATH /lib)
endif() endif()
list(REMOVE_DUPLICATES CMAKE_LIBRARY_PATH) list(REMOVE_DUPLICATES CMAKE_LIBRARY_PATH)

View File

@ -25,22 +25,22 @@ include(${CMAKE_CURRENT_LIST_DIR}/GenerateGXML.cmake)
# Set flags to actual invocation flags. # Set flags to actual invocation flags.
if(GXML_COMPRESS_ALL) if(GXML_COMPRESS_ALL)
set(GXML_COMPRESS_ALL COMPRESS_ALL) set(GXML_COMPRESS_ALL COMPRESS_ALL)
endif() endif()
if(GXML_NO_COMPRESS_ALL) if(GXML_NO_COMPRESS_ALL)
set(GXML_NO_COMPRESS_ALL NO_COMPRESS_ALL) set(GXML_NO_COMPRESS_ALL NO_COMPRESS_ALL)
endif() endif()
if(GXML_STRIPBLANKS_ALL) if(GXML_STRIPBLANKS_ALL)
set(GXML_STRIPBLANKS_ALL STRIPBLANKS_ALL) set(GXML_STRIPBLANKS_ALL STRIPBLANKS_ALL)
endif() endif()
if(GXML_NO_STRIPBLANKS_ALL) if(GXML_NO_STRIPBLANKS_ALL)
set(GXML_NO_STRIPBLANKS_ALL NO_STRIPBLANKS_ALL) set(GXML_NO_STRIPBLANKS_ALL NO_STRIPBLANKS_ALL)
endif() endif()
if(GXML_TOPIXDATA_ALL) if(GXML_TOPIXDATA_ALL)
set(GXML_TOPIXDATA_ALL TOPIXDATA_ALL) set(GXML_TOPIXDATA_ALL TOPIXDATA_ALL)
endif() endif()
if(GXML_NO_TOPIXDATA_ALL) if(GXML_NO_TOPIXDATA_ALL)
set(GXML_NO_TOPIXDATA_ALL NO_TOPIXDATA_ALL) set(GXML_NO_TOPIXDATA_ALL NO_TOPIXDATA_ALL)
endif() endif()
# Replace " " with ";" to import the list over the command line. Otherwise # Replace " " with ";" to import the list over the command line. Otherwise

View File

@ -15,214 +15,216 @@ set(GCR_CMAKE_MACRO_DIR ${CMAKE_CURRENT_LIST_DIR})
# generates the XML file. glib-compile-resources will then throw a # generates the XML file. glib-compile-resources will then throw a
# warning/error. # warning/error.
function(COMPILE_GRESOURCES output xml_out) function(COMPILE_GRESOURCES output xml_out)
# Available options: # Available options:
# COMPRESS_ALL, NO_COMPRESS_ALL Overrides the COMPRESS flag in all # COMPRESS_ALL, NO_COMPRESS_ALL Overrides the COMPRESS flag in all
# registered resources. # registered resources.
# STRIPBLANKS_ALL, NO_STRIPBLANKS_ALL Overrides the STRIPBLANKS flag in all # STRIPBLANKS_ALL, NO_STRIPBLANKS_ALL Overrides the STRIPBLANKS flag in all
# registered resources. # registered resources.
# TOPIXDATA_ALL, NO_TOPIXDATA_ALL Overrides the TOPIXDATA flag in all # TOPIXDATA_ALL, NO_TOPIXDATA_ALL Overrides the TOPIXDATA flag in all
# registered resources. # registered resources.
set(CG_OPTIONS COMPRESS_ALL NO_COMPRESS_ALL set(CG_OPTIONS COMPRESS_ALL NO_COMPRESS_ALL
STRIPBLANKS_ALL NO_STRIPBLANKS_ALL STRIPBLANKS_ALL NO_STRIPBLANKS_ALL
TOPIXDATA_ALL NO_TOPIXDATA_ALL) TOPIXDATA_ALL NO_TOPIXDATA_ALL)
# Available one value options: # Available one value options:
# TYPE Type of resource to create. Valid options are: # TYPE Type of resource to create. Valid options are:
# EMBED_C: A C-file that can be compiled with your project. # EMBED_C: A C-file that can be compiled with your project.
# EMBED_H: A header that can be included into your project. # EMBED_H: A header that can be included into your project.
# BUNDLE: Generates a resource bundle file that can be loaded # BUNDLE: Generates a resource bundle file that can be loaded
# at runtime. # at runtime.
# AUTO: Determine from target file ending. Need to specify # AUTO: Determine from target file ending. Need to specify
# target argument. # target argument.
# PREFIX Overrides the resource prefix that is prepended to each # PREFIX Overrides the resource prefix that is prepended to each
# relative file name in registered resources. # relative file name in registered resources.
# C_PREFIX Specifies the prefix used for the C identifiers in the code generated # C_PREFIX Specifies the prefix used for the C identifiers in the code generated
# when EMBED_C or EMBED_H are specified for TYPE. # when EMBED_C or EMBED_H are specified for TYPE.
# SOURCE_DIR Overrides the resources base directory to search for resources. # SOURCE_DIR Overrides the resources base directory to search for resources.
# Normally this is set to the source directory with that CMake # Normally this is set to the source directory with that CMake
# was invoked (CMAKE_CURRENT_SOURCE_DIR). # was invoked (CMAKE_CURRENT_SOURCE_DIR).
# TARGET Overrides the name of the output file/-s. Normally the output # TARGET Overrides the name of the output file/-s. Normally the output
# names from the glib-compile-resources tool are taken. # names from the glib-compile-resources tool are taken.
set(CG_ONEVALUEARGS TYPE PREFIX C_PREFIX SOURCE_DIR TARGET) set(CG_ONEVALUEARGS TYPE PREFIX C_PREFIX SOURCE_DIR TARGET)
# Available multi-value options: # Available multi-value options:
# RESOURCES The list of resource files. Whether absolute or relative path is # RESOURCES The list of resource files. Whether absolute or relative path is
# equal, absolute paths are stripped down to relative ones. If the # equal, absolute paths are stripped down to relative ones. If the
# absolute path is not inside the given base directory SOURCE_DIR # absolute path is not inside the given base directory SOURCE_DIR
# or CMAKE_CURRENT_SOURCE_DIR (if SOURCE_DIR is not overriden), # or CMAKE_CURRENT_SOURCE_DIR (if SOURCE_DIR is not overriden),
# this function aborts. # this function aborts.
# OPTIONS Extra command line options passed to glib-compile-resources. # OPTIONS Extra command line options passed to glib-compile-resources.
set(CG_MULTIVALUEARGS RESOURCES OPTIONS) set(CG_MULTIVALUEARGS RESOURCES OPTIONS)
# Parse the arguments. # Parse the arguments.
cmake_parse_arguments(CG_ARG cmake_parse_arguments(CG_ARG
"${CG_OPTIONS}" "${CG_OPTIONS}"
"${CG_ONEVALUEARGS}" "${CG_ONEVALUEARGS}"
"${CG_MULTIVALUEARGS}" "${CG_MULTIVALUEARGS}"
"${ARGN}") "${ARGN}")
# Variable to store the double-quote (") string. Since escaping # Variable to store the double-quote (") string. Since escaping
# double-quotes in strings is not possible we need a helper variable that # double-quotes in strings is not possible we need a helper variable that
# does this job for us. # does this job for us.
set(Q \") set(Q \")
# Check invocation validity with the <prefix>_UNPARSED_ARGUMENTS variable. # Check invocation validity with the <prefix>_UNPARSED_ARGUMENTS variable.
# If other not recognized parameters were passed, throw error. # If other not recognized parameters were passed, throw error.
if (CG_ARG_UNPARSED_ARGUMENTS) if (CG_ARG_UNPARSED_ARGUMENTS)
set(CG_WARNMSG "Invocation of COMPILE_GRESOURCES with unrecognized") set(CG_WARNMSG "Invocation of COMPILE_GRESOURCES with unrecognized")
set(CG_WARNMSG "${CG_WARNMSG} parameters. Parameters are:") set(CG_WARNMSG "${CG_WARNMSG} parameters. Parameters are:")
set(CG_WARNMSG "${CG_WARNMSG} ${CG_ARG_UNPARSED_ARGUMENTS}.") set(CG_WARNMSG "${CG_WARNMSG} ${CG_ARG_UNPARSED_ARGUMENTS}.")
message(WARNING ${CG_WARNMSG}) message(WARNING ${CG_WARNMSG})
endif() endif()
# Check invocation validity depending on generation mode (EMBED_C, EMBED_H # Check invocation validity depending on generation mode (EMBED_C, EMBED_H
# or BUNDLE). # or BUNDLE).
if ("${CG_ARG_TYPE}" STREQUAL "EMBED_C") if ("${CG_ARG_TYPE}" STREQUAL "EMBED_C")
# EMBED_C mode, output compilable C-file. # EMBED_C mode, output compilable C-file.
list(APPEND CG_GENERATE_COMMAND_LINE --generate-source) list(APPEND CG_GENERATE_COMMAND_LINE --generate-source)
if (NOT "${CG_ARG_C_PREFIX}" STREQUAL "") if (NOT "${CG_ARG_C_PREFIX}" STREQUAL "")
list(APPEND CG_GENERATE_COMMAND_LINE --c-name "${CG_ARG_C_PREFIX}") list(APPEND CG_GENERATE_COMMAND_LINE --c-name "${CG_ARG_C_PREFIX}")
endif() endif()
set(CG_TARGET_FILE_ENDING "cpp") set(CG_TARGET_FILE_ENDING "cpp")
elseif ("${CG_ARG_TYPE}" STREQUAL "EMBED_H") elseif ("${CG_ARG_TYPE}" STREQUAL "EMBED_H")
# EMBED_H mode, output includable header file. # EMBED_H mode, output includable header file.
list(APPEND CG_GENERATE_COMMAND_LINE --generate-header) list(APPEND CG_GENERATE_COMMAND_LINE --generate-header)
if (NOT "${CG_ARG_C_PREFIX}" STREQUAL "") if (NOT "${CG_ARG_C_PREFIX}" STREQUAL "")
list(APPEND CG_GENERATE_COMMAND_LINE --c-name "${CG_ARG_C_PREFIX}") list(APPEND CG_GENERATE_COMMAND_LINE --c-name "${CG_ARG_C_PREFIX}")
endif() endif()
set(CG_TARGET_FILE_ENDING "h") set(CG_TARGET_FILE_ENDING "h")
elseif ("${CG_ARG_TYPE}" STREQUAL "BUNDLE") elseif ("${CG_ARG_TYPE}" STREQUAL "BUNDLE")
# BUNDLE mode, output resource bundle. Don't do anything since # BUNDLE mode, output resource bundle. Don't do anything since
# glib-compile-resources outputs a bundle when not specifying # glib-compile-resources outputs a bundle when not specifying
# something else. # something else.
set(CG_TARGET_FILE_ENDING "gresource") set(CG_TARGET_FILE_ENDING "gresource")
if (NOT "${CG_ARG_C_PREFIX}" STREQUAL "") if (NOT "${CG_ARG_C_PREFIX}" STREQUAL "")
message(WARNING "Superfluously provided C_PREFIX=${CG_ARG_C_PREFIX} for BUNDLE.") message(WARNING "Superfluously provided C_PREFIX=${CG_ARG_C_PREFIX} for BUNDLE.")
endif() endif()
else() else()
# Everything else is AUTO mode, determine from target file ending. # Everything else is AUTO mode, determine from target file ending.
if (CG_ARG_TARGET) if (CG_ARG_TARGET)
list(APPEND CG_GENERATE_COMMAND_LINE --generate) list(APPEND CG_GENERATE_COMMAND_LINE --generate)
else() else()
set(CG_ERRMSG "AUTO mode given, but no target specified. Can't") set(CG_ERRMSG "AUTO mode given, but no target specified. Can't")
set(CG_ERRMSG "${CG_ERRMSG} determine output type. In function") set(CG_ERRMSG "${CG_ERRMSG} determine output type. In function")
set(CG_ERRMSG "${CG_ERRMSG} COMPILE_GRESOURCES.") set(CG_ERRMSG "${CG_ERRMSG} COMPILE_GRESOURCES.")
message(FATAL_ERROR ${CG_ERRMSG}) message(FATAL_ERROR ${CG_ERRMSG})
endif() endif()
endif() endif()
# Check flag validity. # Check flag validity.
if (CG_ARG_COMPRESS_ALL AND CG_ARG_NO_COMPRESS_ALL) if (CG_ARG_COMPRESS_ALL AND CG_ARG_NO_COMPRESS_ALL)
set(CG_ERRMSG "COMPRESS_ALL and NO_COMPRESS_ALL simultaneously set. In") set(CG_ERRMSG "COMPRESS_ALL and NO_COMPRESS_ALL simultaneously set. In")
set(CG_ERRMSG "${CG_ERRMSG} function COMPILE_GRESOURCES.") set(CG_ERRMSG "${CG_ERRMSG} function COMPILE_GRESOURCES.")
message(FATAL_ERROR ${CG_ERRMSG}) message(FATAL_ERROR ${CG_ERRMSG})
endif() endif()
if (CG_ARG_STRIPBLANKS_ALL AND CG_ARG_NO_STRIPBLANKS_ALL) if (CG_ARG_STRIPBLANKS_ALL AND CG_ARG_NO_STRIPBLANKS_ALL)
set(CG_ERRMSG "STRIPBLANKS_ALL and NO_STRIPBLANKS_ALL simultaneously") set(CG_ERRMSG "STRIPBLANKS_ALL and NO_STRIPBLANKS_ALL simultaneously")
set(CG_ERRMSG "${CG_ERRMSG} set. In function COMPILE_GRESOURCES.") set(CG_ERRMSG "${CG_ERRMSG} set. In function COMPILE_GRESOURCES.")
message(FATAL_ERROR ${CG_ERRMSG}) message(FATAL_ERROR ${CG_ERRMSG})
endif() endif()
if (CG_ARG_TOPIXDATA_ALL AND CG_ARG_NO_TOPIXDATA_ALL) if (CG_ARG_TOPIXDATA_ALL AND CG_ARG_NO_TOPIXDATA_ALL)
set(CG_ERRMSG "TOPIXDATA_ALL and NO_TOPIXDATA_ALL simultaneously set.") set(CG_ERRMSG "TOPIXDATA_ALL and NO_TOPIXDATA_ALL simultaneously set.")
set(CG_ERRMSG "${CG_ERRMSG} In function COMPILE_GRESOURCES.") set(CG_ERRMSG "${CG_ERRMSG} In function COMPILE_GRESOURCES.")
message(FATAL_ERROR ${CG_ERRMSG}) message(FATAL_ERROR ${CG_ERRMSG})
endif() endif()
# Check if there are any resources. # Check if there are any resources.
if (NOT CG_ARG_RESOURCES) if (NOT CG_ARG_RESOURCES)
set(CG_ERRMSG "No resource files to process. In function") set(CG_ERRMSG "No resource files to process. In function")
set(CG_ERRMSG "${CG_ERRMSG} COMPILE_GRESOURCES.") set(CG_ERRMSG "${CG_ERRMSG} COMPILE_GRESOURCES.")
message(FATAL_ERROR ${CG_ERRMSG}) message(FATAL_ERROR ${CG_ERRMSG})
endif() endif()
# Extract all dependencies for targets from resource list. # Extract all dependencies for targets from resource list.
foreach(res ${CG_ARG_RESOURCES}) foreach(res ${CG_ARG_RESOURCES})
if (NOT(("${res}" STREQUAL "COMPRESS") OR if (NOT(("${res}" STREQUAL "COMPRESS") OR
("${res}" STREQUAL "STRIPBLANKS") OR ("${res}" STREQUAL "STRIPBLANKS") OR
("${res}" STREQUAL "TOPIXDATA"))) ("${res}" STREQUAL "TOPIXDATA")))
list(APPEND CG_RESOURCES_DEPENDENCIES "${res}") list(APPEND CG_RESOURCES_DEPENDENCIES "${res}")
endif() endif()
endforeach() endforeach()
# Construct .gresource.xml path. # Construct .gresource.xml path.
set(CG_XML_FILE_PATH "${CMAKE_CURRENT_BINARY_DIR}/.gresource.xml") set(CG_XML_FILE_PATH "${CMAKE_CURRENT_BINARY_DIR}/.gresource.xml")
# Generate gresources XML target. # Generate gresources XML target.
list(APPEND CG_CMAKE_SCRIPT_ARGS "-D") list(APPEND CG_CMAKE_SCRIPT_ARGS "-D")
list(APPEND CG_CMAKE_SCRIPT_ARGS "GXML_OUTPUT=${CG_XML_FILE_PATH}") list(APPEND CG_CMAKE_SCRIPT_ARGS "GXML_OUTPUT=${CG_XML_FILE_PATH}")
if(CG_ARG_COMPRESS_ALL) if(CG_ARG_COMPRESS_ALL)
list(APPEND CG_CMAKE_SCRIPT_ARGS "-D") list(APPEND CG_CMAKE_SCRIPT_ARGS "-D")
list(APPEND CG_CMAKE_SCRIPT_ARGS "GXML_COMPRESS_ALL=True") list(APPEND CG_CMAKE_SCRIPT_ARGS "GXML_COMPRESS_ALL=True")
endif() endif()
if(CG_ARG_NO_COMPRESS_ALL) if(CG_ARG_NO_COMPRESS_ALL)
list(APPEND CG_CMAKE_SCRIPT_ARGS "-D") list(APPEND CG_CMAKE_SCRIPT_ARGS "-D")
list(APPEND CG_CMAKE_SCRIPT_ARGS "GXML_NO_COMPRESS_ALL=True") list(APPEND CG_CMAKE_SCRIPT_ARGS "GXML_NO_COMPRESS_ALL=True")
endif() endif()
if(CG_ARG_STRPIBLANKS_ALL) if(CG_ARG_STRPIBLANKS_ALL)
list(APPEND CG_CMAKE_SCRIPT_ARGS "-D") list(APPEND CG_CMAKE_SCRIPT_ARGS "-D")
list(APPEND CG_CMAKE_SCRIPT_ARGS "GXML_STRIPBLANKS_ALL=True") list(APPEND CG_CMAKE_SCRIPT_ARGS "GXML_STRIPBLANKS_ALL=True")
endif() endif()
if(CG_ARG_NO_STRIPBLANKS_ALL) if(CG_ARG_NO_STRIPBLANKS_ALL)
list(APPEND CG_CMAKE_SCRIPT_ARGS "-D") list(APPEND CG_CMAKE_SCRIPT_ARGS "-D")
list(APPEND CG_CMAKE_SCRIPT_ARGS "GXML_NO_STRIPBLANKS_ALL=True") list(APPEND CG_CMAKE_SCRIPT_ARGS "GXML_NO_STRIPBLANKS_ALL=True")
endif() endif()
if(CG_ARG_TOPIXDATA_ALL) if(CG_ARG_TOPIXDATA_ALL)
list(APPEND CG_CMAKE_SCRIPT_ARGS "-D") list(APPEND CG_CMAKE_SCRIPT_ARGS "-D")
list(APPEND CG_CMAKE_SCRIPT_ARGS "GXML_TOPIXDATA_ALL=True") list(APPEND CG_CMAKE_SCRIPT_ARGS "GXML_TOPIXDATA_ALL=True")
endif() endif()
if(CG_ARG_NO_TOPIXDATA_ALL) if(CG_ARG_NO_TOPIXDATA_ALL)
list(APPEND CG_CMAKE_SCRIPT_ARGS "-D") list(APPEND CG_CMAKE_SCRIPT_ARGS "-D")
list(APPEND CG_CMAKE_SCRIPT_ARGS "GXML_NO_TOPIXDATA_ALL=True") list(APPEND CG_CMAKE_SCRIPT_ARGS "GXML_NO_TOPIXDATA_ALL=True")
endif() endif()
list(APPEND CG_CMAKE_SCRIPT_ARGS "-D") list(APPEND CG_CMAKE_SCRIPT_ARGS "-D")
list(APPEND CG_CMAKE_SCRIPT_ARGS "GXML_PREFIX=${Q}${CG_ARG_PREFIX}${Q}") list(APPEND CG_CMAKE_SCRIPT_ARGS "GXML_PREFIX=${Q}${CG_ARG_PREFIX}${Q}")
list(APPEND CG_CMAKE_SCRIPT_ARGS "-D") list(APPEND CG_CMAKE_SCRIPT_ARGS "-D")
list(APPEND CG_CMAKE_SCRIPT_ARGS list(APPEND CG_CMAKE_SCRIPT_ARGS
"GXML_RESOURCES=${Q}${CG_ARG_RESOURCES}${Q}") "GXML_RESOURCES=${Q}${CG_ARG_RESOURCES}${Q}")
list(APPEND CG_CMAKE_SCRIPT_ARGS "-P") list(APPEND CG_CMAKE_SCRIPT_ARGS "-P")
list(APPEND CG_CMAKE_SCRIPT_ARGS list(APPEND CG_CMAKE_SCRIPT_ARGS
"${GCR_CMAKE_MACRO_DIR}/BuildTargetScript.cmake") "${GCR_CMAKE_MACRO_DIR}/BuildTargetScript.cmake")
get_filename_component(CG_XML_FILE_PATH_ONLY_NAME get_filename_component(CG_XML_FILE_PATH_ONLY_NAME
"${CG_XML_FILE_PATH}" NAME) "${CG_XML_FILE_PATH}" NAME)
set(CG_XML_CUSTOM_COMMAND_COMMENT set(CG_XML_CUSTOM_COMMAND_COMMENT
"Creating gresources XML file (${CG_XML_FILE_PATH_ONLY_NAME})") "Creating gresources XML file (${CG_XML_FILE_PATH_ONLY_NAME})")
add_custom_command(OUTPUT ${CG_XML_FILE_PATH} add_custom_command(
COMMAND ${CMAKE_COMMAND} OUTPUT ${CG_XML_FILE_PATH}
ARGS ${CG_CMAKE_SCRIPT_ARGS} COMMAND ${CMAKE_COMMAND}
DEPENDS ${CG_RESOURCES_DEPENDENCIES} ARGS ${CG_CMAKE_SCRIPT_ARGS}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DEPENDS ${CG_RESOURCES_DEPENDENCIES}
COMMENT ${CG_XML_CUSTOM_COMMAND_COMMENT}) WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT ${CG_XML_CUSTOM_COMMAND_COMMENT})
# Create target manually if not set (to make sure glib-compile-resources # Create target manually if not set (to make sure glib-compile-resources
# doesn't change behaviour with it's naming standards). # doesn't change behaviour with it's naming standards).
if (NOT CG_ARG_TARGET) if (NOT CG_ARG_TARGET)
set(CG_ARG_TARGET "${CMAKE_CURRENT_BINARY_DIR}/resources") set(CG_ARG_TARGET "${CMAKE_CURRENT_BINARY_DIR}/resources")
set(CG_ARG_TARGET "${CG_ARG_TARGET}.${CG_TARGET_FILE_ENDING}") set(CG_ARG_TARGET "${CG_ARG_TARGET}.${CG_TARGET_FILE_ENDING}")
endif() endif()
# Create source directory automatically if not set. # Create source directory automatically if not set.
if (NOT CG_ARG_SOURCE_DIR) if (NOT CG_ARG_SOURCE_DIR)
set(CG_ARG_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}") set(CG_ARG_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
endif() endif()
# Add compilation target for resources. # Add compilation target for resources.
add_custom_command(OUTPUT ${CG_ARG_TARGET} add_custom_command(
COMMAND ${GLIB_COMPILE_RESOURCES_EXECUTABLE} OUTPUT ${CG_ARG_TARGET}
ARGS COMMAND ${GLIB_COMPILE_RESOURCES_EXECUTABLE}
${OPTIONS} ARGS
--target ${CG_ARG_TARGET} ${OPTIONS}
--sourcedir ${CG_ARG_SOURCE_DIR} --target ${CG_ARG_TARGET}
${CG_GENERATE_COMMAND_LINE} --sourcedir ${CG_ARG_SOURCE_DIR}
${CG_XML_FILE_PATH} ${CG_GENERATE_COMMAND_LINE}
VERBATIM ${CG_XML_FILE_PATH}
MAIN_DEPENDENCY ${CG_XML_FILE_PATH} VERBATIM
DEPENDS ${CG_RESOURCES_DEPENDENCIES} MAIN_DEPENDENCY ${CG_XML_FILE_PATH}
WORKING_DIRECTORY ${CMAKE_CURRENT_BUILD_DIR}) DEPENDS ${CG_RESOURCES_DEPENDENCIES}
WORKING_DIRECTORY ${CMAKE_CURRENT_BUILD_DIR})
# Set output and XML_OUT to parent scope. # Set output and XML_OUT to parent scope.
set(${xml_out} ${CG_XML_FILE_PATH} PARENT_SCOPE) set(${xml_out} ${CG_XML_FILE_PATH} PARENT_SCOPE)
set(${output} ${CG_ARG_TARGET} PARENT_SCOPE) set(${output} ${CG_ARG_TARGET} PARENT_SCOPE)
endfunction() endfunction()

View File

@ -6,119 +6,119 @@ include(CMakeParseArguments)
# COMPILE_GRESOURCES() to create a custom command, so that this function is # COMPILE_GRESOURCES() to create a custom command, so that this function is
# invoked at build-time in script mode from CMake. # invoked at build-time in script mode from CMake.
function(GENERATE_GXML xml_path) function(GENERATE_GXML xml_path)
# Available options: # Available options:
# COMPRESS_ALL, NO_COMPRESS_ALL Overrides the COMPRESS flag in all # COMPRESS_ALL, NO_COMPRESS_ALL Overrides the COMPRESS flag in all
# registered resources. # registered resources.
# STRIPBLANKS_ALL, NO_STRIPBLANKS_ALL Overrides the STRIPBLANKS flag in all # STRIPBLANKS_ALL, NO_STRIPBLANKS_ALL Overrides the STRIPBLANKS flag in all
# registered resources. # registered resources.
# TOPIXDATA_ALL, NO_TOPIXDATA_ALL Overrides the TOPIXDATA flag in all # TOPIXDATA_ALL, NO_TOPIXDATA_ALL Overrides the TOPIXDATA flag in all
# registered resources. # registered resources.
set(GXML_OPTIONS COMPRESS_ALL NO_COMPRESS_ALL set(GXML_OPTIONS COMPRESS_ALL NO_COMPRESS_ALL
STRIPBLANKS_ALL NO_STRIPBLANKS_ALL STRIPBLANKS_ALL NO_STRIPBLANKS_ALL
TOPIXDATA_ALL NO_TOPIXDATA_ALL) TOPIXDATA_ALL NO_TOPIXDATA_ALL)
# Available one value options: # Available one value options:
# PREFIX Overrides the resource prefix that is prepended to each # PREFIX Overrides the resource prefix that is prepended to each
# relative file name in registered resources. # relative file name in registered resources.
set(GXML_ONEVALUEARGS PREFIX) set(GXML_ONEVALUEARGS PREFIX)
# Available multi-value options: # Available multi-value options:
# RESOURCES The list of resource files. Whether absolute or relative path is # RESOURCES The list of resource files. Whether absolute or relative path is
# equal, absolute paths are stripped down to relative ones. If the # equal, absolute paths are stripped down to relative ones. If the
# absolute path is not inside the given base directory SOURCE_DIR # absolute path is not inside the given base directory SOURCE_DIR
# or CMAKE_CURRENT_SOURCE_DIR (if SOURCE_DIR is not overriden), # or CMAKE_CURRENT_SOURCE_DIR (if SOURCE_DIR is not overriden),
# this function aborts. # this function aborts.
set(GXML_MULTIVALUEARGS RESOURCES) set(GXML_MULTIVALUEARGS RESOURCES)
# Parse the arguments. # Parse the arguments.
cmake_parse_arguments(GXML_ARG cmake_parse_arguments(GXML_ARG
"${GXML_OPTIONS}" "${GXML_OPTIONS}"
"${GXML_ONEVALUEARGS}" "${GXML_ONEVALUEARGS}"
"${GXML_MULTIVALUEARGS}" "${GXML_MULTIVALUEARGS}"
"${ARGN}") "${ARGN}")
# Variable to store the double-quote (") string. Since escaping # Variable to store the double-quote (") string. Since escaping
# double-quotes in strings is not possible we need a helper variable that # double-quotes in strings is not possible we need a helper variable that
# does this job for us. # does this job for us.
set(Q \") set(Q \")
# Process resources and generate XML file. # Process resources and generate XML file.
# Begin with the XML header and header nodes. # Begin with the XML header and header nodes.
set(GXML_XML_FILE "<?xml version=${Q}1.0${Q} encoding=${Q}UTF-8${Q}?>") set(GXML_XML_FILE "<?xml version=${Q}1.0${Q} encoding=${Q}UTF-8${Q}?>")
set(GXML_XML_FILE "${GXML_XML_FILE}<gresources><gresource prefix=${Q}") set(GXML_XML_FILE "${GXML_XML_FILE}<gresources><gresource prefix=${Q}")
# Set the prefix for the resources. Depending on the user-override we choose # Set the prefix for the resources. Depending on the user-override we choose
# the standard prefix "/" or the override. # the standard prefix "/" or the override.
if (GXML_ARG_PREFIX) if (GXML_ARG_PREFIX)
set(GXML_XML_FILE "${GXML_XML_FILE}${GXML_ARG_PREFIX}") set(GXML_XML_FILE "${GXML_XML_FILE}${GXML_ARG_PREFIX}")
else() else()
set(GXML_XML_FILE "${GXML_XML_FILE}/") set(GXML_XML_FILE "${GXML_XML_FILE}/")
endif() endif()
set(GXML_XML_FILE "${GXML_XML_FILE}${Q}>") set(GXML_XML_FILE "${GXML_XML_FILE}${Q}>")
# Process each resource. # Process each resource.
foreach(res ${GXML_ARG_RESOURCES}) foreach(res ${GXML_ARG_RESOURCES})
if ("${res}" STREQUAL "COMPRESS") if ("${res}" STREQUAL "COMPRESS")
set(GXML_COMPRESSION_FLAG ON) set(GXML_COMPRESSION_FLAG ON)
elseif ("${res}" STREQUAL "STRIPBLANKS") elseif ("${res}" STREQUAL "STRIPBLANKS")
set(GXML_STRIPBLANKS_FLAG ON) set(GXML_STRIPBLANKS_FLAG ON)
elseif ("${res}" STREQUAL "TOPIXDATA") elseif ("${res}" STREQUAL "TOPIXDATA")
set(GXML_TOPIXDATA_FLAG ON) set(GXML_TOPIXDATA_FLAG ON)
else() else()
# The file name. # The file name.
set(GXML_RESOURCE_PATH "${res}") set(GXML_RESOURCE_PATH "${res}")
# Append to real resource file dependency list. # Append to real resource file dependency list.
list(APPEND GXML_RESOURCES_DEPENDENCIES ${GXML_RESOURCE_PATH}) list(APPEND GXML_RESOURCES_DEPENDENCIES ${GXML_RESOURCE_PATH})
# Assemble <file> node. # Assemble <file> node.
set(GXML_RES_LINE "<file") set(GXML_RES_LINE "<file")
if ((GXML_ARG_COMPRESS_ALL OR GXML_COMPRESSION_FLAG) AND NOT if ((GXML_ARG_COMPRESS_ALL OR GXML_COMPRESSION_FLAG) AND NOT
GXML_ARG_NO_COMPRESS_ALL) GXML_ARG_NO_COMPRESS_ALL)
set(GXML_RES_LINE "${GXML_RES_LINE} compressed=${Q}true${Q}") set(GXML_RES_LINE "${GXML_RES_LINE} compressed=${Q}true${Q}")
endif() endif()
# Check preprocess flag validity. # Check preprocess flag validity.
if ((GXML_ARG_STRIPBLANKS_ALL OR GXML_STRIPBLANKS_FLAG) AND if ((GXML_ARG_STRIPBLANKS_ALL OR GXML_STRIPBLANKS_FLAG) AND
(GXML_ARG_TOPIXDATA_ALL OR GXML_TOPIXDATA_FLAG)) (GXML_ARG_TOPIXDATA_ALL OR GXML_TOPIXDATA_FLAG))
set(GXML_ERRMSG "Resource preprocessing option conflict. Tried") set(GXML_ERRMSG "Resource preprocessing option conflict. Tried")
set(GXML_ERRMSG "${GXML_ERRMSG} to specify both, STRIPBLANKS") set(GXML_ERRMSG "${GXML_ERRMSG} to specify both, STRIPBLANKS")
set(GXML_ERRMSG "${GXML_ERRMSG} and TOPIXDATA. In resource") set(GXML_ERRMSG "${GXML_ERRMSG} and TOPIXDATA. In resource")
set(GXML_ERRMSG "${GXML_ERRMSG} ${GXML_RESOURCE_PATH} in") set(GXML_ERRMSG "${GXML_ERRMSG} ${GXML_RESOURCE_PATH} in")
set(GXML_ERRMSG "${GXML_ERRMSG} function COMPILE_GRESOURCES.") set(GXML_ERRMSG "${GXML_ERRMSG} function COMPILE_GRESOURCES.")
message(FATAL_ERROR ${GXML_ERRMSG}) message(FATAL_ERROR ${GXML_ERRMSG})
endif() endif()
if ((GXML_ARG_STRIPBLANKS_ALL OR GXML_STRIPBLANKS_FLAG) AND NOT if ((GXML_ARG_STRIPBLANKS_ALL OR GXML_STRIPBLANKS_FLAG) AND NOT
GXML_ARG_NO_STRIPBLANKS_ALL) GXML_ARG_NO_STRIPBLANKS_ALL)
set(GXML_RES_LINE "${GXML_RES_LINE} preprocess=") set(GXML_RES_LINE "${GXML_RES_LINE} preprocess=")
set(GXML_RES_LINE "${GXML_RES_LINE}${Q}xml-stripblanks${Q}") set(GXML_RES_LINE "${GXML_RES_LINE}${Q}xml-stripblanks${Q}")
elseif((GXML_ARG_TOPIXDATA_ALL OR GXML_TOPIXDATA_FLAG) AND NOT elseif((GXML_ARG_TOPIXDATA_ALL OR GXML_TOPIXDATA_FLAG) AND NOT
GXML_ARG_NO_TOPIXDATA_ALL) GXML_ARG_NO_TOPIXDATA_ALL)
set(GXML_RES_LINE "${GXML_RES_LINE} preprocess=") set(GXML_RES_LINE "${GXML_RES_LINE} preprocess=")
set(GXML_RES_LINE "${GXML_RES_LINE}${Q}to-pixdata${Q}") set(GXML_RES_LINE "${GXML_RES_LINE}${Q}to-pixdata${Q}")
endif() endif()
set(GXML_RES_LINE "${GXML_RES_LINE}>${GXML_RESOURCE_PATH}</file>") set(GXML_RES_LINE "${GXML_RES_LINE}>${GXML_RESOURCE_PATH}</file>")
# Append to file string. # Append to file string.
set(GXML_XML_FILE "${GXML_XML_FILE}${GXML_RES_LINE}") set(GXML_XML_FILE "${GXML_XML_FILE}${GXML_RES_LINE}")
# Unset variables. # Unset variables.
unset(GXML_COMPRESSION_FLAG) unset(GXML_COMPRESSION_FLAG)
unset(GXML_STRIPBLANKS_FLAG) unset(GXML_STRIPBLANKS_FLAG)
unset(GXML_TOPIXDATA_FLAG) unset(GXML_TOPIXDATA_FLAG)
endif() endif()
endforeach() endforeach()
# Append closing nodes. # Append closing nodes.
set(GXML_XML_FILE "${GXML_XML_FILE}</gresource></gresources>") set(GXML_XML_FILE "${GXML_XML_FILE}</gresource></gresources>")
# Use "file" function to generate XML controlling file. # Use "file" function to generate XML controlling file.
get_filename_component(xml_path_only_name "${xml_path}" NAME) get_filename_component(xml_path_only_name "${xml_path}" NAME)
file(WRITE ${xml_path} ${GXML_XML_FILE}) file(WRITE ${xml_path} ${GXML_XML_FILE})
endfunction() endfunction()

View File

@ -1,14 +1,14 @@
# Check that people use the good file # Check that people use the good file
if(NOT TOP_CMAKE_WAS_SOURCED) if(NOT TOP_CMAKE_WAS_SOURCED)
message(FATAL_ERROR " message(FATAL_ERROR "
You did not 'cmake' the good CMakeLists.txt file. Use the one in the top dir. You did not 'cmake' the good CMakeLists.txt file. Use the one in the top dir.
It is advice to delete all wrongly generated cmake stuff => CMakeFiles & CMakeCache.txt") It is advice to delete all wrongly generated cmake stuff => CMakeFiles & CMakeCache.txt")
endif(NOT TOP_CMAKE_WAS_SOURCED) endif(NOT TOP_CMAKE_WAS_SOURCED)
set(Output Utilities) set(Output Utilities)
set(CommonFlags set(CommonFlags
) )
set(UtilitiesFinalFlags ${CommonFlags}) set(UtilitiesFinalFlags ${CommonFlags})
@ -109,7 +109,7 @@ set(UtilitiesFinalSources
) )
set(UtilitiesFinalLibs set(UtilitiesFinalLibs
${LIBC_LIBRARIES} # Gold (new linux linker) does not get automatically dependency of dependency ${LIBC_LIBRARIES} # Gold (new linux linker) does not get automatically dependency of dependency
${wxWidgets_LIBRARIES} ${wxWidgets_LIBRARIES}
yaml-cpp chdr-static yaml-cpp chdr-static
) )

View File

@ -1,15 +1,15 @@
# Check that people use the good file # Check that people use the good file
if(NOT TOP_CMAKE_WAS_SOURCED) if(NOT TOP_CMAKE_WAS_SOURCED)
message(FATAL_ERROR " message(FATAL_ERROR "
You did not 'cmake' the good CMakeLists.txt file. Use the one in the top dir. You did not 'cmake' the good CMakeLists.txt file. Use the one in the top dir.
It is advice to delete all wrongly generated cmake stuff => CMakeFiles & CMakeCache.txt") It is advice to delete all wrongly generated cmake stuff => CMakeFiles & CMakeCache.txt")
endif(NOT TOP_CMAKE_WAS_SOURCED) endif(NOT TOP_CMAKE_WAS_SOURCED)
set(Output x86emitter) set(Output x86emitter)
set(CommonFlags set(CommonFlags
) )
set(x86emitterFinalFlags ${CommonFlags}) set(x86emitterFinalFlags ${CommonFlags})

View File

@ -1,18 +1,18 @@
# Check that people use the good file # Check that people use the good file
if(NOT TOP_CMAKE_WAS_SOURCED) if(NOT TOP_CMAKE_WAS_SOURCED)
message(FATAL_ERROR " message(FATAL_ERROR "
You did not 'cmake' the good CMakeLists.txt file. Use the one in the top dir. You did not 'cmake' the good CMakeLists.txt file. Use the one in the top dir.
It is advice to delete all wrongly generated cmake stuff => CMakeFiles & CMakeCache.txt") It is advice to delete all wrongly generated cmake stuff => CMakeFiles & CMakeCache.txt")
endif(NOT TOP_CMAKE_WAS_SOURCED) endif(NOT TOP_CMAKE_WAS_SOURCED)
if (GETTEXT_FOUND) if (GETTEXT_FOUND)
include(Translation) include(Translation)
file (GLOB_RECURSE PO_ICO_FILES ${CMAKE_SOURCE_DIR}}/locales pcsx2_Iconized.po) file (GLOB_RECURSE PO_ICO_FILES ${CMAKE_SOURCE_DIR}}/locales pcsx2_Iconized.po)
file (GLOB_RECURSE PO_MAIN_FILES ${CMAKE_SOURCE_DIR}/locales pcsx2_Main.po) file (GLOB_RECURSE PO_MAIN_FILES ${CMAKE_SOURCE_DIR}/locales pcsx2_Main.po)
# Macro to compile po file and install them # Macro to compile po file and install them
GETTEXT_CREATE_TRANSLATIONS_PCSX2(${CMAKE_SOURCE_DIR}/locales/templates/pcsx2_Iconized.pot ALL ${PO_ICO_FILES}) GETTEXT_CREATE_TRANSLATIONS_PCSX2(${CMAKE_SOURCE_DIR}/locales/templates/pcsx2_Iconized.pot ALL ${PO_ICO_FILES})
GETTEXT_CREATE_TRANSLATIONS_PCSX2(${CMAKE_SOURCE_DIR}/locales/templates/pcsx2_Main.pot ALL ${PO_MAIN_FILES}) GETTEXT_CREATE_TRANSLATIONS_PCSX2(${CMAKE_SOURCE_DIR}/locales/templates/pcsx2_Main.pot ALL ${PO_MAIN_FILES})
endif (GETTEXT_FOUND) endif (GETTEXT_FOUND)

View File

@ -2,27 +2,27 @@ include(macros/GlibCompileResourcesSupport)
if (openSUSE) if (openSUSE)
# openSUSE don't install wx in a standard library system # openSUSE don't install wx in a standard library system
# path. Let's bypass the dynamic linker and hardcode the path. # path. Let's bypass the dynamic linker and hardcode the path.
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH ON) set(CMAKE_INSTALL_RPATH_USE_LINK_PATH ON)
endif() endif()
# Check that people use the good file # Check that people use the good file
if(NOT TOP_CMAKE_WAS_SOURCED) if(NOT TOP_CMAKE_WAS_SOURCED)
message(FATAL_ERROR " message(FATAL_ERROR "
You did not 'cmake' the good CMakeLists.txt file. Use the one in the top dir. You did not 'cmake' the good CMakeLists.txt file. Use the one in the top dir.
It is advice to delete all wrongly generated cmake stuff => CMakeFiles & CMakeCache.txt") It is advice to delete all wrongly generated cmake stuff => CMakeFiles & CMakeCache.txt")
endif() endif()
include_directories ("${CMAKE_SOURCE_DIR}/3rdparty/xbyak/") include_directories ("${CMAKE_SOURCE_DIR}/3rdparty/xbyak/")
set(CommonFlags set(CommonFlags
-fno-strict-aliasing -fno-strict-aliasing
-Wstrict-aliasing # Allow to track strict aliasing issue. -Wstrict-aliasing # Allow to track strict aliasing issue.
-Wno-parentheses -Wno-parentheses
-Wno-missing-braces -Wno-missing-braces
-Wno-unknown-pragmas -Wno-unknown-pragmas
-DWX_PRECOMP -DWX_PRECOMP
) )
if(GCC_VERSION VERSION_EQUAL "8.0" OR GCC_VERSION VERSION_GREATER "8.0") if(GCC_VERSION VERSION_EQUAL "8.0" OR GCC_VERSION VERSION_GREATER "8.0")
@ -31,29 +31,29 @@ if(GCC_VERSION VERSION_EQUAL "8.0" OR GCC_VERSION VERSION_GREATER "8.0")
endif() endif()
if ("${PGO}" STREQUAL "generate") if ("${PGO}" STREQUAL "generate")
set(pcsx2FinalFlags -fprofile-generate) set(pcsx2FinalFlags -fprofile-generate)
elseif("${PGO}" STREQUAL "use") elseif("${PGO}" STREQUAL "use")
set(pcsx2FinalFlags -fprofile-use) set(pcsx2FinalFlags -fprofile-use)
else() else()
set(pcsx2FinalFlags "") set(pcsx2FinalFlags "")
endif() endif()
set(pcsx2FinalFlags ${pcsx2FinalFlags} ${CommonFlags}) set(pcsx2FinalFlags ${pcsx2FinalFlags} ${CommonFlags})
if(PORTAUDIO_FOUND) if(PORTAUDIO_FOUND)
set(pcsx2FinalFlags ${pcsx2FinalFlags} -DSPU2X_PORTAUDIO) set(pcsx2FinalFlags ${pcsx2FinalFlags} -DSPU2X_PORTAUDIO)
endif() endif()
if(PULSEAUDIO_FOUND) if(PULSEAUDIO_FOUND)
set(pcsx2FinalFlags ${pcsx2FinalFlags} -DSPU2X_PULSEAUDIO) set(pcsx2FinalFlags ${pcsx2FinalFlags} -DSPU2X_PULSEAUDIO)
endif() endif()
if(XDG_STD) if(XDG_STD)
set(pcsx2FinalFlags ${pcsx2FinalFlags} -DXDG_STD) set(pcsx2FinalFlags ${pcsx2FinalFlags} -DXDG_STD)
endif() endif()
if(SDL_FOUND OR SDL2_FOUND) if(SDL_FOUND OR SDL2_FOUND)
set(pcsx2FinalFlags ${pcsx2FinalFlags} -DSDL_BUILD) set(pcsx2FinalFlags ${pcsx2FinalFlags} -DSDL_BUILD)
endif() endif()
@ -208,7 +208,7 @@ set(pcsx2CDVDSources
CDVD/IsoFS/IsoFile.cpp CDVD/IsoFS/IsoFile.cpp
CDVD/IsoFS/IsoFSCDVD.cpp CDVD/IsoFS/IsoFSCDVD.cpp
CDVD/IsoFS/IsoFS.cpp CDVD/IsoFS/IsoFS.cpp
) )
# CDVD headers # CDVD headers
set(pcsx2CDVDHeaders set(pcsx2CDVDHeaders
@ -260,10 +260,10 @@ set(pcsx2SPU2Sources
SPU2/Linux/ConfigSoundTouch.cpp SPU2/Linux/ConfigSoundTouch.cpp
SPU2/Linux/Dialogs.cpp SPU2/Linux/Dialogs.cpp
SPU2/wx/wxConfig.cpp SPU2/wx/wxConfig.cpp
) )
if(PORTAUDIO_FOUND) if(PORTAUDIO_FOUND)
set(pcsx2SPU2Sources ${pcsx2SPU2Sources} SPU2/SndOut_Portaudio.cpp) set(pcsx2SPU2Sources ${pcsx2SPU2Sources} SPU2/SndOut_Portaudio.cpp)
endif() endif()
# SPU2 headers # SPU2 headers
@ -288,22 +288,22 @@ set(pcsx2SPU2Headers
# DEV9 UI sources # DEV9 UI sources
compile_gresources( pcsx2DEV9UISources compile_gresources( pcsx2DEV9UISources
pcsx2DEV9UIXML pcsx2DEV9UIXML
TYPE EMBED_C TYPE EMBED_C
RESOURCES "DEV9/Linux/dev9.ui" RESOURCES "DEV9/Linux/dev9.ui"
PREFIX "/net/pcsx2/dev9" PREFIX "/net/pcsx2/dev9"
COMPRESS_ALL COMPRESS_ALL
STRIPBLANKS_ALL STRIPBLANKS_ALL
) )
# DEV9 UI headers # DEV9 UI headers
compile_gresources( pcsx2DEV9UIHeaders compile_gresources( pcsx2DEV9UIHeaders
pcsx2DEV9UIXML pcsx2DEV9UIXML
TYPE EMBED_H TYPE EMBED_H
RESOURCES "DEV9/Linux/dev9.ui" RESOURCES "DEV9/Linux/dev9.ui"
PREFIX "/net/pcsx2/dev9" PREFIX "/net/pcsx2/dev9"
COMPRESS_ALL COMPRESS_ALL
STRIPBLANKS_ALL STRIPBLANKS_ALL
) )
# DEV9 sources # DEV9 sources
@ -473,12 +473,12 @@ set(pcsx2USBHeaders
USB/usb-hid/evdev/evdev.cpp USB/usb-hid/evdev/evdev.cpp
USB/usb-eyetoy/cam-linux.h USB/usb-eyetoy/cam-linux.h
USB/qemu-usb/input-keymap-linux-to-qcode.h USB/qemu-usb/input-keymap-linux-to-qcode.h
) )
include_directories ("../3rdparty/jpgd/") include_directories ("../3rdparty/jpgd/")
if(PULSEAUDIO_FOUND) if(PULSEAUDIO_FOUND)
set(pcsx2USBSources ${pcsx2USBSources} USB/usb-mic/audiodev-pulse.cpp) set(pcsx2USBSources ${pcsx2USBSources} USB/usb-mic/audiodev-pulse.cpp)
set(pcsx2USBHeaders ${pcsx2USBHeaders} USB/usb-mic/audiodev-pulse.h) set(pcsx2USBHeaders ${pcsx2USBHeaders} USB/usb-mic/audiodev-pulse.h)
endif() endif()
@ -491,86 +491,86 @@ include_directories ("${CMAKE_BINARY_DIR}/pcsx2/PAD/Linux/")
file(MAKE_DIRECTORY ${PADImgHeader}) file(MAKE_DIRECTORY ${PADImgHeader})
foreach(result_file IN ITEMS foreach(result_file IN ITEMS
analog circle cross dp_bottom dp_left dp_right dp_up dualshock2 analog circle cross dp_bottom dp_left dp_right dp_up dualshock2
joystick_cursor l1 r1 l2 r2 l3 r3 select square start triangle arrow_up joystick_cursor l1 r1 l2 r2 l3 r3 select square start triangle arrow_up
arrow_bottom arrow_left arrow_right) arrow_bottom arrow_left arrow_right)
add_custom_command( add_custom_command(
OUTPUT "${PADImgHeader}/${result_file}.h" OUTPUT "${PADImgHeader}/${result_file}.h"
COMMAND perl ${CMAKE_SOURCE_DIR}/linux_various/hex2h.pl "${PADImg}/${result_file}.png" "${PADImgHeader}/${result_file}" ) COMMAND perl ${CMAKE_SOURCE_DIR}/linux_various/hex2h.pl "${PADImg}/${result_file}.png" "${PADImgHeader}/${result_file}" )
endforeach() endforeach()
add_custom_command( add_custom_command(
OUTPUT ${CMAKE_BINARY_DIR}/pcsx2/PAD/Linux/resources_pad.h OUTPUT ${CMAKE_BINARY_DIR}/pcsx2/PAD/Linux/resources_pad.h
COMMAND glib-compile-resources --sourcedir "${CMAKE_SOURCE_DIR}/pcsx2/PAD/Linux/res" --generate-header COMMAND glib-compile-resources --sourcedir "${CMAKE_SOURCE_DIR}/pcsx2/PAD/Linux/res" --generate-header
--c-name PAD_res "${CMAKE_SOURCE_DIR}/pcsx2/PAD/Linux/res/PAD-res.xml" --target=${CMAKE_BINARY_DIR}/pcsx2/PAD/Linux/resources_pad.h --c-name PAD_res "${CMAKE_SOURCE_DIR}/pcsx2/PAD/Linux/res/PAD-res.xml" --target=${CMAKE_BINARY_DIR}/pcsx2/PAD/Linux/resources_pad.h
DEPENDS ${CMAKE_SOURCE_DIR}/pcsx2/PAD/Linux/res/PAD-res.xml ${CMAKE_SOURCE_DIR}/pcsx2/PAD/Linux/res/game_controller_db.txt) DEPENDS ${CMAKE_SOURCE_DIR}/pcsx2/PAD/Linux/res/PAD-res.xml ${CMAKE_SOURCE_DIR}/pcsx2/PAD/Linux/res/game_controller_db.txt)
add_custom_command( add_custom_command(
OUTPUT ${CMAKE_BINARY_DIR}/pcsx2/PAD/Linux/resources_pad.cpp OUTPUT ${CMAKE_BINARY_DIR}/pcsx2/PAD/Linux/resources_pad.cpp
COMMAND glib-compile-resources --sourcedir "${CMAKE_SOURCE_DIR}/pcsx2/PAD/Linux/res" --generate-source COMMAND glib-compile-resources --sourcedir "${CMAKE_SOURCE_DIR}/pcsx2/PAD/Linux/res" --generate-source
--c-name PAD_res "${CMAKE_SOURCE_DIR}/pcsx2/PAD/Linux/res/PAD-res.xml" --target=${CMAKE_BINARY_DIR}/pcsx2/PAD/Linux/resources_pad.cpp --c-name PAD_res "${CMAKE_SOURCE_DIR}/pcsx2/PAD/Linux/res/PAD-res.xml" --target=${CMAKE_BINARY_DIR}/pcsx2/PAD/Linux/resources_pad.cpp
DEPENDS ${CMAKE_SOURCE_DIR}/pcsx2/PAD/Linux/res/PAD-res.xml ${CMAKE_SOURCE_DIR}/pcsx2/PAD/Linux/res/game_controller_db.txt) DEPENDS ${CMAKE_SOURCE_DIR}/pcsx2/PAD/Linux/res/PAD-res.xml ${CMAKE_SOURCE_DIR}/pcsx2/PAD/Linux/res/game_controller_db.txt)
# PAD/Linux sources # PAD/Linux sources
set(pcsx2PADSources set(pcsx2PADSources
PAD/Linux/Device.cpp PAD/Linux/Device.cpp
PAD/Linux/InputManager.cpp PAD/Linux/InputManager.cpp
PAD/Linux/SDL/joystick.cpp PAD/Linux/SDL/joystick.cpp
PAD/Linux/keyboard.cpp PAD/Linux/keyboard.cpp
PAD/Linux/KeyStatus.cpp PAD/Linux/KeyStatus.cpp
PAD/Linux/PAD.cpp PAD/Linux/PAD.cpp
PAD/Linux/state_management.cpp PAD/Linux/state_management.cpp
PAD/Linux/wx_dialog/dialog.cpp PAD/Linux/wx_dialog/dialog.cpp
PAD/Linux/wx_dialog/opPanel.cpp PAD/Linux/wx_dialog/opPanel.cpp
PAD/Linux/wx_dialog/GamepadConfiguration.cpp PAD/Linux/wx_dialog/GamepadConfiguration.cpp
PAD/Linux/wx_dialog/JoystickConfiguration.cpp PAD/Linux/wx_dialog/JoystickConfiguration.cpp
PAD/Linux/Config.cpp PAD/Linux/Config.cpp
PAD/Linux/linux.cpp PAD/Linux/linux.cpp
${CMAKE_BINARY_DIR}/pcsx2/PAD/Linux/resources_pad.cpp ${CMAKE_BINARY_DIR}/pcsx2/PAD/Linux/resources_pad.cpp
) )
# PAD/Linux headers # PAD/Linux headers
set(pcsx2PADHeaders set(pcsx2PADHeaders
PAD/Linux/bitwise.h PAD/Linux/bitwise.h
PAD/Linux/Config.h PAD/Linux/Config.h
PAD/Linux/Device.h PAD/Linux/Device.h
PAD/Linux/Global.h PAD/Linux/Global.h
PAD/Linux/InputManager.h PAD/Linux/InputManager.h
PAD/Linux/SDL/joystick.h PAD/Linux/SDL/joystick.h
PAD/Linux/keyboard.h PAD/Linux/keyboard.h
PAD/Linux/KeyStatus.h PAD/Linux/KeyStatus.h
PAD/Linux/PAD.h PAD/Linux/PAD.h
PAD/Linux/state_management.h PAD/Linux/state_management.h
PAD/Linux/wx_dialog/opPanel.h PAD/Linux/wx_dialog/opPanel.h
PAD/Linux/wx_dialog/GamepadConfiguration.h PAD/Linux/wx_dialog/GamepadConfiguration.h
PAD/Linux/wx_dialog/JoystickConfiguration.h PAD/Linux/wx_dialog/JoystickConfiguration.h
${CMAKE_BINARY_DIR}/pcsx2/PAD/Linux/resources_pad.h ${CMAKE_BINARY_DIR}/pcsx2/PAD/Linux/resources_pad.h
# images # images
${PADImgHeader}/analog.h ${PADImgHeader}/analog.h
${PADImgHeader}/circle.h ${PADImgHeader}/circle.h
${PADImgHeader}/cross.h ${PADImgHeader}/cross.h
${PADImgHeader}/dp_bottom.h ${PADImgHeader}/dp_bottom.h
${PADImgHeader}/dp_left.h ${PADImgHeader}/dp_left.h
${PADImgHeader}/dp_right.h ${PADImgHeader}/dp_right.h
${PADImgHeader}/dp_up.h ${PADImgHeader}/dp_up.h
${PADImgHeader}/dualshock2.h ${PADImgHeader}/dualshock2.h
${PADImgHeader}/joystick_cursor.h ${PADImgHeader}/joystick_cursor.h
${PADImgHeader}/l1.h ${PADImgHeader}/l1.h
${PADImgHeader}/r1.h ${PADImgHeader}/r1.h
${PADImgHeader}/l2.h ${PADImgHeader}/l2.h
${PADImgHeader}/r2.h ${PADImgHeader}/r2.h
${PADImgHeader}/l3.h ${PADImgHeader}/l3.h
${PADImgHeader}/r3.h ${PADImgHeader}/r3.h
${PADImgHeader}/select.h ${PADImgHeader}/select.h
${PADImgHeader}/square.h ${PADImgHeader}/square.h
${PADImgHeader}/start.h ${PADImgHeader}/start.h
${PADImgHeader}/triangle.h ${PADImgHeader}/triangle.h
${PADImgHeader}/arrow_up.h ${PADImgHeader}/arrow_up.h
${PADImgHeader}/arrow_bottom.h ${PADImgHeader}/arrow_bottom.h
${PADImgHeader}/arrow_left.h ${PADImgHeader}/arrow_left.h
${PADImgHeader}/arrow_right.h ${PADImgHeader}/arrow_right.h
) )
# GS sources # GS sources
set(pcsx2GSSources set(pcsx2GSSources
@ -883,22 +883,22 @@ set(pcsx2GuiHeaders
set(res_bin "${CMAKE_BINARY_DIR}/pcsx2/gui/Resources") set(res_bin "${CMAKE_BINARY_DIR}/pcsx2/gui/Resources")
set(res_src "${CMAKE_SOURCE_DIR}/pcsx2/gui/Resources") set(res_src "${CMAKE_SOURCE_DIR}/pcsx2/gui/Resources")
set(pcsx2GuiResources set(pcsx2GuiResources
${res_bin}/AppIcon16.h ${res_bin}/AppIcon16.h
${res_bin}/AppIcon32.h ${res_bin}/AppIcon32.h
${res_bin}/AppIcon64.h ${res_bin}/AppIcon64.h
${res_bin}/BackgroundLogo.h ${res_bin}/BackgroundLogo.h
${res_bin}/ButtonIcon_Camera.h ${res_bin}/ButtonIcon_Camera.h
${res_bin}/ConfigIcon_Cpu.h ${res_bin}/ConfigIcon_Cpu.h
${res_bin}/ConfigIcon_Gamefixes.h ${res_bin}/ConfigIcon_Gamefixes.h
${res_bin}/ConfigIcon_MemoryCard.h ${res_bin}/ConfigIcon_MemoryCard.h
${res_bin}/ConfigIcon_Paths.h ${res_bin}/ConfigIcon_Paths.h
${res_bin}/ConfigIcon_Speedhacks.h ${res_bin}/ConfigIcon_Speedhacks.h
${res_bin}/ConfigIcon_Video.h ${res_bin}/ConfigIcon_Video.h
${res_bin}/Logo.h ${res_bin}/Logo.h
${res_bin}/NoIcon.h ${res_bin}/NoIcon.h
${res_bin}/Breakpoint_Active.h ${res_bin}/Breakpoint_Active.h
${res_bin}/Breakpoint_Inactive.h ${res_bin}/Breakpoint_Inactive.h
) )
# IPU sources # IPU sources
set(pcsx2IPUSources set(pcsx2IPUSources
@ -927,7 +927,7 @@ set(pcsx2LinuxSources
Linux/LnxConsolePipe.cpp Linux/LnxConsolePipe.cpp
Linux/LnxKeyCodes.cpp Linux/LnxKeyCodes.cpp
Linux/LnxFlatFileReader.cpp Linux/LnxFlatFileReader.cpp
) )
set(pcsx2OSXSources set(pcsx2OSXSources
CDVD/Linux/DriveUtility.cpp CDVD/Linux/DriveUtility.cpp
@ -1060,12 +1060,12 @@ set(pcsx2UtilitiesHeaders
# Zip tools utilies sources # Zip tools utilies sources
set(pcsx2ZipToolsSources set(pcsx2ZipToolsSources
ZipTools/thread_gzip.cpp ZipTools/thread_gzip.cpp
ZipTools/thread_lzma.cpp) ZipTools/thread_lzma.cpp)
# Zip tools utilies headers # Zip tools utilies headers
set(pcsx2ZipToolsHeaders set(pcsx2ZipToolsHeaders
ZipTools/ThreadedZipTools.h) ZipTools/ThreadedZipTools.h)
# Windows sources # Windows sources
@ -1200,7 +1200,7 @@ if(Linux)
${pcsx2USBSources} ${pcsx2USBSources}
${pcsx2USBHeaders} ${pcsx2USBHeaders}
) )
set(Platform_Libs set(Platform_Libs
${LIBUDEV_LIBRARIES} ${LIBUDEV_LIBRARIES}
${X11_LIBRARIES} ${X11_LIBRARIES}
@ -1237,64 +1237,64 @@ set(pcsx2FinalSources
) )
set(pcsx2FinalLibs set(pcsx2FinalLibs
Utilities Utilities
x86emitter x86emitter
fmt::fmt fmt::fmt
${wxWidgets_LIBRARIES} ${wxWidgets_LIBRARIES}
${GTK2_LIBRARIES} ${GTK2_LIBRARIES}
${ZLIB_LIBRARIES} ${ZLIB_LIBRARIES}
${AIO_LIBRARIES} ${AIO_LIBRARIES}
${GCOV_LIBRARIES} ${GCOV_LIBRARIES}
${ALSA_LIBRARIES} ${ALSA_LIBRARIES}
${SOUNDTOUCH_LIBRARIES} ${SOUNDTOUCH_LIBRARIES}
${SDL2_LIBRARIES} ${SDL2_LIBRARIES}
${PCAP_LIBRARY} ${PCAP_LIBRARY}
${LIBSAMPLERATE_LIBRARIES} ${LIBSAMPLERATE_LIBRARIES}
${LIBXML2_LIBRARIES} ${LIBXML2_LIBRARIES}
${LIBC_LIBRARIES} ${LIBC_LIBRARIES}
${PNG_LIBRARIES} ${PNG_LIBRARIES}
${FREETYPE_LIBRARIES} ${FREETYPE_LIBRARIES}
${LIBLZMA_LIBRARIES} ${LIBLZMA_LIBRARIES}
${OPENGL_LIBRARIES} ${OPENGL_LIBRARIES}
${EGL_LIBRARIES} ${EGL_LIBRARIES}
${Platform_Libs} ${Platform_Libs}
) )
if(PORTAUDIO_FOUND) if(PORTAUDIO_FOUND)
set(pcsx2FinalLibs ${pcsx2FinalLibs} ${PORTAUDIO_LIBRARIES}) set(pcsx2FinalLibs ${pcsx2FinalLibs} ${PORTAUDIO_LIBRARIES})
endif() endif()
if(PULSEAUDIO_FOUND) if(PULSEAUDIO_FOUND)
set(pcsx2FinalLibs ${pcsx2FinalLibs} ${PULSEAUDIO_LIBRARIES}) set(pcsx2FinalLibs ${pcsx2FinalLibs} ${PULSEAUDIO_LIBRARIES})
endif() endif()
# additonal include directories # additonal include directories
include_directories( include_directories(
gui gui
x86 x86
${CMAKE_BINARY_DIR}/pcsx2/gui ${CMAKE_BINARY_DIR}/pcsx2/gui
) )
### Generate the resources files ### Generate the resources files
file(MAKE_DIRECTORY ${res_bin}) file(MAKE_DIRECTORY ${res_bin})
foreach(res_file IN ITEMS foreach(res_file IN ITEMS
AppIcon16 AppIcon32 AppIcon64 BackgroundLogo Logo NoIcon ButtonIcon_Camera AppIcon16 AppIcon32 AppIcon64 BackgroundLogo Logo NoIcon ButtonIcon_Camera
ConfigIcon_Cpu ConfigIcon_Gamefixes ConfigIcon_MemoryCard ConfigIcon_Cpu ConfigIcon_Gamefixes ConfigIcon_MemoryCard
ConfigIcon_Paths ConfigIcon_Speedhacks ConfigIcon_Video Breakpoint_Active Breakpoint_Inactive) ConfigIcon_Paths ConfigIcon_Speedhacks ConfigIcon_Video Breakpoint_Active Breakpoint_Inactive)
add_custom_command(OUTPUT "${res_bin}/${res_file}.h" COMMAND perl ${CMAKE_SOURCE_DIR}/linux_various/hex2h.pl "${res_src}/${res_file}.png" "${res_bin}/${res_file}" ) add_custom_command(OUTPUT "${res_bin}/${res_file}.h" COMMAND perl ${CMAKE_SOURCE_DIR}/linux_various/hex2h.pl "${res_src}/${res_file}.png" "${res_bin}/${res_file}" )
endforeach() endforeach()
### Generate Recording resource files ### Generate Recording resource files
### Drop them into the folder alongside the png files ### Drop them into the folder alongside the png files
foreach(res_file IN ITEMS foreach(res_file IN ITEMS
circlePressed controllerFull controllerHalf controllerThreeQuarters crossPressed downPressed l1Pressed l2Pressed l3Pressed leftPressed circlePressed controllerFull controllerHalf controllerThreeQuarters crossPressed downPressed l1Pressed l2Pressed l3Pressed leftPressed
r1Pressed r2Pressed r3Pressed rightPressed selectPressed squarePressed startPressed trianglePressed upPressed) r1Pressed r2Pressed r3Pressed rightPressed selectPressed squarePressed startPressed trianglePressed upPressed)
add_custom_command(OUTPUT "${res_rec_vp_src}/${res_file}.h" COMMAND perl ${CMAKE_SOURCE_DIR}/linux_various/hex2h.pl "${res_rec_vp_src}/${res_file}.png" "${res_rec_vp_src}/${res_file}" ) add_custom_command(OUTPUT "${res_rec_vp_src}/${res_file}.h" COMMAND perl ${CMAKE_SOURCE_DIR}/linux_various/hex2h.pl "${res_rec_vp_src}/${res_file}.png" "${res_rec_vp_src}/${res_file}" )
endforeach() endforeach()
if(USE_VTUNE) if(USE_VTUNE)
set(pcsx2FinalLibs ${pcsx2FinalLibs} ${VTUNE_LIBRARIES}) set(pcsx2FinalLibs ${pcsx2FinalLibs} ${VTUNE_LIBRARIES})
endif() endif()
add_pcsx2_executable(${Output} "${pcsx2FinalSources}" "${pcsx2FinalLibs}" "${pcsx2FinalFlags}") add_pcsx2_executable(${Output} "${pcsx2FinalSources}" "${pcsx2FinalLibs}" "${pcsx2FinalFlags}")
@ -1338,9 +1338,9 @@ if (APPLE)
endif() endif()
if(NOT DISABLE_SETCAP) if(NOT DISABLE_SETCAP)
if(PACKAGE_MODE) if(PACKAGE_MODE)
install(CODE "execute_process(COMMAND /bin/bash -c \"echo 'Enabling networking capability on Linux...';set -x; [ -f '${CMAKE_INSTALL_FULL_BINDIR}/${Output}' ] && sudo setcap 'CAP_NET_RAW+eip CAP_NET_ADMIN+eip' '${CMAKE_INSTALL_FULL_BINDIR}/${Output}'; set +x\")") install(CODE "execute_process(COMMAND /bin/bash -c \"echo 'Enabling networking capability on Linux...';set -x; [ -f '${CMAKE_INSTALL_FULL_BINDIR}/${Output}' ] && sudo setcap 'CAP_NET_RAW+eip CAP_NET_ADMIN+eip' '${CMAKE_INSTALL_FULL_BINDIR}/${Output}'; set +x\")")
else() else()
install(CODE "execute_process(COMMAND /bin/bash -c \"echo 'Enabling networking capability on Linux...';set -x; [ -f '${CMAKE_SOURCE_DIR}/bin/${Output}' ] && sudo setcap 'CAP_NET_RAW+eip CAP_NET_ADMIN+eip' '${CMAKE_SOURCE_DIR}/bin/${Output}'; set +x\")") install(CODE "execute_process(COMMAND /bin/bash -c \"echo 'Enabling networking capability on Linux...';set -x; [ -f '${CMAKE_SOURCE_DIR}/bin/${Output}' ] && sudo setcap 'CAP_NET_RAW+eip CAP_NET_ADMIN+eip' '${CMAKE_SOURCE_DIR}/bin/${Output}'; set +x\")")
endif() endif()
endif() endif()

View File

@ -3,10 +3,10 @@ add_custom_target(unittests)
add_custom_command(TARGET unittests POST_BUILD COMMAND ${CMAKE_CTEST_COMMAND}) add_custom_command(TARGET unittests POST_BUILD COMMAND ${CMAKE_CTEST_COMMAND})
macro(add_pcsx2_test target) macro(add_pcsx2_test target)
add_executable(${target} EXCLUDE_FROM_ALL ${ARGN}) add_executable(${target} EXCLUDE_FROM_ALL ${ARGN})
target_link_libraries(${target} PRIVATE x86emitter gtest_main Utilities) target_link_libraries(${target} PRIVATE x86emitter gtest_main Utilities)
add_dependencies(unittests ${target}) add_dependencies(unittests ${target})
add_test(NAME ${target} COMMAND ${target}) add_test(NAME ${target} COMMAND ${target})
endmacro() endmacro()
add_subdirectory(x86emitter) add_subdirectory(x86emitter)