[CMake] creating symlinks on install

Michael Surette mjsurette at gmail.com
Tue Apr 20 10:26:01 EDT 2010


I am using CMake 2.8.1 and have the following in my main CMakeLists.txt

---

install(DIRECTORY ${FLTK_SOURCE_DIR}/FL
    DESTINATION ${PREFIX_INCLUDE} USE_SOURCE_PERMISSIONS
    PATTERN ".svn" EXCLUDE
    )

if(CMAKE_HOST_UNIX)
    install(SCRIPT ${FLTK_SOURCE_DIR}/CMake/install-symlinks.cmake)
endif(CMAKE_HOST_UNIX)

---

The contents of ${FLTK_SOURCE_DIR}/CMake/install-symlinks.cmake are:

---

if(NOT EXISTS ${PREFIX_INCLUDE}/Fl)
    EXECUTE_PROCESS(COMMAND ln -s FL Fl
       WORKING_DIRECTORY ${PREFIX_INCLUDE}
       )
endif(NOT EXISTS ${PREFIX_INCLUDE}/Fl)

---

When I run this, I get the following error

---

CMake Error at 
/home/msurette/work/fltk-1.3/CMake/install-symlinks.cmake:4 
(EXECUTE_PROCESS):
   execute_process called with no value for WORKING_DIRECTORY.

---

which tells me that ${PREFIX_INCLUDE} which is a cache variable, is not 
available to the script.

What can I do to fix this?  Alternatively, is there a better way to 
create symlinks on install?

Mike



More information about the CMake mailing list