This is an automated email from the git hooks/post-receive script. thansen pushed a commit to branch master in repository aseprite.
commit e0264787c62ab8cc05014be734080f391f8b4b75 Author: David Capello <[email protected]> Date: Tue Dec 2 01:38:25 2014 -0300 Fix compilation of gen utility (and tests) under Visual Studio solution (fix #541) --- src/CMakeLists.txt | 34 +++++++--------------------------- src/app/CMakeLists.txt | 28 +++++++++++++++++++++++++++- src/gen/CMakeLists.txt | 6 ++++++ 3 files changed, 40 insertions(+), 28 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0d89e40..1b520c9 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -28,11 +28,7 @@ set(aseprite_libraries app-lib css-lib doc-lib raster-lib # Directories where .h files can be found include_directories(. .. ../third_party) -# Directory where generated files by "gen" utility will stay. -include_directories(${CMAKE_CURRENT_BINARY_DIR}) - # Third-party libraries - if(USE_SHARED_ALLEGRO4) # Find the shared Allegro 4 library find_library(LIBALLEGRO4_LIBRARY alleg) @@ -246,29 +242,6 @@ if(EXISTS ../docs/quickref.pdf) endif() ###################################################################### -# Generate source files from widget XML files - -file(GLOB widget_files ${CMAKE_SOURCE_DIR}/data/widgets/*.xml) -foreach(widget_file ${widget_files}) - get_filename_component(widget_name ${widget_file} NAME_WE) - set(target_name generated_${widget_name}) - set(output_fn ${CMAKE_CURRENT_BINARY_DIR}/generated_${widget_name}.h) - - add_custom_command( - OUTPUT ${output_fn} - COMMAND gen/gen --input ${widget_file} --widgetid ${widget_name} > ${output_fn} - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} - MAIN_DEPENDENCY ${widget_file} - DEPENDS gen) - - add_custom_target(${target_name} DEPENDS ${output_fn}) - - set_source_files_properties(${target_name} PROPERTIES GENERATED TRUE) - - add_dependencies(app-lib ${target_name}) -endforeach() - -###################################################################### # Tests function(find_tests dir dependencies) @@ -290,6 +263,13 @@ function(find_tests dir dependencies) get_filename_component(testname ${testsourcefile} NAME_WE) add_executable(${testname} ${testsourcefile}) + + if(MSVC) + # Fix problem compiling gen from a Visual Studio solution + set_target_properties(${testname} + PROPERTIES LINK_FLAGS -ENTRY:"mainCRTStartup") + endif() + target_link_libraries(${testname} gtest ${ARGV}) if(LIBALLEGRO4_LINK_FLAGS) target_link_libraries(${testname} ${LIBALLEGRO4_LINK_FLAGS}) diff --git a/src/app/CMakeLists.txt b/src/app/CMakeLists.txt index 00e55c1..65f79fb 100644 --- a/src/app/CMakeLists.txt +++ b/src/app/CMakeLists.txt @@ -1,6 +1,31 @@ # Aseprite # Copyright (C) 2001-2014 David Capello +###################################################################### +# Generate source files from widget XML files + +file(GLOB widget_files ${CMAKE_SOURCE_DIR}/data/widgets/*.xml) +foreach(widget_file ${widget_files}) + get_filename_component(widget_name ${widget_file} NAME_WE) + set(target_name generated_${widget_name}) + set(output_fn ${CMAKE_CURRENT_BINARY_DIR}/generated_${widget_name}.h) + + add_custom_command( + OUTPUT ${output_fn} + COMMAND ${CMAKE_BINARY_DIR}/bin/gen --input ${widget_file} --widgetid ${widget_name} > ${output_fn} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + MAIN_DEPENDENCY ${widget_file} + DEPENDS gen) + + list(APPEND generated_header_files ${output_fn}) +endforeach() + +# Directory where generated files by "gen" utility will stay. +include_directories(${CMAKE_CURRENT_BINARY_DIR}) + +###################################################################### +# app-lib target + add_library(app-lib app.cpp app_menus.cpp @@ -258,4 +283,5 @@ add_library(app-lib webserver.cpp widget_loader.cpp xml_document.cpp - xml_exception.cpp) + xml_exception.cpp + ${generated_header_files}) diff --git a/src/gen/CMakeLists.txt b/src/gen/CMakeLists.txt index 90180b3..630a84f 100644 --- a/src/gen/CMakeLists.txt +++ b/src/gen/CMakeLists.txt @@ -5,6 +5,12 @@ add_executable(gen gen.cpp ui_class.cpp) +if(MSVC) + # Fix problem compiling gen from a Visual Studio solution + set_target_properties(gen + PROPERTIES LINK_FLAGS -ENTRY:"mainCRTStartup") +endif() + target_link_libraries(gen base-lib) if(USE_SHARED_TINYXML) target_link_libraries(gen ${LIBTINYXML_LIBRARY}) -- Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/aseprite.git _______________________________________________ Pkg-games-commits mailing list [email protected] http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-games-commits

