Skip to content

Commit

Permalink
Revert aa1f10f, which breaks internal OpenMP search; update add_hpx_c…
Browse files Browse the repository at this point in the history
…onfig_test so

that it works properly for external CMake projects. Test-cased against trunk and the
external CMake example repo.
  • Loading branch information
brycelelbach committed May 30, 2014
1 parent f943fcc commit 51f22ed
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
7 changes: 1 addition & 6 deletions cmake/FindHPX_OpenMP.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,11 @@ else()

hpx_include(AddConfigTest)

set(cmake_root ${CMAKE_SOURCE_DIR})
if(HPX_EXTERNAL_CMAKE)
set(cmake_root ${HPX_ROOT})
endif()

foreach(flag_candidate ${flag_candidates})
hpx_info("find_package.openmp" "Trying flag ${flag_candidate}.")

add_hpx_config_test("openmp" OPENMP_FOUND LANGUAGE CXX
SOURCE ${cmake_root}/cmake/tests/openmp.cpp
SOURCE cmake/tests/openmp.cpp
FLAGS ${flag_candidate} FILE)

if(OPENMP_FOUND)
Expand Down
7 changes: 6 additions & 1 deletion cmake/HPX_AddConfigTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@ macro(add_hpx_config_test name variable)
if(${name}_ROOT)
set(test_source "${${name}_ROOT}/share/hpx-${HPX_VERSION}/${${name}_SOURCE}")
else()
set(test_source "${hpx_SOURCE_DIR}/${${name}_SOURCE}")
set(cmake_root ${hpx_SOURCE_DIR})
if(HPX_EXTERNAL_CMAKE)
set(unresolved_root ${HPX_ROOT}/share/hpx)
get_filename_component(cmake_root ${unresolved_root} REALPATH)
endif()
set(test_source "${cmake_root}/${${name}_SOURCE}")
endif()
else()
set(test_source
Expand Down

1 comment on commit 51f22ed

@hkaiser
Copy link
Member

Choose a reason for hiding this comment

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

Would it be possible to add a test case which can be run with our daily tests?

Please sign in to comment.