Skip to content

Commit

Permalink
Reorganized build resources into build_resources/
Browse files Browse the repository at this point in the history
  • Loading branch information
adamkewley committed Apr 7, 2021
1 parent 42cbb81 commit 5ad0d69
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 17 deletions.
16 changes: 8 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ add_executable(osmv
src/osmv.cpp

# add a resources file, which tells MSVC how to compile the icon etc. into the exe
$<$<CXX_COMPILER_ID:MSVC>:resources.rc>
$<$<CXX_COMPILER_ID:MSVC>:build_resources/resources.rc>
)
target_link_libraries(osmv PRIVATE
# in gcc/clang the <filesystem> implementation must be explicitly linked
Expand Down Expand Up @@ -348,7 +348,7 @@ target_link_options(osmv PUBLIC
#
# - this config is switched out at install-time to a configuration that loads
# resources from the (copied) resource directory
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/DEV_osmv.toml.in" "${CMAKE_BINARY_DIR}/osmv.toml")
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/build_resources/DEV_osmv.toml.in" "${CMAKE_BINARY_DIR}/osmv.toml")

# (on Windows): copy libraries into the same dir as osmv.exe
#
Expand Down Expand Up @@ -403,7 +403,7 @@ if (WIN32)
#
# - in contrast to the dev-centric one, this loads resources from the installation dir,
# which has a known path relative to the osmv executable (../resources)
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/INSTALL_osmv.toml" RENAME "osmv.toml" DESTINATION ".")
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/build_resources/INSTALL_osmv.toml" RENAME "osmv.toml" DESTINATION ".")

# install `resources/`
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/resources" DESTINATION ".")
Expand Down Expand Up @@ -452,7 +452,7 @@ if (LINUX)
#
# - in contrast to the dev-centric one, this loads resources from the installation dir,
# which has a known path relative to the osmv executable (../resources)
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/INSTALL_osmv.toml" RENAME "osmv.toml" DESTINATION ".")
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/build_resources/INSTALL_osmv.toml" RENAME "osmv.toml" DESTINATION ".")

# install `resources/`
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/resources" DESTINATION ".")
Expand All @@ -462,8 +462,8 @@ if (LINUX)
set(CPACK_PACKAGING_INSTALL_PREFIX /opt/osmv)
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libsdl2-2.0-0, libblas3, liblapack3, libstdc++6")
set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT)
configure_file("${PROJECT_SOURCE_DIR}/postinst.in" "postinst" @ONLY) # create symlink /usr/local/bin/osmv --> /opt/osmv/bin/osmv
configure_file("${PROJECT_SOURCE_DIR}/postrm.in" "postrm" @ONLY) # destroy symlink created during install
configure_file("${PROJECT_SOURCE_DIR}/build_resources/postinst.in" "postinst" @ONLY) # create symlink /usr/local/bin/osmv --> /opt/osmv/bin/osmv
configure_file("${PROJECT_SOURCE_DIR}/build_resources/postrm.in" "postrm" @ONLY) # destroy symlink created during install
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_BINARY_DIR}/postinst;${CMAKE_BINARY_DIR}/postrm")
endif()

Expand All @@ -485,12 +485,12 @@ if (APPLE)
#
# - in contrast to the dev-centric one, this loads resources from the installation dir,
# which has a known path relative to the osmv executable (../resources)
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/INSTALL_osmv.toml" RENAME "osmv.toml" DESTINATION osmv.app/Contents/MacOS/)
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/build_resources/INSTALL_osmv.toml" RENAME "osmv.toml" DESTINATION osmv.app/Contents/MacOS/)

# install an Info.plist file for this particular app
#
# this is a mac-specific XML file
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/Info.plist" DESTINATION osmv.app/Contents/)
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/build_resources/Info.plist" DESTINATION osmv.app/Contents/)

# install `resources/`
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/resources" DESTINATION osmv.app/Contents/MacOS/)
Expand Down
8 changes: 0 additions & 8 deletions DEV_osmv.toml.in

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![logo with title](logo_with_title.svg)
![logo with title](build_resources/logo_with_title.svg)

A lightweight development UI for [OpenSim](https://github.com/opensim-org/opensim-core)

Expand Down
21 changes: 21 additions & 0 deletions build_resources/DEV_osmv.toml.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# DEV osmv configuration
#
# this is the configuration file used by developers that run OSMV from the raw build directory,
# as opposed to the INSTALL configuration, which is what's used when running an installed version
# of OSMV.
#
# This file is configured by CMake so that resources etc. are loaded from the developer's source
# dir, and such that any other development-centric flags (more verbose logging, whatever) are
# configured for typical dev debugging
#
# so, changing this will only affect developers - if you want to affect end-users then edit an
# INSTALL configuration file.

resources = "@CMAKE_CURRENT_SOURCE_DIR@/resources"

[experimental_feature_flags]

# enable dragging panels out of the host window and into their own window
#
# warning: results vary *greatly* accross platforms
multiple_viewports = false
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file modified screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5ad0d69

Please sign in to comment.