Skip to content

Commit

Permalink
Merge pull request #358 from aaronenyeshi/clang_tot_upgrade
Browse files Browse the repository at this point in the history
HCC RT Header needs to trigger re-build
  • Loading branch information
whchung committed Jun 15, 2017
2 parents 1f25f79 + 3c86177 commit fb80207
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 31 deletions.
50 changes: 36 additions & 14 deletions include/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,20 +1,42 @@
#install commands for headers
FILE(GLOB files ${CMAKE_CURRENT_SOURCE_DIR}/*.h*)
INSTALL(FILES ${files} DESTINATION include)
# Copy the file to directory matching the install directory
file(COPY ${files} DESTINATION "${PROJECT_BINARY_DIR}/include")

FILE(GLOB files ${CMAKE_CURRENT_SOURCE_DIR}/*.inl)
INSTALL(FILES ${files} DESTINATION include)
# Copy the file to directory matching the install directory
file(COPY ${files} DESTINATION "${PROJECT_BINARY_DIR}/include")

# Put all hcc headers into the hcc-headers target
# .h and .hpp headers
FILE(GLOB H_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/*.h*)
# .inl headers
FILE(GLOB INL_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/*.inl)
# N4494 headers
FILE(GLOB N4494 ${CMAKE_CURRENT_SOURCE_DIR}/coordinate
${CMAKE_CURRENT_SOURCE_DIR}/array_view)
INSTALL(FILES ${N4494} DESTINATION include)
# Copy the file to directory matching the install directory
file(COPY ${N4494} DESTINATION "${PROJECT_BINARY_DIR}/include")


set(HCC_HEADERS)
#Obtain the names of each Header File
foreach(InFName ${H_HEADERS} ${INL_HEADERS} ${N4494})
STRING(REGEX REPLACE ${CMAKE_CURRENT_SOURCE_DIR}/ "" OutFName ${InFName})
set(HCC_HEADERS ${HCC_HEADERS} "${OutFName}")
endforeach(InFName)


# Set location for output directory
set(output_dir "${PROJECT_BINARY_DIR}/include")
set(out_files)
foreach( f ${HCC_HEADERS} )
set( src ${CMAKE_CURRENT_SOURCE_DIR}/${f} )
set( dst ${output_dir}/${f} )
add_custom_command(OUTPUT ${dst}
DEPENDS ${src}
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst}
COMMENT "Copying HCC's ${f}...")
list(APPEND out_files ${dst})
endforeach( f )

# Create target for hcc-headers and set dependencies
add_custom_target(hcc-headers ALL DEPENDS ${out_files})
add_dependencies(world hcc-headers)

# Install command for headers
install(FILES ${HCC_HEADERS}
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
DESTINATION include)

# PSTL headers
ADD_SUBDIRECTORY(experimental)
72 changes: 61 additions & 11 deletions include/experimental/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,61 @@
# PSTL headers
FILE(GLOB PSTL ${CMAKE_CURRENT_SOURCE_DIR}/algorithm
${CMAKE_CURRENT_SOURCE_DIR}/exception_list
${CMAKE_CURRENT_SOURCE_DIR}/execution_policy
${CMAKE_CURRENT_SOURCE_DIR}/numeric)
INSTALL(FILES ${PSTL} DESTINATION include/experimental)
# Copy the file to directory matching the install directory
file(COPY ${PSTL} DESTINATION "${PROJECT_BINARY_DIR}/include/experimental")

# PSTL internal headers
ADD_SUBDIRECTORY(impl)
# Here we have PSTL header files inside experimental directory and impl sub-directory.
# All PSTL headers should be in the same pstl-headers target, but different output dir

# PSTL headers from experimental/
set(PSTL_EXP_HEADERS
algorithm
exception_list
execution_policy
numeric)

# PSTL headers from experimental/impl/
FILE(GLOB PSTL_IMPL ${CMAKE_CURRENT_SOURCE_DIR}/impl/*.inl)

# Obtain the names of each impl header and add to PSTL
foreach(InFName ${PSTL_IMPL})
STRING(REGEX REPLACE ${CMAKE_CURRENT_SOURCE_DIR}/ "" OutFName ${InFName})
set(PSTL_IMPL_HEADERS ${PSTL_IMPL_HEADERS} "${OutFName}")
endforeach(InFName)

# Set location for exp/ output directory
set(exp_output_dir "${PROJECT_BINARY_DIR}/include/experimental")
# Set location for exp/impl/ output directory
set(impl_output_dir "${PROJECT_BINARY_DIR}/include/experimental/impl")

set(exp_out_files)
set(impl_out_files)

foreach( f ${PSTL_EXP_HEADERS} )
set( src ${CMAKE_CURRENT_SOURCE_DIR}/${f} )
set( dst ${exp_output_dir}/${f} )
add_custom_command(OUTPUT ${dst}
DEPENDS ${src}
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst}
COMMENT "Copying HCC's ${f}...")
list(APPEND exp_out_files ${dst})
endforeach( f )

foreach( f ${PSTL_IMPL_HEADERS} )
set( src ${CMAKE_CURRENT_SOURCE_DIR}/${f} )
set( dst ${impl_output_dir}/${f} )
add_custom_command(OUTPUT ${dst}
DEPENDS ${src}
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst}
COMMENT "Copying HCC's ${f}...")
list(APPEND impl_out_files ${dst})
endforeach( f )

# Create target for pstl-headers and set dependencies
add_custom_target(pstl-headers ALL DEPENDS ${exp_out_files} ${impl_out_files})
add_dependencies(world pstl-headers)

# Install command for PSTL exp headers
install(FILES ${PSTL_EXP_HEADERS}
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
DESTINATION include/experimental)

# Install command for PSTL impl headers
install(FILES ${PSTL_IMPL_HEADERS}
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
DESTINATION include/experimental/impl)

6 changes: 0 additions & 6 deletions include/experimental/impl/CMakeLists.txt

This file was deleted.

0 comments on commit fb80207

Please sign in to comment.