Skip to content

Commit

Permalink
Fixed #1011: After installation, running applications from the build/…
Browse files Browse the repository at this point in the history
…staging directory no longer works
  • Loading branch information
Thomas Heller committed Feb 13, 2014
1 parent 545f341 commit 4801d67
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions CMakeLists.txt
Expand Up @@ -426,15 +426,18 @@ endif()
# ${CMAKE_BINARY_DIR}/$(Configuration) when using Visual Studio
if("${HPX_PLATFORM}" STREQUAL "Android")
set(HPX_PREFIX "lib" CACHE PATH "Where the hpx applications look for component dlls" FORCE)
elseif(HPX_NO_INSTALL)
else()
if(MSVC)
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}" CACHE PATH "Prefix prepended to install directories." FORCE)
set(HPX_PREFIX "${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}" CACHE PATH "Where the hpx applications look for component dlls" FORCE)
set(HPX_BUILD_PREFIX "${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}" CACHE PATH "Where the hpx applications look for component dlls" FORCE)
else()
set(HPX_PREFIX "${CMAKE_BINARY_DIR}" CACHE PATH "Where the HPX applications look for component dlls" FORCE)
set(HPX_BUILD_PREFIX "${CMAKE_BINARY_DIR}" CACHE PATH "Where the HPX applications look for component dlls" FORCE)
endif()
set(HPX_PREFIX "${HPX_BUILD_PREFIX}:${CMAKE_INSTALL_PREFIX}" CACHE PATH "Where the HPX applications look for component dlls" FORCE)
endif()
if(HPX_NO_INSTALL)
if(MSVC)
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/${CMAKE_BUILD_TYPE}" CACHE PATH "Prefix prepended to install directories." FORCE)
endif()
else()
set(HPX_PREFIX "${CMAKE_INSTALL_PREFIX}" CACHE PATH "Where the HPX applications look for component dlls" FORCE)
endif()

hpx_add_config_define(HPX_PREFIX "\"${HPX_PREFIX}\"")
Expand Down

4 comments on commit 4801d67

@hkaiser
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand this change. HPX_PREFIX is supposed to point to a single directory where the library is going to be installed. This is used to be compiled into the binary as a last resort fallback if the library is not able to find itself at runtime. Changing this to a list of directories will certainly break that functionality.

Moreover, HPX_PREFIX is used in other places of the CMakeLists.txt to refer to a particular directory, which will be broken as well.

Furthermore, on Windows the default delimiter between directories used is usually a semicolon (';'), not a colon (':').

How does this patch fix the original ticket anyways? Where is the list of directories examined in order to search for the installation?

@gentryx
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interestingly HPX_PREFIX as a list works for me, it's just the delimiter that was wrong (its a semicolon on Linux, too).

@sithhell
Copy link
Member

@sithhell sithhell commented on 4801d67 Feb 19, 2014 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@brycelelbach
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, IIUC, now HPX_PREFIX contains the build and install directory?

And now the build directory will be searched first?

If that is the case, can we please make that functionality optional/add a way to disable it?

Please sign in to comment.