source: subversion/applications/utils/perl_lib/CMakeLists.txt @ 29705

Last change on this file since 29705 was 9444, checked in by andreas, 11 years ago

allow manually setting PERL_SITELIB

File size: 887 bytes
Line 
1project(perl_lib)
2
3if (WITH_SCRIPTS)
4
5  MACRO_OPTIONAL_FIND_PACKAGE(Perl)
6
7  if (PERL_FOUND)
8    if (NOT PERL_SITELIB)       
9        MACRO_OPTIONAL_FIND_PACKAGE(PerlLibs)
10    endif (NOT PERL_SITELIB)       
11    #MESSAGE("DEBUG: > PERL_SITELIB: ${PERL_SITELIB}")
12
13    file(GLOB_RECURSE perl_modules ${CMAKE_CURRENT_SOURCE_DIR}/*.pm)
14
15      if (perl_modules)
16        foreach(perl_module ${perl_modules})
17          file(RELATIVE_PATH relative_module_path ${CMAKE_CURRENT_SOURCE_DIR} ${perl_module})
18          get_filename_component(relative_module_path ${relative_module_path} PATH)
19          install(FILES ${perl_module} DESTINATION ${PERL_SITELIB}/${relative_module_path})
20          #message("DEBUG: install ${perl_module} to ${PERL_SITELIB}/${relative_module_path}")
21        endforeach(perl_module ${perl_modules})
22      endif (perl_modules)
23  endif (PERL_FOUND)
24endif (WITH_SCRIPTS)
25
Note: See TracBrowser for help on using the repository browser.