Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
e08f1f7
Rewrite CMake dependency installation
lukas-w Jun 13, 2018
c9ec090
Fix listing file names to deploy
lukas-w Jun 16, 2018
9f5f6fe
Fix Windows packaging
PhysSong Nov 25, 2018
76a08e2
InstallDependencies: fix the status message
PhysSong Nov 26, 2018
40b9a35
CircleCI: create Windows installers
PhysSong Nov 26, 2018
c9df21f
AppVeyor: create Windows installers
PhysSong Nov 26, 2018
0bf02f4
Install: fix LIB_DIRS for non-Windows builds
PhysSong Nov 26, 2018
e08d5c9
Update Windows exclude list
PhysSong Nov 26, 2018
e2c9a97
Add SETUPAPI.dll
PhysSong Jul 18, 2019
9b50183
Use per-build-type DEPLOY_LIST_FILE
PhysSong Jul 18, 2019
88e7e86
CMake: extract dll installation code into a portable function.
Reflexe Aug 12, 2019
d937775
CMake -> RemoteVstPlugin32: Enable automatic dll installation.
Reflexe Aug 12, 2019
f2b782f
Merge pull request #3 from LMMS/master
Reflexe Aug 20, 2019
488b19f
Travis test Commit; to be removed
Reflexe Aug 21, 2019
74a278d
Merge branch 'cmake/install-refactor' of github.com:Reflexe/lmms into…
Reflexe Aug 21, 2019
9491d85
(fixup) CMake: Add manpage
Reflexe Aug 21, 2019
61bd86f
fixup! (fixup) CMake: Add manpage
Reflexe Aug 21, 2019
bd703f5
fixup! 9b50183 Use per-build-type DEPLOY_LIST_FILE
Reflexe Aug 21, 2019
4ee6fac
CMake->BuildPlugin: Change PREFIX even if STRIP is false.
Reflexe Aug 21, 2019
93724b6
CMake: Provide API for install-time variables with generator expression.
Reflexe Aug 21, 2019
be9f2a0
CMake: Move InstallTargetDependencies to cmake/modules
Reflexe Aug 21, 2019
d102b57
fixup! CMake: extract dll installation code into a portable function.
Reflexe Aug 22, 2019
66b4908
Temp: an attempt to solve appveyor build.
Reflexe Aug 22, 2019
75bba03
fixup! CMake: Provide API for install-time variables with generator e…
Reflexe Aug 22, 2019
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
4 changes: 4 additions & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,9 @@ build_script:
- cmake -DUSE_COMPILE_CACHE=ON -DCACHE_TOOL=%APPVEYOR_BUILD_FOLDER%/clcache.4.1.0/clcache-4.1.0/clcache.exe -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_PREFIX_PATH=c:/Qt/5.12/msvc2017%QT_SUFFIX%;c:/tools/vcpkg/installed/%PLATFORM%-windows -DCMAKE_GENERATOR_PLATFORM="%CMAKE_PLATFORM%" ..
- cmake --build . -- /maxcpucount:4
- cmake --build . --target tests
- cmake --build . --target package
artifacts:
- path: 'build\lmms-*.exe'
name: Installer
cache:
- c:/tools/vcpkg/installed
18 changes: 18 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,15 @@ jobs:
- run:
name: Build tests
command: cd build && make tests
- run:
name: Build installer
command: |
cd build
make package
cp ./lmms-*.exe /tmp/artifacts/
- store_artifacts:
path: /tmp/artifacts/
destination: /
- *ccache_stats
- *save_cache
mingw64:
Expand All @@ -79,6 +88,15 @@ jobs:
- run:
name: Build tests
command: cd build && make tests
- run:
name: Build installer
command: |
cd build
make package
cp ./lmms-*.exe /tmp/artifacts/
- store_artifacts:
path: /tmp/artifacts/
destination: /
- *ccache_stats
- *save_cache
linux.gcc:
Expand Down
7 changes: 5 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ CMAKE_MINIMUM_REQUIRED(VERSION 3.3)
PROJECT(lmms)

SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" ${CMAKE_MODULE_PATH})
SET(LMMS_BINARY_DIR ${CMAKE_BINARY_DIR})
SET(LMMS_SOURCE_DIR ${CMAKE_SOURCE_DIR})

IF(COMMAND CMAKE_POLICY)
CMAKE_POLICY(SET CMP0005 NEW)
Expand All @@ -13,6 +15,7 @@ IF(COMMAND CMAKE_POLICY)
CMAKE_POLICY(SET CMP0050 OLD)
ENDIF()
CMAKE_POLICY(SET CMP0020 NEW)
CMAKE_POLICY(SET CMP0057 NEW)
ENDIF(COMMAND CMAKE_POLICY)

