Skip to content

Commit 1de2c32

Browse files
author
Francois Budin
committed
ENH: cxx and executable can have different names.
Previously, each CLI needed to have a cxx file called the same as the given executable name. This was restricting the possibility to name an executable differently based, for example, on configuration or compilation options. This patch introduced a new option to disable this requirement. This allows SEMMacroBuildCLI to stay backward compatible while allowing more flexibiliy in the naming of the cxx files and the executable [1]. [1] https://docs.google.com/a/kitware.com/document/d/1Wkl7RFVb87ZbcgZnSQ4nmyM2bFEQUN1xT-Q5ALLJh8w/edit?usp=sharing
1 parent 8741068 commit 1de2c32

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

CMake/SEMMacroBuildCLI.cmake

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ macro(SEMMacroBuildCLI)
1212
set(options
1313
EXECUTABLE_ONLY
1414
NO_INSTALL VERBOSE
15+
DISABLE_DEFAULT_CXX_FILE
1516
)
1617
set(oneValueArgs
1718
NAME LOGO_HEADER
@@ -102,7 +103,10 @@ macro(SEMMacroBuildCLI)
102103
find_package(SlicerExecutionModel REQUIRED GenerateCLP)
103104
include(${GenerateCLP_USE_FILE})
104105

105-
set(${CLP}_SOURCE ${CLP}.cxx ${LOCAL_SEM_ADDITIONAL_SRCS})
106+
set(${CLP}_SOURCE ${LOCAL_SEM_ADDITIONAL_SRCS})
107+
if(NOT LOCAL_SEM_DISABLE_DEFAULT_CXX_FILE)
108+
list(APPEND ${CLP}_SOURCE ${CLP}.cxx)
109+
endif()
106110
generateclp(${CLP}_SOURCE ${cli_xml_file} ${LOCAL_SEM_LOGO_HEADER})
107111

108112
if(DEFINED LOCAL_SEM_LINK_DIRECTORIES)

0 commit comments

Comments
 (0)