Skip to content

Commit

Permalink
Bring in refactor work on python scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
IssMneur committed Sep 4, 2016
2 parents 26ece56 + d1b4b11 commit c7b3986
Show file tree
Hide file tree
Showing 8 changed files with 63 additions and 6 deletions.
24 changes: 22 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,47 @@ addons:
packages:
- build-essential
- cmake
- libwxgtk2.8-dev
- libwxgtk3.0-dev
- libopenal-dev
matrix:
include:
- os: linux
compiler: gcc
env: CONFIGURATION="Debug" wxWidgets_ver=2.8
- os: linux
compiler: gcc
env: CONFIGURATION="Debug" wxWidgets_ver=3.0

- os: linux
compiler: clang
env: CONFIGURATION="Debug"
env: CONFIGURATION="Debug" wxWidgets_ver=2.8
- os: linux
compiler: clang
env: CONFIGURATION="Debug"
env: CONFIGURATION="Debug" wxWidgets_ver=3.0

- os: osx
compiler: clang
env: CONFIGURATION="Debug"

- os: linux
compiler: gcc
env: CONFIGURATION="Release"
env: CONFIGURATION="Debug" wxWidgets_ver=2.8
- os: linux
compiler: gcc
env: CONFIGURATION="Release"
env: CONFIGURATION="Debug" wxWidgets_ver=3.0

- os: linux
compiler: clang
env: CONFIGURATION="Release"
env: CONFIGURATION="Debug" wxWidgets_ver=2.8
- os: linux
compiler: clang
env: CONFIGURATION="Release"
env: CONFIGURATION="Debug" wxWidgets_ver=3.0

- os: osx
compiler: clang
env: CONFIGURATION="Release"
Expand Down
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ else(DEVELOPMENT_MODE)
elseif(IS_APPLE)
set(RESOURCES_PATH wxlauncher.app/Contents/Resources)
else()
set(RESOURCES_PATH /usr/local/share/wxlauncher/)
set(RESOURCES_PATH ${CMAKE_INSTALL_PREFIX}/share/wxlauncher/)
endif()
endif()
set(HELP_HTB_LOCATION ${RESOURCES_PATH}/onlinehelp.htb)
Expand Down Expand Up @@ -341,6 +341,10 @@ add_executable(wxlauncher WIN32 MACOSX_BUNDLE
${RESOURCE_FILES}
${CODE_FILES}
)
if (COMMAND target_compile_features)
target_compile_features(wxlauncher PRIVATE cxx_auto_type) # Enable C++11 because it is required for wxWidgets 3.0
endif()

set_target_properties(wxlauncher
PROPERTIES LINKER_LANGUAGE CXX
POSITION_INDEPENDENT_CODE ON)
Expand Down
2 changes: 1 addition & 1 deletion ci/travis/before_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ mkdir -p travis-build
cd travis-build

if [ "$TRAVIS_OS_NAME" = "linux" ]; then
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=$CONFIGURATION ..
$HOME/cmake/bin/cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=$CONFIGURATION ..
elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
cmake -G "Xcode" -DUSING_SDL_FRAMEWORK=OFF ..
fi
7 changes: 6 additions & 1 deletion ci/travis/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
set -e

if [ "$TRAVIS_OS_NAME" = "linux" ]; then
sudo apt-get install -y ninja-build libsdl2-dev
sudo apt-get install -y ninja-build libsdl2-dev libwxgtk$wxWidgets_ver-dev

mkdir -p $HOME/cmake/

wget -O /tmp/cmake.tar.gz --no-check-certificate http://www.cmake.org/files/v3.4/cmake-3.4.3-Linux-x86_64.tar.gz
tar -xzf /tmp/cmake.tar.gz -C $HOME/cmake/ --strip-components=1
elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
gem install xcpretty xcpretty-travis-formatter

Expand Down
16 changes: 15 additions & 1 deletion cmake/wxLauncherInstaller.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ if(IS_APPLE)
# set(MACOSX_BUNDLE_LONG_VERSION_STRING "wxLauncher for the SCP, version ${MACOSX_BUNDLE_SHORT_VERSION_STRING}")
set(MACOSX_BUNDLE_ICON_FILE wxlauncher.icns)
set(MACOSX_BUNDLE_SHORT_VERSION_STRING ${wxlauncher_VERSION})
set(MACOSX_BUNDLE_COPYRIGHT "Copyright © 2009-2015 ${CPACK_PACKAGE_VENDOR}")
set(MACOSX_BUNDLE_COPYRIGHT "Copyright © 2009-2016 ${CPACK_PACKAGE_VENDOR}")
endif(IS_APPLE)

if(IS_LINUX)
Expand Down Expand Up @@ -146,4 +146,18 @@ elseif(IS_APPLE)
else()
install(DIRECTORY resources/ DESTINATION ${RESOURCES_PATH})
install(FILES ${helphtblocation} DESTINATION ${RESOURCES_PATH})
if (${CMAKE_VERSION} VERSION_EQUAL 3.0 OR ${CMAKE_VERSION} VERSION_GREATER 3.0)
# Assume a freedesktop environment
set(WXLAUNCHER_FILE ${CMAKE_INSTALL_PREFIX}/bin/$<TARGET_FILE_NAME:wxlauncher>)
configure_file("${PROJECT_SOURCE_DIR}/platform/freedesktop/wxLauncher.desktop.in" "${CMAKE_BINARY_DIR}/platform/freedesktop/wxlauncher.desktop")

file(GENERATE OUTPUT "${CMAKE_BINARY_DIR}/platform/freedesktop/wxlauncher.desktop-$<CONFIG>"
INPUT "${CMAKE_BINARY_DIR}/platform/freedesktop/wxlauncher.desktop")

install(FILES "${CMAKE_BINARY_DIR}/platform/freedesktop/wxlauncher.desktop-$<CONFIG>"
DESTINATION share/applications
RENAME wxlauncher.desktop)
else()
message(STATUS "The CMake version is too old to support desktop file generation. CMake 3.0 or newer required")
endif()
endif()
5 changes: 5 additions & 0 deletions code/global/Compatibility.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,11 @@ namespace Compatibility
wxFileName oldName = GetPlatformDefaultConfigFilePathOld();
oldName.SetFullName(FSO_CONFIG_FILENAME);

if (!wxFile::Exists(oldName.GetFullPath())) {
// Old file does not exist, probably first run.
return true;
}

if (!wxCopyFile(oldName.GetFullPath(), newName.GetFullPath())) {
wxLogError(_T("Failed to copy old configuration file to new location!"));
return false;
Expand Down
9 changes: 9 additions & 0 deletions platform/freedesktop/wxLauncher.desktop.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[Desktop Entry]
Version=1.0
Name=wxLauncher
Comment=A wxWidgets based launcher for FreeSpace Open
Exec=@WXLAUNCHER_FILE@
Icon=@[email protected]
Terminal=false
Type=Application
Categories=Utility;Application;
Binary file added resources/wxlauncher.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 c7b3986

Please sign in to comment.