1
0
Fork 0
mirror of https://github.com/eosswedenorg/antelope-keygen synced 2026-07-02 11:43:40 +02:00

CMake: only pack components that are configured.

This commit is contained in:
Henrik Hautakoski 2020-04-25 10:52:49 +02:00
parent 8b8ba4c2c6
commit df2b40d1c6

View file

@ -52,6 +52,15 @@ endif (WIN32)
# Should be used to cache large downloaded data that won't be deleted on clean builds. # Should be used to cache large downloaded data that won't be deleted on clean builds.
set( DOWNLOAD_CACHE_DIR ${CMAKE_CURRENT_LIST_DIR}/.cache ) set( DOWNLOAD_CACHE_DIR ${CMAKE_CURRENT_LIST_DIR}/.cache )
set( components )
if (COMPONENT_CLI)
list(APPEND components cli )
endif()
if (COMPONENT_GUI)
list(APPEND components gui )
endif()
# -------------------------------- # --------------------------------
# Compiler settings # Compiler settings
# -------------------------------- # --------------------------------
@ -88,7 +97,7 @@ include_directories(${PROJECT_BINARY_DIR})
include(CPackConfig) include(CPackConfig)
set( CPACK_COMPONENTS_ALL cli gui ) set( CPACK_COMPONENTS_ALL ${components} )
if (CPACK_GENERATOR MATCHES "^[Nn][Ss][Ii][Ss]$") if (CPACK_GENERATOR MATCHES "^[Nn][Ss][Ii][Ss]$")
set( CPACK_RESOURCE_FILE_LICENSE ${PROJECT_LICENSE_FILE} ) set( CPACK_RESOURCE_FILE_LICENSE ${PROJECT_LICENSE_FILE} )
@ -103,13 +112,9 @@ configure_file(cmake/CPackProperties.cmake.in ${CPACK_PROPERTIES_FILE} @ONLY)
add_subdirectory( common ) add_subdirectory( common )
if (COMPONENT_CLI) foreach(comp ${components})
add_subdirectory( cli ) add_subdirectory( ${comp} )
endif() endforeach()
if (COMPONENT_GUI)
add_subdirectory( gui )
endif()
# -------------------------------- # --------------------------------
# CPack # CPack