Skip to content

Commit

Permalink
Updated Travis tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cfgnunes committed Mar 28, 2019
1 parent bd8187b commit e7a8009
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 10 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -25,6 +25,7 @@
# IDE
##############################
.idea
.vscode/

##############################
# CMake
Expand Down
16 changes: 14 additions & 2 deletions .travis.yml
Expand Up @@ -2,7 +2,19 @@ language: cpp

matrix:
include:
os: linux
# Tests on Ubuntu 14.04
- os: linux
dist: trusty
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- build-essential
- cmake
- libwxgtk3.0-dev
# Tests on Ubuntu 16.04
- os: linux
dist: xenial
addons:
apt:
Expand All @@ -12,9 +24,9 @@ matrix:
- build-essential
- cmake
- libwxgtk3.0-dev

script:
- mkdir build
- cd build
- cmake -DCMAKE_BUILD_TYPE=Coverage ..
- make
- make install
16 changes: 8 additions & 8 deletions CMakeLists.txt
Expand Up @@ -10,25 +10,25 @@ include(${wxWidgets_USE_FILE})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -s")

# Sources
file(GLOB SOURCE_FILES src/*.cpp src/*.h)
file(GLOB LANG_FILES msg/*.po)
file(GLOB SRC_FILES src/*.cpp src/*.h)
file(GLOB MSG_FILES msg/*.po)

# Translation files
if(GETTEXT_FOUND)
foreach(LANG_FILE ${LANG_FILES})
# Remove path and extension of 'LANG_FILE'
get_filename_component(LANG_NAME ${LANG_FILE} NAME_WE)
foreach(MSG_FILE ${MSG_FILES})
# Remove path and extension of 'MSG_FILE'
get_filename_component(MSG_NAME ${MSG_FILE} NAME_WE)
# Compile each '.po' file to '.gmo' file
GETTEXT_PROCESS_PO_FILES(${LANG_NAME} ALL PO_FILES "msg/${LANG_NAME}.po")
GETTEXT_PROCESS_PO_FILES(${MSG_NAME} ALL PO_FILES "msg/${MSG_NAME}.po")
# Define the files location during install process
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${LANG_NAME}.gmo" DESTINATION "share/${PROJECT_NAME}/resource/msg/${LANG_NAME}/" RENAME "${PROJECT_NAME}.mo")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${MSG_NAME}.gmo" DESTINATION "share/${PROJECT_NAME}/resource/msg/${MSG_NAME}/" RENAME "${PROJECT_NAME}.mo")
endforeach()
else()
message(WARNING "gettext tools not found. Translations will not be built.")
endif()

# Compile the main executable
add_executable(wxmp3val ${SOURCE_FILES})
add_executable(wxmp3val ${SRC_FILES})
target_link_libraries(wxmp3val ${wxWidgets_LIBRARIES})

# Define the files location during install process
Expand Down

0 comments on commit e7a8009

Please sign in to comment.