c Make Lists
c Make Lists
2)
project(Vita3K)
# Detects the amount of processors of the host machine and forwards the result to
CPU_COUNT
include(ProcessorCount)
ProcessorCount(CPU_COUNT)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_OSX_DEPLOYMENT_TARGET 12.0)
if(MSVC)
string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
string(REPLACE "/Zi" "/Z7" CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}")
string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_RELEASE "$
{CMAKE_CXX_FLAGS_RELEASE}")
string(REPLACE "/Zi" "/Z7" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_RELWITHDEBINFO "$
{CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
string(REPLACE "/Zi" "/Z7" CMAKE_C_FLAGS_RELWITHDEBINFO "$
{CMAKE_C_FLAGS_RELWITHDEBINFO}")
endif()
enable_testing()
if( ipo_supported )
if (USE_LTO STREQUAL "ALWAYS")
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
elseif (USE_LTO STREQUAL "RELEASE_ONLY")
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE TRUE)
endif()
else()
message(STATUS "IPO / LTO not supported: <${ipo_supported_error}>")
set(USE_LTO NEVER CACHE STRING "Use interprocedural optimization/link time
optimization")
endif()
endif()
############################
########## Boost ###########
############################
set(Boost_NO_WARN_NEW_VERSIONS 1)
# If system Boost hasn't been found, then enable hints to find custom
Boost
if (NOT Boost_FOUND)
message(STATUS "A Boost distribution that meets the requirements
needed for the project hasn't been found in your system. Falling back to custom
Boost distribution...")
# Set path hints for Boost search inside the repository folder
and assist in compilation if needed
set(BOOST_SOURCEDIR "${CMAKE_SOURCE_DIR}/external/boost") #
For internal use
set(BOOST_INSTALLDIR "${CMAKE_BINARY_DIR}/external/boost") #
For internal use
set(BOOST_ROOT "${BOOST_SOURCEDIR}") #
find_package(Boost ...) hint
set(BOOST_INCLUDEDIR "${BOOST_SOURCEDIR}") #
find_package(Boost ...) hint
set(BOOST_LIBRARYDIR "${BOOST_INSTALLDIR}/libs") #
find_package(Boost ...) hint
# Find b2
find_program(b2 NAME ${b2_EXECUTABLE_NAME} PATHS $
{BOOST_SOURCEDIR} NO_CACHE NO_DEFAULT_PATH)
# Compile Boost
message(STATUS "Compiling Boost...")
boost_compile()
get_boost()
if(WIN32)
add_definitions (/D "_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS" /D
"_CRT_SECURE_NO_WARNINGS" /D "NOMINMAX")
endif()
if (${BUILD_APPIMAGE})
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(LINUXDEPLOY_COMMAND
"${CMAKE_SOURCE_DIR}/appimage/linuxdeploy.AppImage" CACHE INTERNAL "")
if (NOT EXISTS "${LINUXDEPLOY_COMMAND}")
message(FATAL_ERROR "Could not find linuxdeploy at $
{LINUXDEPLOY_COMMAND}!")
endif()
else()
message(FATAL_ERROR "Cannot build an AppImage for a non-Linux host.")
endif()
endif()
add_subdirectory(external)
add_subdirectory(vita3k)
add_subdirectory(tools/gen-modules)