Skip to content

Commit d13c360

Browse files
committed
Fix module installation with IDEs
1 parent c1b75b0 commit d13c360

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

CMakeLists.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,14 @@ install ( TARGETS ${LIB_NAME} ${LIB_NAME}-static
386386
# Code to fix the dylib install name on Mac.
387387
include ( cmake/fixupInstallNameDir.cmake )
388388

389-
install ( DIRECTORY "${MODULE_DIR}/" DESTINATION "${INSTALL_MOD_DIR}" )
389+
set(MOD_DIR_TO_INSTALL "${MODULE_DIR}")
390+
set(MOD_DESTINATION_DIR "${INSTALL_MOD_DIR}")
391+
install(
392+
CODE "file(GLOB_RECURSE MODULE_FILES \"${MOD_DIR_TO_INSTALL}/*.mod\")"
393+
CODE "file(GLOB_RECURSE SUBMOD_FILES \"${MOD_DIR_TO_INSTALL}/*.smod\")"
394+
CODE "file(INSTALL \${MODULE_FILES} DESTINATION \"\${CMAKE_INSTALL_PREFIX}/${MOD_DESTINATION_DIR}\")"
395+
CODE "file(INSTALL \${SUBMOD_FILES} DESTINATION \"\${CMAKE_INSTALL_PREFIX}/${MOD_DESTINATION_DIR}\")"
396+
)
390397

391398
#------------------------------------------
392399
# Add portable unistall command to makefile

0 commit comments

Comments
 (0)