[CMake] Fwd: CMAKE_INSTALL_PREFIX
John Drescher
drescherjm at gmail.com
Wed Mar 18 15:50:47 EDT 2009
---------- Forwarded message ----------
Please remember to send this to the cmake list as well. There are
experts who should be better help than me..
On Wed, Mar 18, 2009 at 2:35 PM, George Neill <georgen at neillnet.com> wrote:
> All,
>
> On Wed, Mar 18, 2009 at 1:20 PM, John Drescher <drescherjm at gmail.com> wrote:
>>> It seems the following works (at least the cmake_install.cmake
>>> commands appear to get generated appropriately).
>>>
>>> FILE(TO_CMAKE_PATH "${CMAKE_INSTALL_PREFIX}" CMAKE_INSTALL_PREFIX)
>>>
>>> Is there a CMPxxxx policy which deals with this which I have missed?
>>>
>> Sorry I don't know.
>
> No problem.
>
> Well to shed some further light on it, it is not CMAKE_INSTALL_PREFIX
> which is causing me grief. I wrote a simple CMakeLists.txt and it
> appears that there's some magic happening on CMAKE_INSTALL_PREFIX
> variable. Even though I pass in c:\some\path, it still becomes
> c:/some/path.
>
> So looking further, I have a third party library path which is also
> passed in on the command line (where this munged path is coming from).
>
> running my sample project, like this,
Here's my sample project,
C:\Users\gneill\Desktop\test\build>cat ..\CMakeLists.txt
CMAKE_MINIMUM_REQUIRED(VERSION 2.4 FATAL_ERROR)
IF(COMMAND cmake_policy)
CMAKE_POLICY(SET CMP0002 OLD) # duplicate target names
CMAKE_POLICY(SET CMP0003 OLD) # bare lib linker searches
CMAKE_POLICY(SET CMP0005 OLD) # escaping on macros
# CMAKE_POLICY(SET CMP0010 OLD)
ENDIF(COMMAND cmake_policy)
SET(INSTALL_BIN_DIR "bin")
SET(INSTALL_LIB_DIR "lib")
SET(INSTALL_MAN_DIR "man/doc")
ADD_EXECUTABLE(test test.c)
INSTALL(TARGETS test
RUNTIME DESTINATION "${INSTALL_BIN_DIR}"
LIBRARY DESTINATION "${INSTALL_LIB_DIR}"
ARCHIVE DESTINATION "${INSTALL_LIB_DIR}"
)
FILE(GLOB CFILES "${THIRD_PARTY_PATH}/doc/*.txt")
INSTALL(FILES ${CFILES} DESTINATION "${INSTALL_MAN_DIR}")
Later,
George.
--
John M. Drescher
More information about the CMake
mailing list