Skip to content

Commit

Permalink
Add install command
Browse files Browse the repository at this point in the history
  • Loading branch information
tishion committed May 23, 2022
1 parent 03740ee commit 49d8193
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ output
.DS_Store
CMakeLists.txt.user
docs/doxygen/xml
out
2 changes: 1 addition & 1 deletion CefViewCore
2 changes: 1 addition & 1 deletion generate-linux-proj-osr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ do
done

echo ============== Config project ==============
cmake -G "Unix Makefiles" -S . -B "${BUILD_DIR}" -DBUILD_DEMO=ON -DUSE_OSR=ON -DUSE_SANDBOX=ON
cmake -G "Unix Makefiles" -S . -B "${BUILD_DIR}" -DBUILD_DEMO=ON -DUSE_OSR=ON -DUSE_SANDBOX=ON -DCMAKE_INSTALL_PREFIX:PATH="$(pwd)/out/install/linux"

if [ ${BUILD_PROJECT} -eq 1 ]
then
Expand Down
2 changes: 1 addition & 1 deletion generate-linux-proj.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ do
done

echo ============== Config project ==============
cmake -G "Unix Makefiles" -S . -B "${BUILD_DIR}" -DBUILD_DEMO=ON -DUSE_SANDBOX=ON
cmake -G "Unix Makefiles" -S . -B "${BUILD_DIR}" -DBUILD_DEMO=ON -DUSE_SANDBOX=ON -DCMAKE_INSTALL_PREFIX:PATH="$(pwd)/out/install/linux"

if [ ${BUILD_PROJECT} -eq 1 ]
then
Expand Down
2 changes: 1 addition & 1 deletion generate-win-proj-osr.bat
Original file line number Diff line number Diff line change
@@ -1 +1 @@
cmake -S . -B .build/Windows -DBUILD_DEMO=ON -DUSE_OSR=ON
cmake -S . -B .build/Windows -DBUILD_DEMO=ON -DUSE_OSR=ON -DCMAKE_INSTALL_PREFIX:PATH="%cd%/out/install/windows"
2 changes: 1 addition & 1 deletion generate-win-proj.bat
Original file line number Diff line number Diff line change
@@ -1 +1 @@
cmake -S . -B .build/Windows -DBUILD_DEMO=ON
cmake -S . -B .build/Windows -DBUILD_DEMO=ON -DCMAKE_INSTALL_PREFIX:PATH="%cd%/out/install/windows"
29 changes: 29 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,15 @@ if (OS_WINDOWS)
_UNICODE
QCEFVIEW_LIB
)

add_custom_command(TARGET QCefView
POST_BUILD

# copy binary files of CefViewCore
COMMAND ${CMAKE_COMMAND} -E copy_directory
"$<TARGET_FILE_DIR:CefViewWing>"
"$<TARGET_FILE_DIR:QCefView>"
)
endif() # OS_WINDOWS

if (OS_LINUX)
Expand Down Expand Up @@ -113,6 +122,15 @@ if (OS_LINUX)
PRIVATE
Qt${QT_VERSION_MAJOR}::GuiPrivate
)

add_custom_command(TARGET QCefView
POST_BUILD

# copy binary files of CefViewCore
COMMAND ${CMAKE_COMMAND} -E copy_directory
"$<TARGET_FILE_DIR:CefViewWing>"
"$<TARGET_FILE_DIR:QCefView>"
)
endif() # OS_LINUX

if (OS_MACOS)
Expand Down Expand Up @@ -214,3 +232,14 @@ target_link_libraries(QCefView
Qt${QT_VERSION_MAJOR}::Widgets
)

# install QCefView files
install(
TARGETS QCefView
ARCHIVE DESTINATION "QCefView/lib$<$<CONFIG:Debug>:/Debug>"
LIBRARY DESTINATION "QCefView/bin$<$<CONFIG:Debug>:/Debug>"
#RUNTIME DESTINATION "QCefView/bin$<$<CONFIG:Debug>:/Debug>"
FRAMEWORK DESTINATION "QCefView/lib$<$<CONFIG:Debug>:/Debug>"
)
install(DIRECTORY
"$<TARGET_FILE_DIR:QCefView>/" DESTINATION "QCefView/bin$<$<CONFIG:Debug>:/Debug>"
)

0 comments on commit 49d8193

Please sign in to comment.