INCLUDE(CheckSubmodules)
Expand Down Expand Up @@ -565,8 +568,8 @@ ADD_SUBDIRECTORY(tests)
ADD_SUBDIRECTORY(data)
ADD_SUBDIRECTORY(doc)

# post-install tasks
ADD_SUBDIRECTORY(cmake/postinstall)
# install tasks
ADD_SUBDIRECTORY(cmake/install)

ADD_CUSTOM_COMMAND(OUTPUT "${CMAKE_BINARY_DIR}/lmms.1.gz"
COMMAND gzip -c ${CMAKE_SOURCE_DIR}/doc/lmms.1 > ${CMAKE_BINARY_DIR}/lmms.1.gz
Expand Down
45 changes: 45 additions & 0 deletions cmake/install/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
SET(PLUGIN_FILES "")
IF(LMMS_BUILD_WIN32)
INSTALL(FILES $<TARGET_FILE:Qt5::QWindowsIntegrationPlugin> DESTINATION platforms)
ENDIF()

IF(LMMS_BUILD_WIN32 OR LMMS_INSTALL_DEPENDENCIES)
# Install system libraries
include(InstallRequiredSystemLibraries)
include(InstallTargetDependencies)

# Collect directories to search for DLLs
GET_FILENAME_COMPONENT(QTBIN_DIR "${QT_QMAKE_EXECUTABLE}" PATH)
set(LIB_DIRS "${QTBIN_DIR}")

GET_PROPERTY(PLUGINS_BUILT GLOBAL PROPERTY PLUGINS_BUILT)

IF(LMMS_BUILD_WIN32)
SET(LMMS_DEP_DESTINATION ${BIN_DIR})
SET(PLUGIN_DEP_DESTINATION ${BIN_DIR})
ELSE()
SET(LMMS_DEP_DESTINATION ${LIB_DIR})
SET(PLUGIN_DEP_DESTINATION ${LIB_DIR})
ENDIF()

INSTALL_TARGET_DEPENENCIES(
NAME "main_binary"
TARGETS lmms
DESTINATION "${LMMS_DEP_DESTINATION}"
LIB_DIRS ${LIB_DIRS} "${BIN_DIR}" "${CMAKE_FIND_ROOT_PATH}"
LIB_DIRS_SUFFIXES "bin" "lib" "../bin"
)

INSTALL_TARGET_DEPENENCIES(
NAME "plugins"
TARGETS ${PLUGINS_BUILT}
DESTINATION ${PLUGIN_DEP_DESTINATION}
LIB_DIRS ${LIB_DIRS} "${BIN_DIR}" "${PLUGIN_DIR}" "${CMAKE_FIND_ROOT_PATH}"
LIB_DIRS_SUFFIXES "bin" "lib" "../bin"
)
ENDIF()

IF(LMMS_BUILD_APPLE)
INSTALL(CODE "EXECUTE_PROCESS(COMMAND chmod u+x ${CMAKE_BINARY_DIR}/install_apple.sh)")
INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${CMAKE_BINARY_DIR}/install_apple.sh)")
ENDIF()
23 changes: 23 additions & 0 deletions cmake/install/excludelist-win
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# List of DLLs considered to be system libraries.
# This is needed when cross-compiling for Windows.
ADVAPI32.dll
COMCTL32.dll
comdlg32.dll
dwmapi.dll
GDI32.dll
IMM32.dll
KERNEL32.dll
MPR.DLL
msvcrt.dll
ole32.dll
OLEAUT32.dll
OPENGL32.DLL
SHELL32.dll
USER32.dll
UxTheme.dll
VERSION.dll
WINMM.DLL
WS2_32.dll
RPCRT4.dll
dsound.dll
SETUPAPI.dll
14 changes: 11 additions & 3 deletions cmake/modules/BuildPlugin.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ MACRO(BUILD_PLUGIN PLUGIN_NAME)
TARGET_LINK_LIBRARIES(${PLUGIN_NAME} lmms)
ENDIF(LMMS_BUILD_WIN32)

INSTALL(TARGETS ${PLUGIN_NAME} DESTINATION "${PLUGIN_DIR}")
INSTALL(TARGETS ${PLUGIN_NAME}
LIBRARY DESTINATION "${PLUGIN_DIR}"
RUNTIME DESTINATION "${PLUGIN_DIR}"
)

