Skip to content

Commit a12ae7f

Browse files
authored
Merge pull request #1171 from arcaneframework/dev/sdc-add-install-path-for-axl
Add option to change axl install directory.
2 parents f2ea57e + e2fb6cc commit a12ae7f

File tree

2 files changed

+23
-7
lines changed

2 files changed

+23
-7
lines changed

axlstar/AxlstarUtilities.cmake

+11-3
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,16 @@
1111
function(generateAxl target)
1212

1313
set(options INSTALL_GENERATED_FILES NO_COPY NO_ARCANE NO_MESH)
14-
set(oneValueArgs AXL_OPTION_GENERATION_MODE NAMESPACE)
14+
set(oneValueArgs AXL_OPTION_GENERATION_MODE NAMESPACE USER_INSTALL_PREFIX)
1515
set(multiValueArgs)
1616

1717
cmake_parse_arguments(ARGS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
1818

19-
set(axl_path ${CMAKE_BINARY_DIR}/${PROJECT_NAME}/axl)
19+
if (ARGS_USER_INSTALL_PREFIX)
20+
set(axl_path ${CMAKE_BINARY_DIR}/${ARGS_USER_INSTALL_PREFIX}/axl)
21+
else ()
22+
set(axl_path ${CMAKE_BINARY_DIR}/${PROJECT_NAME}/axl)
23+
endif ()
2024

2125
if(NOT EXISTS ${axl_path})
2226
file(MAKE_DIRECTORY ${axl_path})
@@ -125,7 +129,11 @@ function(generateAxl target)
125129
set_property(GLOBAL APPEND PROPERTY AXL_DB ${file})
126130

127131
if(ARGS_INSTALL_GENERATED_FILES)
128-
install(FILES ${generated_files} DESTINATION include/${PROJECT_NAME}/axl)
132+
if (ARGS_USER_INSTALL_PREFIX)
133+
install(FILES ${generated_files} DESTINATION include/${ARGS_USER_INSTALL_PREFIX}/axl)
134+
else ()
135+
install(FILES ${generated_files} DESTINATION include/${PROJECT_NAME}/axl)
136+
endif ()
129137
endif()
130138

131139
endforeach()

axlstar/CMake/AxlstarUtilities.cmake

+12-4
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,17 @@ cmake_policy(SET CMP0079 NEW)
1414
# 'axlstar_generate_from_axl'
1515
function(generateAxl target)
1616

17-
set(options INSTALL_GENERATED_FILES NO_COPY NO_ARCANE NO_MESH)
18-
set(oneValueArgs AXL_OPTION_GENERATION_MODE NAMESPACE)
17+
set(options INSTALL_GENERATED_FILES NO_COPY NO_ARCANE NO_MESH USER_INSTALL_PREFIX)
18+
set(oneValueArgs AXL_OPTION_GENERATION_MODE NAMESPACE )
1919
set(multiValueArgs)
2020

2121
cmake_parse_arguments(ARGS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
2222

23-
set(axl_path ${CMAKE_BINARY_DIR}/${PROJECT_NAME}/axl)
23+
if (ARGS_USER_INSTALL_PREFIX)
24+
set(axl_path ${CMAKE_BINARY_DIR}/${ARGS_USER_INSTALL_PREFIX}/axl)
25+
else ()
26+
set(axl_path ${CMAKE_BINARY_DIR}/${PROJECT_NAME}/axl)
27+
endif ()
2428

2529
if(NOT EXISTS ${axl_path})
2630
file(MAKE_DIRECTORY ${axl_path})
@@ -134,7 +138,11 @@ function(generateAxl target)
134138
set_property(GLOBAL APPEND PROPERTY AXL_DB ${file})
135139

136140
if(ARGS_INSTALL_GENERATED_FILES)
137-
install(FILES ${generated_files} DESTINATION include/${PROJECT_NAME}/axl)
141+
if (ARGS_USER_INSTALL_PREFIX)
142+
install(FILES ${generated_files} DESTINATION include/${ARGS_USER_INSTALL_PREFIX}/axl)
143+
else ()
144+
install(FILES ${generated_files} DESTINATION include/${PROJECT_NAME}/axl)
145+
endif ()
138146
endif()
139147

140148
endforeach()

0 commit comments

Comments
 (0)