mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
Build win32 cli wrapper
This commit is contained in:
+18
-1
@@ -1,6 +1,6 @@
|
|||||||
cmake_minimum_required(VERSION 3.13)
|
cmake_minimum_required(VERSION 3.13)
|
||||||
|
|
||||||
project(magicseteditor VERSION 2.2.0)
|
project(magicseteditor)
|
||||||
|
|
||||||
set(CMAKE_CXX_STANDARD 11)
|
set(CMAKE_CXX_STANDARD 11)
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED True)
|
set(CMAKE_CXX_STANDARD_REQUIRED True)
|
||||||
@@ -20,15 +20,20 @@ include(${wxWidgets_USE_FILE})
|
|||||||
include_directories(${Boost_INCLUDE_DIRS})
|
include_directories(${Boost_INCLUDE_DIRS})
|
||||||
include_directories(${HUNSPELL_INCLUDE_DIRS})
|
include_directories(${HUNSPELL_INCLUDE_DIRS})
|
||||||
|
|
||||||
|
# Magic Set Editor executable
|
||||||
|
|
||||||
add_executable(magicseteditor WIN32)
|
add_executable(magicseteditor WIN32)
|
||||||
target_link_libraries(${PROJECT_NAME} ${wxWidgets_LIBRARIES})
|
target_link_libraries(${PROJECT_NAME} ${wxWidgets_LIBRARIES})
|
||||||
target_link_libraries(${PROJECT_NAME} ${Boost_LIBRARIES})
|
target_link_libraries(${PROJECT_NAME} ${Boost_LIBRARIES})
|
||||||
target_link_libraries(${PROJECT_NAME} ${HUNSPELL_LIBRARIES})
|
target_link_libraries(${PROJECT_NAME} ${HUNSPELL_LIBRARIES})
|
||||||
|
|
||||||
file(GLOB_RECURSE sources src/*.cpp)
|
file(GLOB_RECURSE sources src/*.cpp)
|
||||||
|
list(FILTER sources EXCLUDE REGEX win32_cli_wrapper.cpp)
|
||||||
target_sources(magicseteditor PRIVATE ${sources})
|
target_sources(magicseteditor PRIVATE ${sources})
|
||||||
target_precompile_headers(magicseteditor PRIVATE src/util/prec.hpp)
|
target_precompile_headers(magicseteditor PRIVATE src/util/prec.hpp)
|
||||||
|
|
||||||
|
# resource file
|
||||||
|
|
||||||
set(locale_keys_file "${PROJECT_SOURCE_DIR}/resource/expected_locale_keys")
|
set(locale_keys_file "${PROJECT_SOURCE_DIR}/resource/expected_locale_keys")
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
COMMAND perl "${PROJECT_SOURCE_DIR}/tools/locale/locale.pl" "${PROJECT_SOURCE_DIR}/src" ${locale_keys_file}
|
COMMAND perl "${PROJECT_SOURCE_DIR}/tools/locale/locale.pl" "${PROJECT_SOURCE_DIR}/src" ${locale_keys_file}
|
||||||
@@ -39,6 +44,18 @@ add_custom_target(generate_expected_locale_keys DEPENDS ${locale_keys_file})
|
|||||||
add_dependencies(magicseteditor generate_expected_locale_keys)
|
add_dependencies(magicseteditor generate_expected_locale_keys)
|
||||||
target_sources(magicseteditor PRIVATE resource/win32_res.rc)
|
target_sources(magicseteditor PRIVATE resource/win32_res.rc)
|
||||||
|
|
||||||
|
# magicseteditor.com: wrapper to enable command line executable on windows
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
add_executable(magicseteditor-cli)
|
||||||
|
#set_target_properties(magicseteditor-cli PROPERTIES OUTPUT_NAME "magicseteditor.com")
|
||||||
|
target_sources(magicseteditor-cli PRIVATE src/cli/win32_cli_wrapper.cpp)
|
||||||
|
add_custom_command(TARGET magicseteditor-cli POST_BUILD COMMAND
|
||||||
|
${CMAKE_COMMAND} -E copy "${PROJECT_BINARY_DIR}/magicseteditor-cli.exe" "${PROJECT_BINARY_DIR}/magicseteditor.com"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
# warnings
|
# warnings
|
||||||
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
|
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
|
||||||
# Update if necessary
|
# Update if necessary
|
||||||
|
|||||||
Reference in New Issue
Block a user