Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FindHPX.cmake problems #487

Closed
maciekab opened this issue Aug 8, 2012 · 3 comments

Comments

Projects
None yet
3 participants
@maciekab
Copy link
Member

commented Aug 8, 2012

When building external applications, the behavior of installed FindHPX.cmake is inconsistent with the HPX documentation:

  1. After configuration using cmake script from the documentation, the compilation gets aborted due to inability to find HPX headers. Adding include_directories(${HPX_INCLUDE_DIR}) to cmake script fixes the issue, but the correct setup of include paths is supposed to be done automatically by add_hpx_executable().
  2. Linking breaks due to missing library search path(s). Again, adding link_directories(${HPX_LIBRARY_DIR}) fixes it, but it really should be done by add_hpx_executable().
  3. It seems that libhpx_component_iostreams.so gets installed by default, yet it is not added to the list of default libraries to link with.

@ghost ghost assigned brycelelbach Aug 8, 2012

@hkaiser

This comment has been minimized.

Copy link
Member

commented Aug 9, 2012

Here is an example CMake file (send by Maciej) showing a corrected version for hello_world

project(hello_world)
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)

set(HPX_INSTALL_DIR "/home/maciek/packages/hpx")
set(CMAKE_MODULE_PATH 
    ${CMAKE_MODULE_PATH} 
    ${HPX_INSTALL_DIR}/share/cmake-${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}/Modules)

find_package(HPX)

if(HPX_FOUND)
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DHPX_ENABLED")
  include_directories(${HPX_INCLUDE_DIR})
  link_directories(${HPX_LIBRARY_DIR})
  add_hpx_executable(hello_world ESSENTIAL SOURCES hello_world.cpp COMPONENT_DEPENDENCIES iostreams)
else()
  message(FATAL_ERROR "could not find HPX")
endif()
@brycelelbach

This comment has been minimized.

Copy link
Member

commented Aug 9, 2012

3.) doesn't make any sense. If you want to use a component, you must link against it.

@brycelelbach

This comment has been minimized.

Copy link
Member

commented Aug 20, 2012

The need for include_directories and link_directories has been documented as of 869e130. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.