added cache variable for lib/bin/archive output

This commit is contained in:
Mathis Logemann 2020-11-25 12:16:06 +01:00
parent 37dd7c17df
commit f432018bdb
15 changed files with 59 additions and 23 deletions

View file

@ -8,7 +8,7 @@ project(mapnik
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake") set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
option(BUILD_SHARED_LIBS "build mapnik dynamic" ON) option(BUILD_SHARED_LIBS "build mapnik dynamic(ON) or static(OFF)" ON)
option(BUILD_TEST "builds the tests" ON) option(BUILD_TEST "builds the tests" ON)
option(USE_EXTERNAL_MAPBOX_GEOMETRY "Use a external mapnik/geometry.hpp. If off, use the submodule" OFF) option(USE_EXTERNAL_MAPBOX_GEOMETRY "Use a external mapnik/geometry.hpp. If off, use the submodule" OFF)
option(USE_EXTERNAL_MAPBOX_POLYLABEL "Use a external mapnik/polylabel. If off, use the submodule" OFF) option(USE_EXTERNAL_MAPBOX_POLYLABEL "Use a external mapnik/polylabel. If off, use the submodule" OFF)
@ -63,6 +63,23 @@ message("Installing fonts to ${ABSOLUTE_FONTS_INSTALL_DIR}")
set(CMAKE_CXX_STANDARD 14 CACHE STRING "Sets the c++ standard. c++11 is minimum.") set(CMAKE_CXX_STANDARD 14 CACHE STRING "Sets the c++ standard. c++11 is minimum.")
message("Using c++${CMAKE_CXX_STANDARD}") message("Using c++${CMAKE_CXX_STANDARD}")
if(WIN32)
set(DEFAULT_BIN_DIR bin)
set(DEFAULT_LIB_DIR lib)
set(DEFAULT_ARCHIVE_DIR lib)
else()
include(GNUInstallDirs)
set(DEFAULT_BIN_DIR ${CMAKE_INSTALL_BINDIR})
set(DEFAULT_LIB_DIR ${CMAKE_INSTALL_LIBDIR})
set(DEFAULT_ARCHIVE_DIR ${CMAKE_INSTALL_LIBDIR})
endif()
# https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html#runtime-output-artifacts
set(MAPNIK_BIN_DIR ${DEFAULT_BIN_DIR} CACHE STRING "Install directory for binaries")
# https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html#library-output-artifacts
set(MAPNIK_LIB_DIR ${DEFAULT_LIB_DIR} CACHE STRING "Install directory for libraries")
# https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html#archive-output-artifacts
set(MAPNIK_ARCHIVE_DIR ${DEFAULT_ARCHIVE_DIR} CACHE STRING "Install directory for archives")
find_package(Boost 1.74 REQUIRED COMPONENTS filesystem system regex) find_package(Boost 1.74 REQUIRED COMPONENTS filesystem system regex)
find_package(ICU REQUIRED COMPONENTS uc) find_package(ICU REQUIRED COMPONENTS uc)
find_package(Freetype REQUIRED) find_package(Freetype REQUIRED)

View file

@ -5,7 +5,7 @@ add_executable(mapnik-demo rundemo.cpp)
target_link_libraries(mapnik-demo PRIVATE mapnik::headers mapnik::agg mapnik::mapnik) target_link_libraries(mapnik-demo PRIVATE mapnik::headers mapnik::agg mapnik::mapnik)
install(TARGETS mapnik-demo install(TARGETS mapnik-demo
LIBRARY DESTINATION lib LIBRARY DESTINATION ${MAPNIK_LIB_DIR}
ARCHIVE DESTINATION lib ARCHIVE DESTINATION ${MAPNIK_ARCHIVE_DIR}
RUNTIME DESTINATION bin RUNTIME DESTINATION ${MAPNIK_BIN_DIR}
) )

View file

@ -40,7 +40,7 @@ fonts/1/dir=${ABSOLUTE_FONTS_INSTALL_DIR}"
) )
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/viewer.ini DESTINATION bin) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/viewer.ini DESTINATION bin)
install(TARGETS mapnik-viewer install(TARGETS mapnik-viewer
LIBRARY DESTINATION lib LIBRARY DESTINATION ${MAPNIK_LIB_DIR}
ARCHIVE DESTINATION lib ARCHIVE DESTINATION ${MAPNIK_ARCHIVE_DIR}
RUNTIME DESTINATION bin RUNTIME DESTINATION ${MAPNIK_BIN_DIR}
) )

1
deps/vcpkg vendored Submodule

@ -0,0 +1 @@
Subproject commit 6e073f168652a551d8f29d19481ec67be3fccac8

View file