IF(LMMS_BUILD_APPLE)
IF ("${PLUGIN_LINK}" STREQUAL "SHARED")
Expand All @@ -72,9 +75,11 @@ MACRO(BUILD_PLUGIN PLUGIN_NAME)
ENDIF()
ADD_DEPENDENCIES(${PLUGIN_NAME} lmms)
ENDIF(LMMS_BUILD_APPLE)
IF(LMMS_BUILD_WIN32 AND STRIP)
IF(LMMS_BUILD_WIN32)
IF(STRIP)
ADD_CUSTOM_COMMAND(TARGET ${PLUGIN_NAME} POST_BUILD COMMAND ${STRIP} "$<TARGET_FILE:${PLUGIN_NAME}>")
ENDIF()
SET_TARGET_PROPERTIES(${PLUGIN_NAME} PROPERTIES PREFIX "")
ADD_CUSTOM_COMMAND(TARGET ${PLUGIN_NAME} POST_BUILD COMMAND ${STRIP} "$<TARGET_FILE:${PLUGIN_NAME}>")
ENDIF()

SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${RCC_OUT} ${plugin_MOC_out}")
Expand All @@ -89,5 +94,8 @@ MACRO(BUILD_PLUGIN PLUGIN_NAME)
TARGET_INCLUDE_DIRECTORIES(${PLUGIN_NAME}
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
)

SET_PROPERTY(GLOBAL APPEND PROPERTY PLUGINS_BUILT ${PLUGIN_NAME})
GET_PROPERTY(PLUGINS_BUILT GLOBAL PROPERTY PLUGINS_BUILT)
ENDMACRO(BUILD_PLUGIN)

20 changes: 20 additions & 0 deletions cmake/modules/CreateTempFilePath.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
define_property(GLOBAL PROPERTY "CreateTempFile_counter" BRIEF_DOCS "counter for CreateTempFile"
FULL_DOCS "counter for CreateTempFile")

function(CreateTempFilePath)
set(options)
set(oneValueArgs OUTPUT_VAR)
set(multiValueArgs)
cmake_parse_arguments(TEMP "${options}" "${oneValueArgs}"
"${multiValueArgs}" ${ARGN} )

get_property(counter GLOBAL PROPERTY CreateTempFile_counter)
if(NOT ${counter})
set(counter 0)
endif()

math(EXPR counter "${counter} + 1")
set_property(GLOBAL PROPERTY CreateTempFile_counter ${counter})

set(${TEMP_OUTPUT_VAR} "${CMAKE_BINARY_DIR}/temp${counter}" PARENT_SCOPE)
endfunction()
25 changes: 25 additions & 0 deletions cmake/modules/DefineInstallVar.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# This functions forwards a variable to
# the install stage.
# Parameters:
# CONTENT: Variable content.
# NAME: Variable name.
# Options:
# GENERATOR_EXPRESSION: Support generator expression for CONTENT.
function(DEFINE_INSTALL_VAR)
set(options GENERATOR_EXPRESSION)
set(oneValueArgs NAME )
set(multiValueArgs CONTENT)
cmake_parse_arguments(VAR "${options}" "${oneValueArgs}"
"${multiValueArgs}" ${ARGN} )

# install(CODE) does not support generator expression in ver<3.14
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On a side note, CMP0087 should be set to use generator expressions in CMake >= 3.14.

if(VAR_GENERATOR_EXPRESSION AND ${CMAKE_VERSION} VERSION_LESS "3.14.0")
include(CreateTempFilePath)
CreateTempFilePath(OUTPUT_VAR file_path)
file(GENERATE OUTPUT "${file_path}" CONTENT "${VAR_CONTENT}")
Copy link
Member

@PhysSong PhysSong Aug 22, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The counter logic doesn't work because the CMake script is evaluated only once. For the MSVC generator, file(GENERATE) itself is executed once, but the content is evaluated multiple times at the generation time.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NVM, I misunderstood the purpose of it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

However, I still wonder: Can we create files with unique names(more readable if possible) without a counter?

install(CODE "file(READ ${file_path} \"${VAR_NAME}\")")
else()
cmake_policy(SET CMP<0087> NEW)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
cmake_policy(SET CMP<0087> NEW)
cmake_policy(SET CMP0087 NEW)

Also, why did you use spaces instead of tabs in some new files?

install(CODE "set(\"${VAR_NAME}\" \"${VAR_CONTENT}\")")
endif()
endfunction()
Loading