mirror of https://github.com/minetest/minetest.git
Specify all source fools directly on IrrlichtMt
This commit is contained in:
parent
70274896b6
commit
a44905b5db
|
@ -1,179 +0,0 @@
|
|||
|
||||
if(ENABLE_OPENGL3)
|
||||
set(IRRDRVROBJ
|
||||
${IRRDRVROBJ}
|
||||
OpenGL3/Driver.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
if(ENABLE_GLES2)
|
||||
set(IRRDRVROBJ
|
||||
${IRRDRVROBJ}
|
||||
OpenGLES2/Driver.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
set(IRRIMAGEOBJ
|
||||
CColorConverter.cpp
|
||||
CImage.cpp
|
||||
CImageLoaderBMP.cpp
|
||||
CImageLoaderJPG.cpp
|
||||
CImageLoaderPNG.cpp
|
||||
CImageLoaderTGA.cpp
|
||||
CImageWriterJPG.cpp
|
||||
CImageWriterPNG.cpp
|
||||
)
|
||||
|
||||
add_library(IRRVIDEOOBJ OBJECT
|
||||
CFPSCounter.cpp
|
||||
${IRRDRVROBJ}
|
||||
${IRRIMAGEOBJ}
|
||||
)
|
||||
|
||||
add_library(IRRIOOBJ OBJECT
|
||||
CFileList.cpp
|
||||
CFileSystem.cpp
|
||||
CLimitReadFile.cpp
|
||||
CMemoryFile.cpp
|
||||
CReadFile.cpp
|
||||
CWriteFile.cpp
|
||||
CZipReader.cpp
|
||||
CAttributes.cpp
|
||||
)
|
||||
|
||||
add_library(IRROTHEROBJ OBJECT
|
||||
CIrrDeviceSDL.cpp
|
||||
CIrrDeviceLinux.cpp
|
||||
CIrrDeviceStub.cpp
|
||||
CIrrDeviceWin32.cpp
|
||||
CLogger.cpp
|
||||
COSOperator.cpp
|
||||
Irrlicht.cpp
|
||||
os.cpp
|
||||
)
|
||||
|
||||
if(ENABLE_OPENGL3)
|
||||
target_compile_definitions(IRROTHEROBJ PRIVATE ENABLE_OPENGL3)
|
||||
endif()
|
||||
|
||||
if(ANDROID)
|
||||
target_sources(IRROTHEROBJ PRIVATE
|
||||
Android/CIrrDeviceAndroid.cpp
|
||||
Android/CAndroidAssetReader.cpp
|
||||
Android/CAndroidAssetFileArchive.cpp
|
||||
Android/CKeyEventWrapper.cpp
|
||||
)
|
||||
elseif(APPLE)
|
||||
# Build all IRROTHEROBJ sources as objc++, including the .cpp's
|
||||
set_target_properties(IRROTHEROBJ PROPERTIES COMPILE_OPTIONS "-xobjective-c++")
|
||||
target_sources(IRROTHEROBJ PRIVATE
|
||||
CIrrDeviceOSX.mm
|
||||
CNSOGLManager.mm
|
||||
)
|
||||
endif()
|
||||
|
||||
if(USE_X11)
|
||||
target_compile_definitions(IRROTHEROBJ PRIVATE _IRR_COMPILE_WITH_X11_)
|
||||
endif()
|
||||
|
||||
if(USE_XINPUT2)
|
||||
target_compile_definitions(IRROTHEROBJ PRIVATE _IRR_LINUX_X11_XINPUT2_)
|
||||
endif()
|
||||
|
||||
if(USE_XCURSOR)
|
||||
target_compile_definitions(IRROTHEROBJ PRIVATE _IRR_LINUX_XCURSOR_)
|
||||
endif()
|
||||
|
||||
add_library(IRRGUIOBJ OBJECT
|
||||
CGUIButton.cpp
|
||||
CGUICheckBox.cpp
|
||||
CGUIComboBox.cpp
|
||||
CGUIEditBox.cpp
|
||||
CGUIEnvironment.cpp
|
||||
CGUIFileOpenDialog.cpp
|
||||
CGUIFont.cpp
|
||||
CGUIImage.cpp
|
||||
CGUIListBox.cpp
|
||||
CGUIScrollBar.cpp
|
||||
CGUISkin.cpp
|
||||
CGUIStaticText.cpp
|
||||
CGUITabControl.cpp
|
||||
CGUISpriteBank.cpp
|
||||
CGUIImageList.cpp
|
||||
)
|
||||
|
||||
# Library
|
||||
|
||||
add_library(IrrlichtMt)
|
||||
foreach(object_lib
|
||||
IRRMESHOBJ IRROBJ IRRVIDEOOBJ
|
||||
IRRIOOBJ IRROTHEROBJ IRRGUIOBJ)
|
||||
# Set include directories for object library compilation
|
||||
target_include_directories(${object_lib} PRIVATE ${link_includes})
|
||||
# Add objects from object library to main library
|
||||
target_sources(IrrlichtMt PRIVATE $<TARGET_OBJECTS:${object_lib}>)
|
||||
endforeach()
|
||||
|
||||
# Alias target provides add_submodule compatibility
|
||||
add_library(IrrlichtMt::IrrlichtMt ALIAS IrrlichtMt)
|
||||
|
||||
target_include_directories(IrrlichtMt
|
||||
PUBLIC
|
||||
"$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include/>"
|
||||
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>"
|
||||
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/irrlichtmt>"
|
||||
PRIVATE
|
||||
${link_includes}
|
||||
)
|
||||
|
||||
# this needs to be here and not in a variable (like link_includes) due to issues
|
||||
# with the generator expressions on at least CMake 3.22, but not 3.28 or later
|
||||
target_link_libraries(IrrlichtMt PRIVATE
|
||||
${ZLIB_LIBRARY}
|
||||
${JPEG_LIBRARY}
|
||||
${PNG_LIBRARY}
|
||||
tinygltf::tinygltf
|
||||
"$<$<BOOL:${USE_SDL2}>:SDL2::SDL2>"
|
||||
|
||||
"$<$<BOOL:${OPENGL_DIRECT_LINK}>:${OPENGL_LIBRARIES}>"
|
||||
"$<$<BOOL:${OPENGLES_DIRECT_LINK}>:${OPENGLES_LIBRARY}>"
|
||||
${EGL_LIBRARY}
|
||||
|
||||
"$<$<PLATFORM_ID:Android>:-landroid -llog>"
|
||||
${COCOA_LIB}
|
||||
${IOKIT_LIB}
|
||||
"$<$<PLATFORM_ID:Windows>:gdi32>"
|
||||
"$<$<PLATFORM_ID:Windows>:winmm>"
|
||||
"$<$<BOOL:${USE_X11}>:${X11_X11_LIB}>"
|
||||
"$<$<BOOL:${USE_X11}>:${X11_Xi_LIB}>"
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
target_compile_definitions(IrrlichtMt INTERFACE _IRR_WINDOWS_API_) # used in _IRR_DEBUG_BREAK_IF definition in a public header
|
||||
endif()
|
||||
target_compile_definitions(IrrlichtMt INTERFACE "IRRLICHT_API=${API_IMPORT}")
|
||||
if(APPLE OR ANDROID OR EMSCRIPTEN)
|
||||
target_compile_definitions(IrrlichtMt PUBLIC IRR_MOBILE_PATHS)
|
||||
endif()
|
||||
|
||||
set_target_properties(IrrlichtMt PROPERTIES
|
||||
VERSION ${PROJECT_VERSION}
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
set_target_properties(IrrlichtMt PROPERTIES PREFIX "") # for DLL name
|
||||
endif()
|
||||
|
||||
add_subdirectory(tests)
|
||||
|
||||
# Installation of library
|
||||
if(ANDROID)
|
||||
set(INSTALL_TARGETS IrrlichtMt tinygltf native_app_glue)
|
||||
else()
|
||||
set(INSTALL_TARGETS IrrlichtMt)
|
||||
endif()
|
||||
|
||||
install(TARGETS ${INSTALL_TARGETS}
|
||||
EXPORT IrrlichtMt-export
|
||||
DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||
)
|
Loading…
Reference in New Issue