Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 46 additions & 23 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,26 @@ jobs:
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
# Restore from cache the previously built ports. If cache-miss, download, build vcpkg.
- name: Restore from cache and install vcpkg
# Download and build vcpkg, without installing any port. If content is cached already, it is a no-op.
uses: lukka/run-vcpkg@v3
with:
vcpkgArguments: '@${{ env.vcpkgResponseFile }}'
vcpkgDirectory: '${{ github.workspace }}/vcpkg'
appendedCacheKey: ${{ hashFiles(env.vcpkgResponseFile) }}
env:
vcpkgResponseFile: '${{ github.workspace }}/response_file_mac.txt'
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
#- name: Restore from cache and install vcpkg
# # Download and build vcpkg, without installing any port. If content is cached already, it is a no-op.
# uses: lukka/run-vcpkg@v3
# with:
# vcpkgArguments: '@${{ env.vcpkgResponseFile }}'
# vcpkgDirectory: '${{ github.workspace }}/vcpkg'
# appendedCacheKey: ${{ hashFiles(env.vcpkgResponseFile) }}
# env:
# vcpkgResponseFile: '${{ github.workspace }}/response_file_mac.txt'
# ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
- name: Install Conan
id: conan
uses: turtlebrowser/get-conan@main
- name: Conan version
run: echo "${{ steps.conan.outputs.version }}"
- name: Create default profile
run: |
conan profile new default --detect
conan profile update settings.arch=x86_64 default
conan profile update settings.arch_build=x86_64 default
- name: install qt
run: |
brew install qt5
Expand Down Expand Up @@ -58,23 +68,36 @@ jobs:
submodules: true
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.arch }}
toolset: 16.0
- name: Get latest CMake
uses: lukka/get-cmake@latest
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
- name: Restore from cache and install vcpkg
# Download and build vcpkg, without installing any port. If content is cached already, it is a no-op.
uses: lukka/run-vcpkg@v6
with:
vcpkgArguments: '@${{ env.vcpkgResponseFile }}'
vcpkgDirectory: '${{ github.workspace }}/vcpkg'
appendedCacheKey: ${{ hashFiles(env.vcpkgResponseFile) }}
# Just install vcpkg for now, do not install any ports in this step yet.
#setupOnly: false
#additionalCachedPaths: ${{ env.buildDir }}/vcpkg_installed
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
vcpkgResponseFile: '${{ github.workspace }}/response_file_win.txt'
#- name: Restore from cache and install vcpkg
# # Download and build vcpkg, without installing any port. If content is cached already, it is a no-op.
# uses: lukka/run-vcpkg@v6
# with:
# vcpkgArguments: '@${{ env.vcpkgResponseFile }}'
# vcpkgDirectory: '${{ github.workspace }}/vcpkg'
# appendedCacheKey: ${{ hashFiles(env.vcpkgResponseFile) }}
# # Just install vcpkg for now, do not install any ports in this step yet.
# #setupOnly: false
# #additionalCachedPaths: ${{ env.buildDir }}/vcpkg_installed
# env:
# ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true'
# vcpkgResponseFile: '${{ github.workspace }}/response_file_win.txt'
- name: Install Conan
id: conan
uses: turtlebrowser/get-conan@main
- name: Conan version
run: echo "${{ steps.conan.outputs.version }}"
- name: Create default profile
run: |
conan profile new default --detect
conan profile show default
- name: Cache Qt
id: cache-qt
uses: actions/cache@v1
Expand Down
25 changes: 17 additions & 8 deletions cui/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,24 +1,32 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
CMAKE_MINIMUM_REQUIRED(VERSION 3.0)


set(CMAKE_OSX_DEPLOYMENT_TARGET "10.9" CACHE STRING "" FORCE)

if((NOT CMAKE_PROJECT_NAME))
message(FATAL_ERROR "CMAKE_PROJECT_NAME must be specified!")
set(CMAKE_PROJECT_NAME "PSDtoSS6")
#message(FATAL_ERROR "CMAKE_PROJECT_NAME must be specified!")
endif()
project(${CMAKE_PROJECT_NAME})


project(${CMAKE_PROJECT_NAME} CXX)

IF(WIN32)
ELSEIF(APPLE)
set(CMAKE_CXX_STANDARD 11)

ELSEIF(CMAKE_COMPILER_IS_GNUCXX)
ADD_DEFINITIONS(-std=gnu++14)
ENDIF()

set(CONAN_DISABLE_CHECK_COMPILER True CACHE BOOL "" FORCE )
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()


find_package(ZLIB REQUIRED)
find_package(PNG REQUIRED)
find_package(JPEG REQUIRED)
find_package(tinyxml2 CONFIG REQUIRED)
find_package(tinyxml2 )
find_path(SYSTEM_INCLUDE_DIR picojson.h)

