From fe6dcd6a7f33a5c0f4dde1dda02aba2610af0966 Mon Sep 17 00:00:00 2001 From: Jim Evins Date: Wed, 19 Dec 2018 23:23:59 -0500 Subject: [PATCH] Cleanup of CMakeLists.txt files. - Bumped required cmake version to 3.9. - Added Appveyor CI YAML file for Windows builds --- .appveyor.yml | 45 ++++++++++++++++++++++++++++++++++++ CMakeLists.txt | 19 +++++++++------ glabels-batch/CMakeLists.txt | 7 +++--- glabels/CMakeLists.txt | 7 +++--- glbarcode/CMakeLists.txt | 7 +++--- model/CMakeLists.txt | 7 +++--- translations/CMakeLists.txt | 7 +++--- 7 files changed, 72 insertions(+), 27 deletions(-) create mode 100644 .appveyor.yml diff --git a/.appveyor.yml b/.appveyor.yml new file mode 100644 index 0000000..f5bfe04 --- /dev/null +++ b/.appveyor.yml @@ -0,0 +1,45 @@ +version: 3.99.0.{build} + +branches: + # blacklist + except: + - /.*/ + + # whitelist + only: + - master + +skip_tags: true + +image: Visual Studio 2017 + +init: + - git config --global core.autocrlf true + +install: + - set QTDIR=c:\Qt\5.11\msvc2017_64 + - set PATH=%PATH%;%QTDIR%/bin + +build_script: + - mkdir build + - cd build + - cmake -G "Visual Studio 15 2017 Win64" -DCMAKE_PREFIX_PATH=%QTDIR% .. + - cmake --build . --config Release + - ctest -C Release + - cpack -C Release -G NSIS64 + +artifacts: + - path: build\glabels-3.99.0-win64.exe + name: windows-installer + +deploy: + - provider: GitHub + release: windows-continuous + artifact: windows-installer + auth_token: + secure: mPNNgwWP58gu4eA2wVwGkGWNTzJigKj1g/XjsZ9vk03rLMmf5fxC/XNr15fPBCi8 + draft: false + prerelease: true + force_update: true + on: + branch: master diff --git a/CMakeLists.txt b/CMakeLists.txt index 3e1b937..67b6729 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.2) +cmake_minimum_required (VERSION 3.9) ############################################################################### # gLabels Label Designer Project @@ -108,12 +108,16 @@ find_package (Qt5Test 5.4 QUIET) #======================================= # Global compiler options #======================================= -# -# Uncomment to compile everything with aggressively pedantic options -# (not recommended -- only for testing -- also not portable) -# -#add_compile_options("-Wall" "-Werror" "-Wpedantic") -add_compile_options("-g") +if (${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU") + # + # Uncomment to compile everything with aggressively pedantic options + # (not recommended -- only for testing -- also not portable) + # + #add_compile_options("-Wall" "-Werror" "-Wpedantic") + + # Uncomment to always compile with debug symbols + add_compile_options("-g") +endif () #======================================= @@ -144,6 +148,7 @@ message (STATUS "Project name ............ " ${CMAKE_PROJECT_NAME}) message (STATUS "Project version ......... " ${VERSION_STRING}) message (STATUS "Installation prefix ..... " ${CMAKE_INSTALL_PREFIX}) message (STATUS "Source code location .... " ${glabels_SOURCE_DIR}) +message (STATUS "CMake version ........... " ${CMAKE_VERSION}) message (STATUS "C++ Compiler ............ " ${CMAKE_CXX_COMPILER_ID} " " ${CMAKE_CXX_COMPILER} " " ${CMAKE_CXX_COMPILER_VERSION}) message (STATUS "Qt version .............. " ${Qt5Core_VERSION}) diff --git a/glabels-batch/CMakeLists.txt b/glabels-batch/CMakeLists.txt index 672720c..c2abedc 100644 --- a/glabels-batch/CMakeLists.txt +++ b/glabels-batch/CMakeLists.txt @@ -14,10 +14,9 @@ add_executable (glabels-batch-qt WIN32 ${glabels-batch_sources} ) -#target_compile_features (glabels-batch-qt -# PUBLIC cxx_std_11 -#) -set_property (TARGET glabels-batch-qt PROPERTY CXX_STANDARD 11) +target_compile_features (glabels-batch-qt + PUBLIC cxx_std_11 +) target_link_libraries (glabels-batch-qt Model diff --git a/glabels/CMakeLists.txt b/glabels/CMakeLists.txt index 41305c0..9ca141c 100644 --- a/glabels/CMakeLists.txt +++ b/glabels/CMakeLists.txt @@ -120,10 +120,9 @@ add_executable (glabels-qt WIN32 ${glabels_win_rc} ) -#target_compile_features (glabels-qt -# PUBLIC cxx_std_11 -#) -set_property (TARGET glabels-qt PROPERTY CXX_STANDARD 11) +target_compile_features (glabels-qt + PUBLIC cxx_std_11 +) target_include_directories (glabels-qt PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} diff --git a/glbarcode/CMakeLists.txt b/glbarcode/CMakeLists.txt index 6471024..ca561c1 100644 --- a/glbarcode/CMakeLists.txt +++ b/glbarcode/CMakeLists.txt @@ -33,10 +33,9 @@ add_library (glbarcode STATIC ${GLBARCODE_SOURCES} ) -#target_compile_features (glbarcode -# PUBLIC cxx_std_11 -#) -set_property (TARGET glbarcode PROPERTY CXX_STANDARD 11) +target_compile_features (glbarcode + PUBLIC cxx_std_11 +) target_include_directories (glbarcode PUBLIC .. diff --git a/model/CMakeLists.txt b/model/CMakeLists.txt index ee1af03..0edacf8 100644 --- a/model/CMakeLists.txt +++ b/model/CMakeLists.txt @@ -92,10 +92,9 @@ add_library (Model STATIC ${Model_moc_sources} ) -#target_compile_features (Model -# PUBLIC cxx_std_11 -#) -set_property (TARGET Model PROPERTY CXX_STANDARD 11) +target_compile_features (Model + PUBLIC cxx_std_11 +) target_include_directories (Model PUBLIC .. ${CMAKE_CURRENT_BINARY_DIR}/.. diff --git a/translations/CMakeLists.txt b/translations/CMakeLists.txt index a046d8b..dfc5ac6 100644 --- a/translations/CMakeLists.txt +++ b/translations/CMakeLists.txt @@ -45,10 +45,9 @@ add_executable (XmlStrings WIN32 XmlStrings.cpp ) -#target_compile_features (Model -# PUBLIC cxx_std_11 -#) -set_property (TARGET XmlStrings PROPERTY CXX_STANDARD 11) +target_compile_features (Model + PUBLIC cxx_std_11 +) target_link_libraries (XmlStrings Qt5::Core