Skip to content

Commit

Permalink
generic: fixup
Browse files Browse the repository at this point in the history
Signed-off-by: Ionut Muthi <[email protected]>
  • Loading branch information
IonutMuthi committed Jun 6, 2024
1 parent 1eec60b commit c8ab804
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 28 deletions.
5 changes: 1 addition & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,6 @@ if(WIN32)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resources/properties.rc.cmakein ${SCOPY_WIN32_RESOURCES} @ONLY)
endif()

if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
include(ScopyWindows)
endif()

find_path(
IIO_INCLUDE_DIRS
NAMES iio.h
Expand Down Expand Up @@ -198,6 +194,7 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/translations DESTINATION ${CMAKE_INSTALL_FULL_DATADIR})
endif()
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
include(ScopyWindows)
duplicate_target(${PROJECT_NAME} Scopy-console)
set_target_properties(Scopy-console PROPERTIES WIN32_EXECUTABLE FALSE)
endif()
Expand Down
18 changes: 0 additions & 18 deletions cmake/Modules/ScopyWindows.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,3 @@ macro(duplicate_target ORIGINAL NEW)
target_include_directories(${NEW} PRIVATE ${original_includes})
target_compile_options(${NEW} PRIVATE ${original_options})
endmacro()


set(PLUGIN_COMPONENTS "")
set(PLUGIN_COMPONENTS_FILES "")

function(ConfigureInstallerSettings PROJECT_NAME PLUGIN_INSTALLER_DESCRIPTION FIXED)

set(PLUGIN_COMPONENTS
${PLUGIN_COMPONENTS}
"\n Name: \"plugins/${PROJECT_NAME}\"; Description: ${PLUGIN_INSTALLER_DESCRIPTION} ; Types: full plugins; Flags: ${FIXED} "
PARENT_SCOPE
)
set(PLUGIN_COMPONENTS_FILES
${PLUGIN_COMPONENTS_FILES}
"\n Source:\"{#DestFolder}\\plugins\\plugins\\libscopy-${PROJECT_NAME}.dll\"; DestDir: \"{app}\\plugins\\plugins\"; Components: plugins\\${PROJECT_NAME}; Flags: ignoreversion skipifsourcedoesntexist onlyifdoesntexist"
PARENT_SCOPE
)
endfunction()
16 changes: 16 additions & 0 deletions cmake/Modules/ScopyWindowsInstaller.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
set(PLUGIN_COMPONENTS "" CACHE STRING "PLUGIN COMPONENTS FOR WINDOWS INSTALLER" FORCE)
set(PLUGIN_COMPONENTS_FILES "" CACHE STRING "PLUGIN COMPONENTS FILES FOR WINDOWS INSTALLER" FORCE)

function(ConfigureInstallerSettings PROJECT_NAME PLUGIN_INSTALLER_DESCRIPTION FIXED)

set(PLUGIN_COMPONENTS
${PLUGIN_COMPONENTS}
"\n Name: \"plugins/${PROJECT_NAME}\"; Description: ${PLUGIN_INSTALLER_DESCRIPTION} ; Types: full plugins; Flags: ${FIXED} "
CACHE STRING "PLUGIN COMPONENTS FOR WINDOWS INSTALLER" FORCE
)
set(PLUGIN_COMPONENTS_FILES
${PLUGIN_COMPONENTS_FILES}
"\n Source:\"{#DestFolder}\\plugins\\plugins\\libscopy-${PROJECT_NAME}.dll\"; DestDir: \"{app}\\plugins\\plugins\"; Components: plugins\\${PROJECT_NAME}; Flags: ignoreversion skipifsourcedoesntexist onlyifdoesntexist"
CACHE STRING "PLUGIN COMPONENTS FILES FOR WINDOWS INSTALLER" FORCE
)
endfunction()
10 changes: 4 additions & 6 deletions plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,13 @@ option(ENABLE_PLUGIN_PQM "Enable PQM plugin" ON)
option(ENABLE_PLUGIN_DATALOGGER "Enable DATALOGGER plugin" ON)
option(ENABLE_PLUGIN_IIODEBUGPLUGIN "Enable IIODEBUGPLUGIN plugin" ON)

if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
include(ScopyWindows)
endif()
set(PLUGIN_COMPONENTS "")
set(PLUGIN_COMPONENTS_FILES "")

# The order the plugins are added here will also affect the installer order. Make sure fixed plugin are before optional
# ones.

if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
include(ScopyWindowsInstaller)
endif()

if(ENABLE_PLUGIN_TEST)
add_subdirectory(guitestplugin)
list(APPEND PLUGINS ${PLUGIN_NAME})
Expand Down

0 comments on commit c8ab804

Please sign in to comment.