find_package(ICU COMPONENTS UC IO REQUIRED)
Expand Down Expand Up @@ -65,8 +73,8 @@ ADD_EXECUTABLE(${CMAKE_PROJECT_NAME}

IF(WIN32)
ADD_DEFINITIONS(/D_WIN64)
set(CMAKE_CXX_FLAGS_RELEASE "/MT ")
set(CMAKE_CXX_FLAGS_DEBUG "/MTd /Zi /Od")
# set(CMAKE_CXX_FLAGS_RELEASE "/MT ")
# set(CMAKE_CXX_FLAGS_DEBUG "/MTd /Zi /Od")
set(CMAKE_EXE_LINKER_FLAGS "/OPT:REF /OPT:ICF ")
ADD_DEFINITIONS(-DUNICODE -D_UNICODE)

Expand All @@ -86,7 +94,8 @@ ENDIF()
include_directories( ${PNG_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} ${tinyxml2_include_dir} ${jpeg_include_dir} libpsd-0.9/include ${ICU_UC_INCLUDE_DIR})


target_link_libraries( ${CMAKE_PROJECT_NAME} PRIVATE ${PNG_LIBRARY} ${libpsd-0.9} ${OPENIMAGEIO_LIBRARIES} libpsd tinyxml2::tinyxml2 ZLIB::ZLIB ${ICU_UC_LIBRARY} ${ICU_IO_LIBRARY} ${ICU_DATA_LIBRARY})
#target_link_libraries( ${CMAKE_PROJECT_NAME} PRIVATE ${PNG_LIBRARY} ${libpsd-0.9} ${OPENIMAGEIO_LIBRARIES} libpsd tinyxml2::tinyxml2 ZLIB::ZLIB ${ICU_LIBRARIES} ${ICU_UC_LIBRARY} ${ICU_IO_LIBRARY} ${ICU_DATA_LIBRARY})
target_link_libraries( ${CMAKE_PROJECT_NAME} libpsd ${CONAN_LIBS} )


#target_link_libraries( ${CMAKE_PROJECT_NAME} PRIVATE libpng_static ${libpsd-0.9} ${OPENIMAGEIO_LIBRARIES} libpsd tinyxml2::tinyxml2 ZLIB::ZLIB ${ICU_UC_LIBRARY} ${ICU_IO_LIBRARY} ${ICU_DATA_LIBRARY})
Expand Down
21 changes: 21 additions & 0 deletions cui/conanfile.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[requires]
zlib/1.2.12
libpng/1.6.37
libjpeg/9d
tinyxml2/9.0.0
icu/71.1


[generators]
cmake
visual_studio

[options]
zlib/1.2.12:shared=False
libpng/1.6.37:shared=False
libjpeg/9d:shared=False
tinyxml2/9.0.0:shared=False
icu/71.1:shared=False


[imports]
27 changes: 18 additions & 9 deletions gui/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ MainWindow::MainWindow(QWidget *parent) :

setFixedWidth(this->width());
setFixedHeight(this->height());

//初期化
convert_exec = false;
cnvOutputStr.clear();
Expand Down Expand Up @@ -112,6 +112,8 @@ MainWindow::MainWindow(QWidget *parent) :
ui->comboBox_canvasSize->addItem(map_canvasSize[0] = "Default");
ui->comboBox_canvasSize->addItem(map_canvasSize[1] = "PSD Size");

ui->textBrowser_output->setText(cp.outputpath.c_str());

pushButton_enableset();

//スタイルシートを読み込む
Expand Down Expand Up @@ -283,8 +285,16 @@ void MainWindow::setText_to_List(QStringList list)
}
}
loadConfig(data_path + "/config.json");
templistload();

templistload();//コンバートするpsdのリスト
//出力フォルダのパスを確認
if(ui->textBrowser_output->toPlainText() == "")//初回起動時
{
Outputpath = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation);
Outputpath += "/SpriteStudio/PSDtoSS6";//デフォルトの出力フォルダをDocument直下にするならここを削除
ui->textBrowser_output->setText(Outputpath);
}
else{//既にconfig.jsonがあるとき
}
}

void MainWindow::on_pushButton_exit_clicked()
Expand Down Expand Up @@ -561,20 +571,19 @@ void MainWindow::on_pushButton_output_clicked()
QString str;
str = QFileDialog::getExistingDirectory(this, tr("_outputDirectoryText"), Outputpath);

if ( str != "" ){//選択されたフォルダ名
if ( str != "" ){// フォルダの選択を押したとき
Outputpath = str;
}
else{//未指定ならドキュメントの位置
Outputpath = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation);
}

#if Q_WS_WIN
Outputpath += "\\";
#else
Outputpath += "/";
#endif
ui->textBrowser_output->setText(Outputpath);

ui->textBrowser_output->setText(Outputpath);
}
else{//cancellをおしたとき
}
}

