cmake: add beta10 target (#1163)

* cmake: use PROJECT_SOURCE_DIR instead of CMAKE_SOURCE_DIR

* cmake: add beta10 target
This commit is contained in:
Anonymous Maarten 2024-11-22 01:08:47 +01:00 committed by GitHub
parent 5e0dc1a160
commit cdc761d920
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 412 additions and 384 deletions

View file

@ -11,3 +11,6 @@ indent_style = tab
tab_width = 4 tab_width = 4
insert_final_newline = true insert_final_newline = true
trim_trailing_whitespace = true trim_trailing_whitespace = true
[{CMakeLists.txt,*.cmake}]
indent_size = 2

View file

@ -32,11 +32,6 @@ if (MSVC)
endif() endif()
endif() endif()
set(lego1_targets)
macro(register_lego1_target __target)
list(APPEND lego1_targets ${__target})
endmacro()
function(add_cxx_warning WARNING) function(add_cxx_warning WARNING)
if(ISLE_WERROR) if(ISLE_WERROR)
set(compiler_option "-Werror=${WARNING}") set(compiler_option "-Werror=${WARNING}")
@ -65,32 +60,40 @@ message(STATUS "MSVC for decompilation: ${MSVC_FOR_DECOMP}")
option(ISLE_WERROR "Treat warnings as errors" OFF) option(ISLE_WERROR "Treat warnings as errors" OFF)
option(ISLE_BUILD_APP "Build ISLE.EXE application" ON) option(ISLE_BUILD_APP "Build ISLE.EXE application" ON)
cmake_dependent_option(ISLE_BUILD_CONFIG "Build CONFIG.EXE application" ON "NOT MINGW" OFF) cmake_dependent_option(ISLE_BUILD_CONFIG "Build CONFIG.EXE application" ON "NOT MINGW" OFF)
option(ISLE_USE_SMARTHEAP "Build with SmartHeap" ${MSVC_FOR_DECOMP}) option(ISLE_USE_SMARTHEAP "Build LEGO1.DLL with SmartHeap" ${MSVC_FOR_DECOMP})
option(ISLE_USE_DX5 "Build with internal DirectX 5 SDK" ON) option(ISLE_USE_DX5 "Build with internal DirectX 5 SDK" ON)
option(ISLE_DECOMP_ASSERT "Assert struct size" ${MSVC_FOR_DECOMP}) option(ISLE_DECOMP_ASSERT "Assert struct size" ${MSVC_FOR_DECOMP})
cmake_dependent_option(ISLE_USE_DX5_LIBS "Build with internal DirectX 5 SDK Libraries" ON ISLE_USE_DX5 OFF) cmake_dependent_option(ISLE_USE_DX5_LIBS "Build with internal DirectX 5 SDK Libraries" ON ISLE_USE_DX5 OFF)
option(ISLE_BUILD_BETA10 "Build BETA10.EXE library" OFF)
add_cxx_warning(parentheses) add_cxx_warning(parentheses)
add_library(DirectX5::DirectX5 INTERFACE IMPORTED) add_library(DirectX5::DirectX5 INTERFACE IMPORTED)
target_include_directories(DirectX5::DirectX5 INTERFACE "${CMAKE_SOURCE_DIR}/3rdparty/dx5/inc") target_include_directories(DirectX5::DirectX5 INTERFACE "${PROJECT_SOURCE_DIR}/3rdparty/dx5/inc")
if(ISLE_USE_DX5_LIBS) if(ISLE_USE_DX5_LIBS)
target_link_directories(DirectX5::DirectX5 INTERFACE "${CMAKE_SOURCE_DIR}/3rdparty/dx5/lib") target_link_directories(DirectX5::DirectX5 INTERFACE "${PROJECT_SOURCE_DIR}/3rdparty/dx5/lib")
endif() endif()
add_library(Smacker::Smacker STATIC IMPORTED) add_library(Smacker::Smacker STATIC IMPORTED)
set_property(TARGET Smacker::Smacker PROPERTY IMPORTED_LOCATION "${CMAKE_SOURCE_DIR}/3rdparty/smacker/smack.lib") set_property(TARGET Smacker::Smacker PROPERTY IMPORTED_LOCATION "${PROJECT_SOURCE_DIR}/3rdparty/smacker/smack.lib")
set_property(TARGET Smacker::Smacker PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_SOURCE_DIR}/3rdparty/smacker") set_property(TARGET Smacker::Smacker PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${PROJECT_SOURCE_DIR}/3rdparty/smacker")
add_library(Vec::Vec INTERFACE IMPORTED) add_library(Vec::Vec INTERFACE IMPORTED)
target_include_directories(Vec::Vec INTERFACE "${CMAKE_SOURCE_DIR}/3rdparty/vec") target_include_directories(Vec::Vec INTERFACE "${PROJECT_SOURCE_DIR}/3rdparty/vec")
add_library(SmartHeap::SmartHeap STATIC IMPORTED) add_library(SmartHeap::SmartHeap STATIC IMPORTED)
set_property(TARGET SmartHeap::SmartHeap PROPERTY IMPORTED_LOCATION "${CMAKE_SOURCE_DIR}/3rdparty/smartheap/SHLW32MT.LIB") set_property(TARGET SmartHeap::SmartHeap PROPERTY IMPORTED_LOCATION "${PROJECT_SOURCE_DIR}/3rdparty/smartheap/SHLW32MT.LIB")
set_property(TARGET SmartHeap::SmartHeap PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_SOURCE_DIR}/3rdparty/smartheap") set_property(TARGET SmartHeap::SmartHeap PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${PROJECT_SOURCE_DIR}/3rdparty/smartheap")
set_property(TARGET SmartHeap::SmartHeap PROPERTY INTERFACE_COMPILE_OPTIONS "/FI${CMAKE_SOURCE_DIR}/3rdparty/smartheap/SMRTHEAP.HPP") set_property(TARGET SmartHeap::SmartHeap PROPERTY INTERFACE_COMPILE_OPTIONS "/FI${PROJECT_SOURCE_DIR}/3rdparty/smartheap/SMRTHEAP.HPP")
add_library(tglrl STATIC function(add_lego_libraries NAME)
cmake_parse_arguments(ARG "" "SUFFIX;OUT_TARGETS;DLL_OUTPUT_NAME;DLL_PREFIX;DLL_SUFFIX" "LINK_LIBRARIES" ${ARGN})
set(list_targets )
set(SUFFIX "${ARG_SUFFIX}")
add_library(tglrl${ARG_SUFFIX} STATIC
LEGO1/tgl/d3drm/camera.cpp LEGO1/tgl/d3drm/camera.cpp
LEGO1/tgl/d3drm/device.cpp LEGO1/tgl/d3drm/device.cpp
LEGO1/tgl/d3drm/group.cpp LEGO1/tgl/d3drm/group.cpp
@ -100,56 +103,56 @@ add_library(tglrl STATIC
LEGO1/tgl/d3drm/renderer.cpp LEGO1/tgl/d3drm/renderer.cpp
LEGO1/tgl/d3drm/texture.cpp LEGO1/tgl/d3drm/texture.cpp
LEGO1/tgl/d3drm/view.cpp LEGO1/tgl/d3drm/view.cpp
) )
register_lego1_target(tglrl) list(APPEND list_targets tglrl${ARG_SUFFIX})
set_property(TARGET tglrl PROPERTY ARCHIVE_OUTPUT_NAME "tglrl40$<$<CONFIG:Debug>:d>") set_property(TARGET tglrl${ARG_SUFFIX} PROPERTY ARCHIVE_OUTPUT_NAME "tglrl40$<$<CONFIG:Debug>:d>${ARG_SUFFIX}")
target_include_directories(tglrl PRIVATE "${CMAKE_SOURCE_DIR}/LEGO1" "${CMAKE_SOURCE_DIR}/util") target_include_directories(tglrl${ARG_SUFFIX} PRIVATE "${PROJECT_SOURCE_DIR}/LEGO1" "${PROJECT_SOURCE_DIR}/util")
target_link_libraries(tglrl PRIVATE d3drm) target_link_libraries(tglrl${ARG_SUFFIX} PRIVATE d3drm)
add_library(realtime STATIC add_library(realtime${ARG_SUFFIX} STATIC
LEGO1/realtime/matrix.cpp LEGO1/realtime/matrix.cpp
LEGO1/realtime/orientableroi.cpp LEGO1/realtime/orientableroi.cpp
LEGO1/realtime/realtime.cpp LEGO1/realtime/realtime.cpp
LEGO1/realtime/realtimeview.cpp LEGO1/realtime/realtimeview.cpp
LEGO1/realtime/vector.cpp LEGO1/realtime/vector.cpp
) )
register_lego1_target(realtime) list(APPEND list_targets realtime${ARG_SUFFIX})
set_property(TARGET realtime PROPERTY ARCHIVE_OUTPUT_NAME "realtime$<$<CONFIG:Debug>:d>") set_property(TARGET realtime${ARG_SUFFIX} PROPERTY ARCHIVE_OUTPUT_NAME "realtime$<$<CONFIG:Debug>:d>${ARG_SUFFIX}")
target_include_directories(realtime PRIVATE "${CMAKE_SOURCE_DIR}/LEGO1" "${CMAKE_SOURCE_DIR}/util") target_include_directories(realtime${ARG_SUFFIX} PRIVATE "${PROJECT_SOURCE_DIR}/LEGO1" "${PROJECT_SOURCE_DIR}/util")
target_link_libraries(realtime PRIVATE Vec::Vec) target_link_libraries(realtime${ARG_SUFFIX} PRIVATE Vec::Vec)
add_library(viewmanager STATIC add_library(viewmanager${ARG_SUFFIX} STATIC
LEGO1/viewmanager/viewlod.cpp LEGO1/viewmanager/viewlod.cpp
LEGO1/viewmanager/viewlodlist.cpp LEGO1/viewmanager/viewlodlist.cpp
LEGO1/viewmanager/viewmanager.cpp LEGO1/viewmanager/viewmanager.cpp
LEGO1/viewmanager/viewroi.cpp LEGO1/viewmanager/viewroi.cpp
) )
register_lego1_target(viewmanager) list(APPEND list_targets viewmanager${ARG_SUFFIX})
set_property(TARGET viewmanager PROPERTY ARCHIVE_OUTPUT_NAME "viewmanager$<$<CONFIG:Debug>:d>") set_property(TARGET viewmanager${ARG_SUFFIX} PROPERTY ARCHIVE_OUTPUT_NAME "viewmanager$<$<CONFIG:Debug>:d>${ARG_SUFFIX}")
target_include_directories(viewmanager PRIVATE "${CMAKE_SOURCE_DIR}/LEGO1" "${CMAKE_SOURCE_DIR}/util") target_include_directories(viewmanager${ARG_SUFFIX} PRIVATE "${PROJECT_SOURCE_DIR}/LEGO1" "${PROJECT_SOURCE_DIR}/util")
target_link_libraries(viewmanager PRIVATE Vec::Vec) target_link_libraries(viewmanager${ARG_SUFFIX} PRIVATE Vec::Vec)
add_library(mxdirectx STATIC add_library(mxdirectx${ARG_SUFFIX} STATIC
LEGO1/mxdirectx/mxdirect3d.cpp LEGO1/mxdirectx/mxdirect3d.cpp
LEGO1/mxdirectx/mxdirectdraw.cpp LEGO1/mxdirectx/mxdirectdraw.cpp
LEGO1/mxdirectx/mxdirectxinfo.cpp LEGO1/mxdirectx/mxdirectxinfo.cpp
LEGO1/mxdirectx/legodxinfo.cpp LEGO1/mxdirectx/legodxinfo.cpp
) )
register_lego1_target(mxdirectx) list(APPEND list_targets mxdirectx${ARG_SUFFIX})
set_property(TARGET mxdirectx PROPERTY ARCHIVE_OUTPUT_NAME "MxDirectX$<$<CONFIG:Debug>:d>") set_property(TARGET mxdirectx${ARG_SUFFIX} PROPERTY ARCHIVE_OUTPUT_NAME "MxDirectX$<$<CONFIG:Debug>:d>${ARG_SUFFIX}")
target_include_directories(mxdirectx PRIVATE "${CMAKE_SOURCE_DIR}/LEGO1" "${CMAKE_SOURCE_DIR}/util") target_include_directories(mxdirectx${ARG_SUFFIX} PRIVATE "${PROJECT_SOURCE_DIR}/LEGO1" "${PROJECT_SOURCE_DIR}/util")
target_link_libraries(mxdirectx PRIVATE ddraw) target_link_libraries(mxdirectx${ARG_SUFFIX} PRIVATE ddraw)
add_library(roi STATIC add_library(roi${ARG_SUFFIX} STATIC
LEGO1/lego/sources/roi/legolod.cpp LEGO1/lego/sources/roi/legolod.cpp
LEGO1/lego/sources/roi/legoroi.cpp LEGO1/lego/sources/roi/legoroi.cpp
) )
register_lego1_target(roi) list(APPEND list_targets roi${ARG_SUFFIX})
set_property(TARGET roi PROPERTY ARCHIVE_OUTPUT_NAME "roi$<$<CONFIG:Debug>:d>") set_property(TARGET roi${ARG_SUFFIX} PROPERTY ARCHIVE_OUTPUT_NAME "roi$<$<CONFIG:Debug>:d>${ARG_SUFFIX}")
target_include_directories(roi PRIVATE "${CMAKE_SOURCE_DIR}/LEGO1/omni/include" "${CMAKE_SOURCE_DIR}/LEGO1" "${CMAKE_SOURCE_DIR}/LEGO1/lego/sources" "${CMAKE_SOURCE_DIR}/util") target_include_directories(roi${ARG_SUFFIX} PRIVATE "${PROJECT_SOURCE_DIR}/LEGO1/omni/include" "${PROJECT_SOURCE_DIR}/LEGO1" "${PROJECT_SOURCE_DIR}/LEGO1/lego/sources" "${PROJECT_SOURCE_DIR}/util")
target_link_libraries(roi PRIVATE viewmanager Vec::Vec) target_link_libraries(roi${ARG_SUFFIX} PRIVATE viewmanager Vec::Vec)
add_library(geom STATIC add_library(geom${ARG_SUFFIX} STATIC
LEGO1/lego/sources/geom/legobox.cpp LEGO1/lego/sources/geom/legobox.cpp
LEGO1/lego/sources/geom/legoedge.cpp LEGO1/lego/sources/geom/legoedge.cpp
LEGO1/lego/sources/geom/legomesh.cpp LEGO1/lego/sources/geom/legomesh.cpp
@ -158,21 +161,20 @@ add_library(geom STATIC
LEGO1/lego/sources/geom/legovertex.cpp LEGO1/lego/sources/geom/legovertex.cpp
LEGO1/lego/sources/geom/legoweedge.cpp LEGO1/lego/sources/geom/legoweedge.cpp
LEGO1/lego/sources/geom/legowegedge.cpp LEGO1/lego/sources/geom/legowegedge.cpp
) )
register_lego1_target(geom) list(APPEND list_targets geom${ARG_SUFFIX})
set_property(TARGET geom PROPERTY ARCHIVE_OUTPUT_NAME "geom$<$<CONFIG:Debug>:d>") set_property(TARGET geom${ARG_SUFFIX} PROPERTY ARCHIVE_OUTPUT_NAME "geom$<$<CONFIG:Debug>:d>${ARG_SUFFIX}")
target_include_directories(geom PRIVATE "${CMAKE_SOURCE_DIR}/LEGO1/omni/include" "${CMAKE_SOURCE_DIR}/LEGO1" "${CMAKE_SOURCE_DIR}/LEGO1/lego/sources" "${CMAKE_SOURCE_DIR}/util") target_include_directories(geom${ARG_SUFFIX} PRIVATE "${PROJECT_SOURCE_DIR}/LEGO1/omni/include" "${PROJECT_SOURCE_DIR}/LEGO1" "${PROJECT_SOURCE_DIR}/LEGO1/lego/sources" "${PROJECT_SOURCE_DIR}/util")
target_link_libraries(geom PRIVATE) target_link_libraries(geom${ARG_SUFFIX} PRIVATE)
add_library(anim STATIC add_library(anim${ARG_SUFFIX} STATIC
LEGO1/lego/sources/anim/legoanim.cpp LEGO1/lego/sources/anim/legoanim.cpp
) )
register_lego1_target(anim) list(APPEND list_targets anim${ARG_SUFFIX})
set_property(TARGET anim PROPERTY ARCHIVE_OUTPUT_NAME "anim$<$<CONFIG:Debug>:d>") set_property(TARGET anim${ARG_SUFFIX} PROPERTY ARCHIVE_OUTPUT_NAME "anim$<$<CONFIG:Debug>:d>${ARG_SUFFIX}")
target_include_directories(anim PRIVATE "${CMAKE_SOURCE_DIR}/LEGO1/omni/include" "${CMAKE_SOURCE_DIR}/LEGO1" "${CMAKE_SOURCE_DIR}/LEGO1/lego/sources" "${CMAKE_SOURCE_DIR}/util") target_include_directories(anim${ARG_SUFFIX} PRIVATE "${PROJECT_SOURCE_DIR}/LEGO1/omni/include" "${PROJECT_SOURCE_DIR}/LEGO1" "${PROJECT_SOURCE_DIR}/LEGO1/lego/sources" "${PROJECT_SOURCE_DIR}/util")
target_link_libraries(anim PRIVATE)
add_library(misc STATIC add_library(misc${ARG_SUFFIX} STATIC
LEGO1/lego/sources/misc/legocolor.cpp LEGO1/lego/sources/misc/legocolor.cpp
LEGO1/lego/sources/misc/legocontainer.cpp LEGO1/lego/sources/misc/legocontainer.cpp
LEGO1/lego/sources/misc/legoimage.cpp LEGO1/lego/sources/misc/legoimage.cpp
@ -180,24 +182,24 @@ add_library(misc STATIC
LEGO1/lego/sources/misc/legotexture.cpp LEGO1/lego/sources/misc/legotexture.cpp
LEGO1/lego/sources/misc/legotree.cpp LEGO1/lego/sources/misc/legotree.cpp
LEGO1/lego/sources/misc/legounknown.cpp LEGO1/lego/sources/misc/legounknown.cpp
) )
register_lego1_target(misc) list(APPEND list_targets misc${ARG_SUFFIX})
set_property(TARGET misc PROPERTY ARCHIVE_OUTPUT_NAME "misc$<$<CONFIG:Debug>:d>") set_property(TARGET misc${ARG_SUFFIX} PROPERTY ARCHIVE_OUTPUT_NAME "misc$<$<CONFIG:Debug>:d>${ARG_SUFFIX}")
target_include_directories(misc PRIVATE "${CMAKE_SOURCE_DIR}/LEGO1/omni/include" "${CMAKE_SOURCE_DIR}/LEGO1" "${CMAKE_SOURCE_DIR}/LEGO1/lego/sources" "${CMAKE_SOURCE_DIR}/util") target_include_directories(misc${ARG_SUFFIX} PRIVATE "${PROJECT_SOURCE_DIR}/LEGO1/omni/include" "${PROJECT_SOURCE_DIR}/LEGO1" "${PROJECT_SOURCE_DIR}/LEGO1/lego/sources" "${PROJECT_SOURCE_DIR}/util")
target_link_libraries(misc PRIVATE) target_link_libraries(misc${ARG_SUFFIX} PRIVATE)
add_library(3dmanager STATIC add_library(3dmanager${ARG_SUFFIX} STATIC
LEGO1/lego/sources/3dmanager/lego3dmanager.cpp LEGO1/lego/sources/3dmanager/lego3dmanager.cpp
LEGO1/lego/sources/3dmanager/lego3dview.cpp LEGO1/lego/sources/3dmanager/lego3dview.cpp
LEGO1/lego/sources/3dmanager/legoview1.cpp LEGO1/lego/sources/3dmanager/legoview1.cpp
LEGO1/lego/sources/3dmanager/tglsurface.cpp LEGO1/lego/sources/3dmanager/tglsurface.cpp
) )
register_lego1_target(3dmanager) list(APPEND list_targets 3dmanager${ARG_SUFFIX})
set_property(TARGET 3dmanager PROPERTY ARCHIVE_OUTPUT_NAME "3dmanager$<$<CONFIG:Debug>:d>") set_property(TARGET 3dmanager${ARG_SUFFIX} PROPERTY ARCHIVE_OUTPUT_NAME "3dmanager$<$<CONFIG:Debug>:d>${ARG_SUFFIX}")
target_include_directories(3dmanager PRIVATE "${CMAKE_SOURCE_DIR}/LEGO1" "${CMAKE_SOURCE_DIR}/util") target_include_directories(3dmanager${ARG_SUFFIX} PRIVATE "${PROJECT_SOURCE_DIR}/LEGO1" "${PROJECT_SOURCE_DIR}/util")
target_link_libraries(3dmanager PRIVATE Vec::Vec) target_link_libraries(3dmanager${ARG_SUFFIX} PRIVATE Vec::Vec)
add_library(omni STATIC add_library(omni${ARG_SUFFIX} STATIC
LEGO1/omni/src/action/mxdsaction.cpp LEGO1/omni/src/action/mxdsaction.cpp
LEGO1/omni/src/action/mxdsanim.cpp LEGO1/omni/src/action/mxdsanim.cpp
LEGO1/omni/src/action/mxdsevent.cpp LEGO1/omni/src/action/mxdsevent.cpp
@ -281,13 +283,13 @@ add_library(omni STATIC
LEGO1/omni/src/video/mxvideoparam.cpp LEGO1/omni/src/video/mxvideoparam.cpp
LEGO1/omni/src/video/mxvideoparamflags.cpp LEGO1/omni/src/video/mxvideoparamflags.cpp
LEGO1/omni/src/video/mxvideopresenter.cpp LEGO1/omni/src/video/mxvideopresenter.cpp
) )
register_lego1_target(omni) list(APPEND list_targets omni${ARG_SUFFIX})
set_property(TARGET omni PROPERTY ARCHIVE_OUTPUT_NAME "omni$<$<CONFIG:Debug>:d>") set_property(TARGET omni${ARG_SUFFIX} PROPERTY ARCHIVE_OUTPUT_NAME "omni$<$<CONFIG:Debug>:d>${ARG_SUFFIX}")
target_include_directories(omni PRIVATE "${CMAKE_SOURCE_DIR}/LEGO1/omni/include" "${CMAKE_SOURCE_DIR}/LEGO1" "${CMAKE_SOURCE_DIR}/util") target_include_directories(omni${ARG_SUFFIX} PRIVATE "${PROJECT_SOURCE_DIR}/LEGO1/omni/include" "${PROJECT_SOURCE_DIR}/LEGO1" "${PROJECT_SOURCE_DIR}/util")
target_link_libraries(omni PRIVATE dsound winmm Smacker::Smacker) target_link_libraries(omni${ARG_SUFFIX} PRIVATE dsound winmm Smacker::Smacker)
add_library(lego1 SHARED add_library(${NAME} SHARED
LEGO1/define.cpp LEGO1/define.cpp
LEGO1/lego/legoomni/src/actors/act2actor.cpp LEGO1/lego/legoomni/src/actors/act2actor.cpp
LEGO1/lego/legoomni/src/actors/act2genactor.cpp LEGO1/lego/legoomni/src/actors/act2genactor.cpp
@ -405,44 +407,67 @@ add_library(lego1 SHARED
LEGO1/lego/legoomni/src/worlds/score.cpp LEGO1/lego/legoomni/src/worlds/score.cpp
LEGO1/main.cpp LEGO1/main.cpp
LEGO1/modeldb/modeldb.cpp LEGO1/modeldb/modeldb.cpp
) )
reccmp_add_target(lego1 ID LEGO1) list(APPEND list_targets ${NAME})
register_lego1_target(lego1)
if (MINGW) if (MINGW)
target_compile_definitions(lego1 PRIVATE DIRECTINPUT_VERSION=0x0500) target_compile_definitions(${NAME} PRIVATE DIRECTINPUT_VERSION=0x0500)
endif() endif()
if (MSVC) if (MSVC)
target_sources(lego1 PRIVATE LEGO1/LegoOmni.def) target_sources(${NAME} PRIVATE LEGO1/LegoOmni.def)
else() else()
target_sources(lego1 PRIVATE LEGO1/LegoOmni.mingw.def) target_sources(${NAME} PRIVATE LEGO1/LegoOmni.mingw.def)
endif() endif()
target_include_directories(lego1 PUBLIC "${CMAKE_SOURCE_DIR}/util") target_include_directories(${NAME} PUBLIC "${PROJECT_SOURCE_DIR}/util")
target_include_directories(lego1 PUBLIC "${CMAKE_SOURCE_DIR}/LEGO1") target_include_directories(${NAME} PUBLIC "${PROJECT_SOURCE_DIR}/LEGO1")
target_include_directories(lego1 PUBLIC "${CMAKE_SOURCE_DIR}/LEGO1/omni/include") target_include_directories(${NAME} PUBLIC "${PROJECT_SOURCE_DIR}/LEGO1/omni/include")
target_include_directories(lego1 PUBLIC "${CMAKE_SOURCE_DIR}/LEGO1/lego/sources") target_include_directories(${NAME} PUBLIC "${PROJECT_SOURCE_DIR}/LEGO1/lego/sources")
target_include_directories(lego1 PUBLIC "${CMAKE_SOURCE_DIR}/LEGO1/lego/legoomni/include") target_include_directories(${NAME} PUBLIC "${PROJECT_SOURCE_DIR}/LEGO1/lego/legoomni/include")
target_include_directories(lego1 PUBLIC "${CMAKE_SOURCE_DIR}/LEGO1/lego/legoomni/include/actions") target_include_directories(${NAME} PUBLIC "${PROJECT_SOURCE_DIR}/LEGO1/lego/legoomni/include/actions")
# Link libraries # Link libraries
target_link_libraries(lego1 PRIVATE tglrl viewmanager realtime mxdirectx roi geom anim Vec::Vec dinput dxguid misc 3dmanager omni) target_link_libraries(${NAME} PRIVATE tglrl${ARG_SUFFIX} viewmanager${ARG_SUFFIX} realtime${ARG_SUFFIX} mxdirectx${ARG_SUFFIX} roi${ARG_SUFFIX} geom${ARG_SUFFIX} anim${ARG_SUFFIX} Vec::Vec dinput dxguid misc${ARG_SUFFIX} 3dmanager${ARG_SUFFIX} omni${ARG_SUFFIX})
if (ISLE_USE_SMARTHEAP) foreach(tgt IN LISTS list_targets)
foreach(tgt IN LISTS lego1_targets) target_link_libraries(${tgt} PRIVATE ${ARG_LINK_LIBRARIES})
target_link_libraries(${tgt} PRIVATE SmartHeap::SmartHeap)
endforeach()
endif()
foreach(tgt IN LISTS lego1_targets)
target_link_libraries(${tgt} PRIVATE $<$<BOOL:${ISLE_USE_DX5}>:DirectX5::DirectX5>) target_link_libraries(${tgt} PRIVATE $<$<BOOL:${ISLE_USE_DX5}>:DirectX5::DirectX5>)
target_compile_definitions(${tgt} PRIVATE $<$<BOOL:${ISLE_USE_DX5}>:DIRECTX5_SDK>) target_compile_definitions(${tgt} PRIVATE $<$<BOOL:${ISLE_USE_DX5}>:DIRECTX5_SDK>)
endforeach() endforeach()
# Make sure filenames are ALL CAPS # Make sure filenames are ALL CAPS
set_property(TARGET lego1 PROPERTY OUTPUT_NAME LEGO1) set_property(TARGET ${NAME} PROPERTY OUTPUT_NAME "${ARG_DLL_OUTPUT_NAME}")
set_property(TARGET lego1 PROPERTY PREFIX "") set_property(TARGET ${NAME} PROPERTY PREFIX "${ARG_DLL_PREFIX}")
set_property(TARGET lego1 PROPERTY SUFFIX ".DLL") set_property(TARGET ${NAME} PROPERTY SUFFIX "${ARG_DLL_SUFFIX}")
set(${ARG_OUT_TARGETS} ${list_targets} PARENT_SCOPE)
endfunction()
set(lego1_link_libraries )
if (ISLE_USE_SMARTHEAP)
list(APPEND lego1_link_libraries SmartHeap::SmartHeap)
endif()
add_lego_libraries(lego1
LINK_LIBRARIES ${lego1_link_libraries}
DLL_OUTPUT_NAME "LEGO1"
DLL_PREFIX ""
DLL_SUFFIX ".DLL"
OUT_TARGETS lego1_targets
)
reccmp_add_target(lego1 ID LEGO1)
if(ISLE_BUILD_BETA10)
add_lego_libraries(beta10
SUFFIX "-beta10"
DLL_OUTPUT_NAME "BETA10"
DLL_PREFIX ""
DLL_SUFFIX ".DLL"
OUT_TARGETS beta10_targets
)
reccmp_add_target(beta10 ID BETA10)
endif()
if (ISLE_BUILD_APP) if (ISLE_BUILD_APP)
add_executable(isle WIN32 add_executable(isle WIN32
@ -495,7 +520,7 @@ endif()
if (MSVC) if (MSVC)
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "15") if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "15")
set_property(TARGET ${lego1_targets} APPEND PROPERTY COMPILE_DEFINITIONS "_CRT_SECURE_NO_WARNINGS") set_property(TARGET ${lego1_targets} ${beta10_targets} APPEND PROPERTY COMPILE_DEFINITIONS "_CRT_SECURE_NO_WARNINGS")
if (TARGET isle) if (TARGET isle)
target_compile_definitions(isle PRIVATE "_CRT_SECURE_NO_WARNINGS") target_compile_definitions(isle PRIVATE "_CRT_SECURE_NO_WARNINGS")
endif() endif()
@ -505,7 +530,7 @@ if (MSVC)
endif() endif()
# Visual Studio 2017 version 15.7 needs "/Zc:__cplusplus" for __cplusplus # Visual Studio 2017 version 15.7 needs "/Zc:__cplusplus" for __cplusplus
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "19.14.26428") if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "19.14.26428")
foreach(tgt IN LISTS lego1_targets) foreach(tgt IN LISTS lego1_targets beta10_targets)
target_compile_options(${tgt} PRIVATE "-Zc:__cplusplus") target_compile_options(${tgt} PRIVATE "-Zc:__cplusplus")
endforeach() endforeach()
if (TARGET isle) if (TARGET isle)
@ -519,7 +544,7 @@ endif()
if (ISLE_DECOMP_ASSERT) if (ISLE_DECOMP_ASSERT)
message(STATUS "Decomp asserts enabled") message(STATUS "Decomp asserts enabled")
foreach(tgt IN LISTS lego1_targets) foreach(tgt IN LISTS lego1_targets beta10_targets)
target_compile_definitions(${tgt} PRIVATE "ENABLE_DECOMP_ASSERTS") target_compile_definitions(${tgt} PRIVATE "ENABLE_DECOMP_ASSERTS")
endforeach() endforeach()
@ -541,7 +566,7 @@ if (MSVC_FOR_DECOMP)
endif() endif()
# Equivalent to target_compile_options(... PRIVATE "/MT$<$<CONFIG:Debug>:d>") # Equivalent to target_compile_options(... PRIVATE "/MT$<$<CONFIG:Debug>:d>")
set_property(TARGET lego1 ${lego1_targets} PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>") set_property(TARGET lego1 ${lego1_targets} ${beta10_targets} PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
set(CMAKE_CXX_FLAGS "/W3 /GX /D \"WIN32\" /D \"_WINDOWS\"") set(CMAKE_CXX_FLAGS "/W3 /GX /D \"WIN32\" /D \"_WINDOWS\"")
set(CMAKE_CXX_FLAGS_DEBUG "/Gm /Zi /Od /D \"_DEBUG\"") set(CMAKE_CXX_FLAGS_DEBUG "/Gm /Zi /Od /D \"_DEBUG\"")
@ -566,7 +591,7 @@ if (MSVC_FOR_DECOMP)
# Older MSVC versions don't support building in parallel. # Older MSVC versions don't support building in parallel.
# Force non-parallel builds of isle and lego1 by putting them in a pool with 1 available job. # Force non-parallel builds of isle and lego1 by putting them in a pool with 1 available job.
if (CMAKE_CXX_COMPILER_ID VERSION_LESS 12) if (CMAKE_CXX_COMPILER_ID VERSION_LESS 12)
foreach(tgt IN LISTS lego1_targets) foreach(tgt IN LISTS lego1_targets beta10_targets)
set_property(GLOBAL APPEND PROPERTY JOB_POOLS "msvc_${tgt}=1") set_property(GLOBAL APPEND PROPERTY JOB_POOLS "msvc_${tgt}=1")
set_property(TARGET ${tgt} PROPERTY JOB_POOL_COMPILE "msvc_${tgt}") set_property(TARGET ${tgt} PROPERTY JOB_POOL_COMPILE "msvc_${tgt}")
set_property(TARGET ${tgt} PROPERTY JOB_POOL_LINK "msvc_${tgt}") set_property(TARGET ${tgt} PROPERTY JOB_POOL_LINK "msvc_${tgt}")