Skip to content

Commit

Permalink
refactor(cmake): always create env
Browse files Browse the repository at this point in the history
  • Loading branch information
Curve committed Jun 9, 2024
1 parent 0a41a34 commit f558e8c
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,18 +101,18 @@ CPMAddPackage(

CPMAddPackage(
NAME PackageProject
VERSION 1.11.1
VERSION 1.11.2
GIT_REPOSITORY "https://github.com/TheLartians/PackageProject.cmake")

CPMFindPackage(
NAME ViennaRay
VERSION 2.1.0
GIT_TAG vienna-core # TOOD: Create Tag
GIT_REPOSITORY "https://github.com/ViennaTools/ViennaRay"
EXCLUDE_FROM_ALL ${VIENNAPS_BUILD_PYTHON})

CPMFindPackage(
NAME ViennaLS
VERSION 3.1.0
VERSION 3.1.2
GIT_REPOSITORY "https://github.com/ViennaTools/ViennaLS"
EXCLUDE_FROM_ALL ${VIENNAPS_BUILD_PYTHON})

Expand Down
4 changes: 3 additions & 1 deletion examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ add_custom_target(ViennaPS_Examples ALL)

if(WIN32)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY $<1:${PROJECT_BINARY_DIR}/examples>)
setup_vtk_env(ViennaPS_Tests ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
setup_embree_env(ViennaPS_Examples ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
setup_vtk_env(ViennaPS_Examples ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
setup_tbb_env(ViennaPS_Examples ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
endif()

viennacore_add_subdirs(${CMAKE_CURRENT_LIST_DIR})
12 changes: 6 additions & 6 deletions python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,13 @@ target_compile_definitions(viennaps3d PRIVATE -DVIENNAPS_PYTHON_DIMENSION=3

set(VIENNAPS_LIB_FOLDER "${VIENNAPS_LIBRARY_OUTPUT_DIR}/viennaps.libs")

if(NOT VIENNAPS_PACKAGE_PYTHON)
return()
endif()

# Not required for both targets, one will suffice

setup_embree_env(viennaps2d "${VIENNAPS_LIB_FOLDER}")
setup_tbb_env(viennaps2d "${VIENNAPS_LIB_FOLDER}")
setup_vtk_env(viennaps2d "${VIENNAPS_LIB_FOLDER}")
setup_tbb_env(viennaps2d "${VIENNAPS_LIB_FOLDER}")

install(DIRECTORY "${VIENNAPS_LIB_FOLDER}" DESTINATION .)
install(
DIRECTORY "${VIENNAPS_LIB_FOLDER}"
DESTINATION .
OPTIONAL)
2 changes: 2 additions & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ add_custom_target(ViennaPS_Tests ALL)

if(WIN32)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY $<1:${PROJECT_BINARY_DIR}/tests>)
setup_embree_env(ViennaPS_Tests ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
setup_vtk_env(ViennaPS_Tests ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
setup_tbb_env(ViennaPS_Tests ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
endif()

viennacore_add_subdirs(${CMAKE_CURRENT_LIST_DIR})

0 comments on commit f558e8c

Please sign in to comment.