//リストファイルの読み込み
Expand Down
7 changes: 5 additions & 2 deletions scripts/build_mac_cui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,16 @@ BUILDDIR=${SRCDIR}/build
BUILDDIR=`cd ${BUILDDIR} && pwd -P`

pushd ${BUILDDIR}
cmake -DCMAKE_TOOLCHAIN_FILE="${VCPKG_PREFIX}/scripts/buildsystems/vcpkg.cmake" -DCMAKE_PROJECT_NAME=${PROJECT_NAME} .. || exit 1

conan install .. --build=missing
cmake -DCMAKE_PROJECT_NAME=${PROJECT_NAME} .. || exit 1

cmake --build . || exit 1
popd > /dev/null # build

popd > /dev/null # SRCDIR

/bin/mkdir -p ${DSTDIR}
/bin/cp -rf ${BUILDDIR}/${PROJECT_NAME} ${DSTDIR}
/bin/cp -rf ${BUILDDIR}/bin/${PROJECT_NAME} ${DSTDIR}

popd > /dev/null # BASEDIR
10 changes: 8 additions & 2 deletions scripts/build_win_cui.bat
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,16 @@ if exist build rd /s /q build
mkdir build
pushd build

cmake -DCMAKE_TOOLCHAIN_FILE="%VCPKG_PREFIX%\scripts\buildsystems\vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=x64-windows-static -DCMAKE_PROJECT_NAME="PSDtoSS6" .. || exit /b 1
rem conan profile update settings.compiler.version=16 default
conan profile show default
conan install .. -s build_type=Release --build=missing

rem cmake -DCMAKE_TOOLCHAIN_FILE="%VCPKG_PREFIX%\scripts\buildsystems\vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=x64-windows-static -DCMAKE_PROJECT_NAME="PSDtoSS6" .. || exit /b 1
cmake -DCMAKE_PROJECT_NAME="PSDtoSS6" .. || exit /b 1
cmake --build . -- /t:clean;rebuild /p:configuration=release /clp:ErrorsOnly /m:4 || exit /b 1

xcopy /y Release\*.exe %DSTDIR%
rem xcopy /y Release\*.exe %DSTDIR%
xcopy /y bin\*.exe %DSTDIR%

rem pause
exit /b
9 changes: 7 additions & 2 deletions scripts/build_win_gui.bat
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,17 @@ if not defined DSTDIR set DSTDIR=%BASEDIR%\out\
echo SRCDIR : %SRCDIR%
echo DSTDIR : %DSTDIR%

rem set CMAKE_PREFIX_PATH=C:\Qt\5.15.2\msvc2019_64\lib\
rem set QT_PATH=C:\Qt\5.15.2\msvc2019_64\
if "%VCPKG_PREFIX%" == "" (
if exist %BASEDIR%\vcpkg (
set VCPKG_PREFIX=%BASEDIR%\vcpkg
)
)

set DEFAULT_QT_PATH=C:\Qt\Qt5.9.7\5.9.7\msvc2017_64
rem set DEFAULT_QT_PATH=C:\Qt\Qt5.9.7\5.9.7\msvc2017_64
set DEFAULT_QT_PATH=C:\Qt\5.15.2\msvc2019_64

if "%QT_PATH%" == "" (
set QT_PATH=%DEFAULT_QT_PATH%
)
Expand All @@ -33,7 +37,8 @@ if exist build rd /s /q build
mkdir build
pushd build

cmake -DCMAKE_TOOLCHAIN_FILE="%VCPKG_PREFIX%\scripts\buildsystems\vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=x64-windows-static -DCMAKE_PROJECT_NAME="PSDtoSS6GUI" .. || exit /b 1
rem cmake -DCMAKE_TOOLCHAIN_FILE="%VCPKG_PREFIX%\scripts\buildsystems\vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=x64-windows-static -DCMAKE_PROJECT_NAME="PSDtoSS6GUI" .. || exit /b 1
cmake -DCMAKE_PROJECT_NAME="PSDtoSS6GUI" .. || exit /b 1
cmake --build . -- /t:clean;rebuild /p:configuration=release /clp:ErrorsOnly /m:4 || exit /b 1

xcopy /y Release\*.exe %DSTDIR%
Expand Down
14 changes: 0 additions & 14 deletions scripts/prepare_win.bat
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,5 @@ if not ""%1""=="""" (
)

pushd %DSTDIR%
rem rd /s /q vcpkg
rem git clone https://github.com/microsoft/vcpkg.git
pushd vcpkg
call bootstrap-vcpkg.bat

set VCPKG_DEFAULT_TRIPLET=x64-windows-static
vcpkg install tinyxml2
vcpkg install zlib
vcpkg install libpng
vcpkg install libjpeg-turbo
vcpkg install icu

vcpkg integrate install
popd

popd
1 change: 0 additions & 1 deletion vcpkg
Submodule vcpkg deleted from 0cbc57