Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ add_subdirectory("ext/zlib")
add_subdirectory("ext/VFS")
target_link_libraries(bfVFS PRIVATE 7z)

# ja2export utility
add_subdirectory("ext/export/src")

# internal libraries that are Good
add_subdirectory(Lua)

Expand Down
29 changes: 29 additions & 0 deletions ext/export/src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
option(BUILD_JA2EXPORT "Build the Ja2Export tool." ON)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this mean its by default built?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes


if(BUILD_JA2EXPORT)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I dont know best practices)
wouldnt it make more sense to skip the inclusion in the root CMakeLists instead of here?
would also make all what-to-build decisions be in a central location

@majcosta majcosta Jan 18, 2023

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like having the exporter tool decide whether to build configure itself or not. but there is a case for moving the option(...) to the root CMakeLists file.

message(STATUS "Configuring Ja2Export")

add_executable(Ja2Export
init_vfs.cpp
main.cpp
progress_bar.cpp
ja2/himage.cpp
ja2/XMLWriter.cpp
export/jsd/export_jsd.cpp
export/jsd/structure.cpp
export/slf/export_slf.cpp
export/sti/export_sti.cpp
export/sti/Image.cpp
export/sti/stci_image_utils.cpp
export/sti/STCI_lib.cpp
)
target_include_directories(Ja2Export PUBLIC
"${CMAKE_CURRENT_SOURCE_DIR}"
)
target_link_libraries(Ja2Export PUBLIC bfVFS libpng)
set_target_properties(Ja2Export PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}
)
else()
message(STATUS "BUILD_JA2EXPORT set to \"OFF\", not configuring Ja2Export by default")
endif()
8 changes: 4 additions & 4 deletions ext/export/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,16 @@ int wmain(int argc, wchar_t **argv)
param_list.push_back(*argv++);
};

std::auto_ptr<HelpCommand> cmd_help(new HelpCommand());
auto cmd_help{ std::make_unique<HelpCommand>() };
g_command_map[HelpCommand::commandString] = cmd_help.get();

std::auto_ptr<ja2xp::CExportSTI> cmd_sti(new ja2xp::CExportSTI());
auto cmd_sti{ std::make_unique<ja2xp::CExportSTI>() };
g_command_map[ja2xp::CExportSTI::commandString] = cmd_sti.get();

std::auto_ptr<ja2xp::CExportSLF> cmd_slf(new ja2xp::CExportSLF());
auto cmd_slf{ std::make_unique<ja2xp::CExportSLF>() };
g_command_map[ja2xp::CExportSLF::commandString] = cmd_slf.get();

std::auto_ptr<ja2xp::CExportJSD> cmd_jsd(new ja2xp::CExportJSD());
auto cmd_jsd{ std::make_unique<ja2xp::CExportJSD>() };
g_command_map[ja2xp::CExportJSD::commandString] = cmd_jsd.get();

if(!param_list.empty())
Expand Down