@ -299,9 +299,9 @@ target_link_libraries(mapnik PRIVATE
install(TARGETS mapnik install(TARGETS mapnik
EXPORT MapnikTargets EXPORT MapnikTargets
LIBRARY DESTINATION lib LIBRARY DESTINATION ${MAPNIK_LIB_DIR}
ARCHIVE DESTINATION lib ARCHIVE DESTINATION ${MAPNIK_ARCHIVE_DIR}
RUNTIME DESTINATION bin RUNTIME DESTINATION ${MAPNIK_BIN_DIR}
INCLUDES DESTINATION include/ INCLUDES DESTINATION include/
PUBLIC_HEADER DESTINATION include/ PUBLIC_HEADER DESTINATION include/
) )

View file

@ -28,7 +28,7 @@ target_link_libraries(json PRIVATE mapnik::headers ${ICUU_LIB})
install(TARGETS json install(TARGETS json
EXPORT MapnikTargets EXPORT MapnikTargets
LIBRARY DESTINATION lib LIBRARY DESTINATION ${MAPNIK_LIB_DIR}
ARCHIVE DESTINATION lib ARCHIVE DESTINATION ${MAPNIK_ARCHIVE_DIR}
RUNTIME DESTINATION bin RUNTIME DESTINATION ${MAPNIK_BIN_DIR}
) )

View file

@ -21,7 +21,7 @@ target_link_libraries(wkt PRIVATE mapnik::headers)
install(TARGETS wkt install(TARGETS wkt
EXPORT MapnikTargets EXPORT MapnikTargets
LIBRARY DESTINATION lib LIBRARY DESTINATION ${MAPNIK_LIB_DIR}
ARCHIVE DESTINATION lib ARCHIVE DESTINATION ${MAPNIK_ARCHIVE_DIR}
RUNTIME DESTINATION bin RUNTIME DESTINATION ${MAPNIK_BIN_DIR}
) )

View file

@ -16,6 +16,10 @@ set(CATCH_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
add_library(Catch INTERFACE) add_library(Catch INTERFACE)
target_include_directories(Catch INTERFACE ${CATCH_INCLUDE_DIR}) target_include_directories(Catch INTERFACE ${CATCH_INCLUDE_DIR})
# for cmake 3.19+ https://cmake.org/cmake/help/git-stage/policy/CMP0110.html
# might not be needed if catch updates its cmakes
cmake_policy(SET CMP0110 OLD)
add_executable(mapnik-test-unit add_executable(mapnik-test-unit
unit/run.cpp unit/run.cpp
unit/color/css_color.cpp unit/color/css_color.cpp

View file

@ -9,5 +9,7 @@ target_link_libraries(geometry_to_wkb PRIVATE
install(TARGETS geometry_to_wkb install(TARGETS geometry_to_wkb
EXPORT MapnikTargets EXPORT MapnikTargets
RUNTIME DESTINATION bin LIBRARY DESTINATION ${MAPNIK_LIB_DIR}
ARCHIVE DESTINATION ${MAPNIK_ARCHIVE_DIR}
RUNTIME DESTINATION ${MAPNIK_BIN_DIR}
) )

View file

@ -17,5 +17,7 @@ target_link_libraries(mapnik-index PRIVATE
) )
install(TARGETS mapnik-index install(TARGETS mapnik-index
EXPORT MapnikTargets EXPORT MapnikTargets
RUNTIME DESTINATION bin LIBRARY DESTINATION ${MAPNIK_LIB_DIR}
ARCHIVE DESTINATION ${MAPNIK_ARCHIVE_DIR}
RUNTIME DESTINATION ${MAPNIK_BIN_DIR}
) )

View file

@ -11,5 +11,7 @@ target_link_libraries(mapnik-render PRIVATE
) )
install(TARGETS mapnik-render install(TARGETS mapnik-render
EXPORT MapnikTargets EXPORT MapnikTargets
RUNTIME DESTINATION bin LIBRARY DESTINATION ${MAPNIK_LIB_DIR}
ARCHIVE DESTINATION ${MAPNIK_ARCHIVE_DIR}
RUNTIME DESTINATION ${MAPNIK_BIN_DIR}
) )

View file

@ -7,5 +7,7 @@ target_link_libraries(ogrindex PRIVATE mapnik::headers mapnik::mapnik)
install(TARGETS ogrindex install(TARGETS ogrindex
EXPORT MapnikTargets EXPORT MapnikTargets
RUNTIME DESTINATION bin LIBRARY DESTINATION ${MAPNIK_LIB_DIR}
ARCHIVE DESTINATION ${MAPNIK_ARCHIVE_DIR}
RUNTIME DESTINATION ${MAPNIK_BIN_DIR}
) )

View file

@ -19,5 +19,7 @@ target_link_libraries(pgsql2sqlite PRIVATE
install(TARGETS pgsql2sqlite install(TARGETS pgsql2sqlite
EXPORT MapnikTargets EXPORT MapnikTargets
RUNTIME DESTINATION bin LIBRARY DESTINATION ${MAPNIK_LIB_DIR}
ARCHIVE DESTINATION ${MAPNIK_ARCHIVE_DIR}
RUNTIME DESTINATION ${MAPNIK_BIN_DIR}
) )

View file

@ -14,5 +14,7 @@ target_link_libraries(shapeindex PRIVATE
) )
install(TARGETS shapeindex install(TARGETS shapeindex
EXPORT MapnikTargets EXPORT MapnikTargets
RUNTIME DESTINATION bin LIBRARY DESTINATION ${MAPNIK_LIB_DIR}
ARCHIVE DESTINATION ${MAPNIK_ARCHIVE_DIR}
RUNTIME DESTINATION ${MAPNIK_BIN_DIR}
) )

View file

@ -14,5 +14,7 @@ target_link_libraries(svg2png PRIVATE
) )
install(TARGETS svg2png install(TARGETS svg2png
EXPORT MapnikTargets EXPORT MapnikTargets
RUNTIME DESTINATION bin LIBRARY DESTINATION ${MAPNIK_LIB_DIR}
ARCHIVE DESTINATION ${MAPNIK_ARCHIVE_DIR}
RUNTIME DESTINATION ${MAPNIK_BIN_DIR}
) )