[CMake] fixes for windows (WIP)

This commit is contained in:
Mathis Logemann 2022-04-22 15:10:49 +02:00
parent 59d2f21369
commit c85f8462fd
17 changed files with 22 additions and 0 deletions

View file

@ -37,6 +37,7 @@ function(mapnik_create_benchmark)
RUNTIME_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}"
ARCHIVE_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}/lib"
OUTPUT_NAME "${BENCHNAME}"
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>$<$<BOOL:${BUILD_SHARED_CRT}>:DLL>"
)
endfunction()

View file

@ -3,6 +3,7 @@ set_target_properties(mapnik-demo PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}"
RUNTIME_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}"
ARCHIVE_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}/lib"
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>$<$<BOOL:${BUILD_SHARED_CRT}>:DLL>"
)
target_link_libraries(mapnik-demo PRIVATE mapnik::agg mapnik::mapnik)

View file

@ -43,6 +43,7 @@ set_target_properties(mapnik-viewer PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}"
RUNTIME_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}"
ARCHIVE_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}/lib"
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>$<$<BOOL:${BUILD_SHARED_CRT}>:DLL>"
)
target_link_libraries(mapnik-viewer PRIVATE

View file

@ -21,6 +21,7 @@ macro(add_plugin_target plugin_target output_name)
LIBRARY_OUTPUT_DIRECTORY "${_plugin_library_output}"
RUNTIME_OUTPUT_DIRECTORY "${_plugin_runtime_output}"
ARCHIVE_OUTPUT_DIRECTORY "${_plugin_archive_output}"
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>$<$<BOOL:${BUILD_SHARED_CRT}>:DLL>"
)
mapnik_install_plugin(${plugin_target})
endmacro()

View file

@ -54,6 +54,7 @@ set_target_properties(mapnik PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}"
RUNTIME_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}"
ARCHIVE_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}/lib"
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>$<$<BOOL:${BUILD_SHARED_CRT}>:DLL>"
)
if(MSVC)

View file

@ -35,6 +35,7 @@ set_target_properties(json PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}"
RUNTIME_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}"
ARCHIVE_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}/lib"
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>$<$<BOOL:${BUILD_SHARED_CRT}>:DLL>"
)
mapnik_install(json)

View file

@ -40,6 +40,7 @@ void register_image_readers()
}
} // namespace mapnik
#if !defined(MAPNIK_STATIC_PLUGINS) || !defined(_WIN32)
namespace {
class AutoSetup final
{
@ -48,3 +49,4 @@ class AutoSetup final
};
AutoSetup auto_setup{};
} // namespace
#endif

View file

@ -27,6 +27,7 @@ set_target_properties(wkt PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}"
RUNTIME_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}"
ARCHIVE_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}/lib"
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>$<$<BOOL:${BUILD_SHARED_CRT}>:DLL>"
)
mapnik_install(wkt)

View file

@ -104,6 +104,7 @@ set_target_properties(mapnik-test-unit PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}"
RUNTIME_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}"
ARCHIVE_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}/lib"
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>$<$<BOOL:${BUILD_SHARED_CRT}>:DLL>"
)
target_link_libraries(mapnik-test-unit PUBLIC
Catch2::Catch2
@ -123,6 +124,7 @@ set_target_properties(agg_rasterizer_integer_overflow_test PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}"
RUNTIME_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}"
ARCHIVE_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}/lib"
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>$<$<BOOL:${BUILD_SHARED_CRT}>:DLL>"
)
target_link_libraries(agg_rasterizer_integer_overflow_test PUBLIC
Catch2::Catch2
@ -137,6 +139,7 @@ set_target_properties(datasource_registration_test PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}"
RUNTIME_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}"
ARCHIVE_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}/lib"
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>$<$<BOOL:${BUILD_SHARED_CRT}>:DLL>"
)
target_link_libraries(datasource_registration_test PUBLIC
Catch2::Catch2
@ -150,6 +153,7 @@ set_target_properties(font_registration_test PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}"
RUNTIME_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}"
ARCHIVE_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}/lib"
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>$<$<BOOL:${BUILD_SHARED_CRT}>:DLL>"
)
target_link_libraries(font_registration_test PUBLIC
Catch2::Catch2
@ -165,6 +169,7 @@ set_target_properties(map_xml_test PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}"
RUNTIME_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}"
ARCHIVE_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}/lib"
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>$<$<BOOL:${BUILD_SHARED_CRT}>:DLL>"
)
target_link_libraries(map_xml_test PUBLIC
Catch2::Catch2

View file

@ -8,6 +8,7 @@ set_target_properties(mapnik-test-visual PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}"
RUNTIME_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}"
ARCHIVE_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}/lib"
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>$<$<BOOL:${BUILD_SHARED_CRT}>:DLL>"
)
target_link_libraries(mapnik-test-visual PRIVATE
Catch2::Catch2

View file

@ -4,6 +4,7 @@ target_link_libraries(geometry_to_wkb PRIVATE mapnik::mapnik)
set_target_properties(geometry_to_wkb PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}"
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>$<$<BOOL:${BUILD_SHARED_CRT}>:DLL>"
)
mapnik_install_utility(geometry_to_wkb)

View file

@ -15,6 +15,7 @@ target_link_libraries(mapnik-index PRIVATE
set_target_properties(mapnik-index PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}"
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>$<$<BOOL:${BUILD_SHARED_CRT}>:DLL>"
)
mapnik_install_utility(mapnik-index)

View file

@ -9,6 +9,7 @@ target_link_libraries(mapnik-render PRIVATE
set_target_properties(mapnik-render PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}"
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>$<$<BOOL:${BUILD_SHARED_CRT}>:DLL>"
)
mapnik_install_utility(mapnik-render)

View file

@ -4,6 +4,7 @@ target_link_libraries(ogrindex PRIVATE mapnik::mapnik)
set_target_properties(ogrindex PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}"
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>$<$<BOOL:${BUILD_SHARED_CRT}>:DLL>"
)
mapnik_install_utility(ogrindex)

View file

@ -17,6 +17,7 @@ target_link_libraries(pgsql2sqlite PRIVATE
set_target_properties(pgsql2sqlite PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}"
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>$<$<BOOL:${BUILD_SHARED_CRT}>:DLL>"
)
mapnik_install_utility(pgsql2sqlite)

View file

@ -12,6 +12,7 @@ target_link_libraries(shapeindex PRIVATE
set_target_properties(shapeindex PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}"
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>$<$<BOOL:${BUILD_SHARED_CRT}>:DLL>"
)
mapnik_install_utility(shapeindex)

View file

@ -12,6 +12,7 @@ target_link_libraries(svg2png PRIVATE
set_target_properties(svg2png PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${MAPNIK_OUTPUT_DIR}"
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>$<$<BOOL:${BUILD_SHARED_CRT}>:DLL>"
)
mapnik_install_utility(svg2png)