Skip to content

Commit

Permalink
Merge pull request #3 from UniStuttgart-VISUS/dev
Browse files Browse the repository at this point in the history
Structural changes
  • Loading branch information
moritz-h authored Feb 11, 2020
2 parents 87f8aab + 733fa57 commit d263186
Show file tree
Hide file tree
Showing 150 changed files with 13 additions and 27 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
build*/
cmake-build-*/
.idea/
.vscode/
31 changes: 9 additions & 22 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,51 +19,38 @@ cmake_minimum_required(VERSION 3.2 FATAL_ERROR)
# Create project/solution
project("tpf")

file(STRINGS "version" tpf_version LIMIT_COUNT 1)
message(STATUS "TPF is at version ${tpf_version}")

string(FIND "${tpf_version}" "\." delimiter)
math(EXPR delimiter_plus_one "${delimiter} + 1")

string(SUBSTRING "${tpf_version}" 0 ${delimiter} tpf_version_major)
string(SUBSTRING "${tpf_version}" ${delimiter_plus_one} -1 tpf_version_minor)

# Create header-only target for installation
add_library(tpf INTERFACE)

target_include_directories(tpf INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)

install(TARGETS tpf EXPORT tpf-export)

# Copy include directory
install(DIRECTORY "" DESTINATION include/tpf
install(DIRECTORY include/ DESTINATION include
PATTERN "*.txt" EXCLUDE
PATTERN "*.in" EXCLUDE
PATTERN "*.md" EXCLUDE
PATTERN ".git" EXCLUDE
PATTERN "version" EXCLUDE)
PATTERN "*.md" EXCLUDE)

# Create config file for including tpf in other projects
configure_file(config.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/config.cmake @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/config.cmake DESTINATION share/tpf/cmake RENAME tpf-config.cmake)

# Copy markdown readme files into documentation folder
file(GLOB_RECURSE md_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.md)
file(GLOB_RECURSE md_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/include/tpf/*.md)

foreach(md_file ${md_files})
get_filename_component(md_file_path ${md_file} DIRECTORY)

if(md_file_path)
string(REGEX REPLACE "[/\\]" "_" md_file_name "${md_file_path}")
string(REPLACE "include/tpf/" "" md_file_path "${md_file_path}")
string(REGEX REPLACE "[/\\]" "_" md_file_name "${md_file_path}")

install(FILES ${md_file} DESTINATION share/tpf/doc RENAME tpf_${md_file_name}.md)
else()
install(FILES ${md_file} DESTINATION share/tpf/doc RENAME tpf.md)
endif()
install(FILES ${md_file} DESTINATION share/tpf/doc RENAME tpf_${md_file_name}.md)
endforeach()

install(FILES "readme.md" DESTINATION share/tpf/doc RENAME tpf.md)

# Export project
install(EXPORT tpf-export DESTINATION share/tpf/cmake)
export(TARGETS tpf FILE tpf-export.cmake)
Expand Down
4 changes: 0 additions & 4 deletions config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,3 @@ set_target_properties(tpf PROPERTIES
INTERFACE_COMPILE_DEFINITIONS "${optional_compile_definitions}"
INTERFACE_LINK_LIBRARIES "Eigen3::Eigen;CGAL::CGAL;${optional_link_libraries}"
)

set(tpf_version "@tpf_version@")
set(tpf_version_major "@tpf_version_major@")
set(tpf_version_minor "@tpf_version_minor@")
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion version

This file was deleted.

0 comments on commit d263186

Please sign in to comment.