Skip to content

Commit

Permalink
simplification
Browse files Browse the repository at this point in the history
  • Loading branch information
pca006132 committed Oct 4, 2024
1 parent 0848166 commit 544bfa7
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 34 deletions.
58 changes: 32 additions & 26 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,11 @@ if(MANIFOLD_PAR)
list(APPEND MANIFOLD_LIBS ${TBB_LINK_LIBRARIES})
endif()
endif()
if(MANIFOLD_EXPORT)
list(APPEND MANIFOLD_LIBS assimp::assimp)
endif()

#Include directories
# Include directories
set(MANIFOLD_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/include)
if(TBB_INCLUDE_DIRS)
list(APPEND MANIFOLD_INCLUDE_DIRS ${TBB_INCLUDE_DIRS})
Expand All @@ -102,36 +105,39 @@ target_include_directories(
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>
PRIVATE ${MANIFOLD_INCLUDE_DIRS}
)
if(MANIFOLD_EXCEPTIONS)
target_compile_options(manifold PRIVATE -DMANIFOLD_EXCEPTIONS=1)
endif()
if(MANIFOLD_DEBUG)
target_compile_options(manifold PRIVATE -DMANIFOLD_DEBUG)
endif()
if(MANIFOLD_EXPORT)
target_link_libraries(manifold PRIVATE assimp::assimp)
target_compile_options(manifold PUBLIC -DMANIFOLD_EXPORT)
endif()

set(OPTIONS
MANIFOLD_EXCEPTIONS
MANIFOLD_DEBUG
MANIFOLD_CROSS_SECTION
MANIFOLD_EXPORT
MANIFOLD_PAR)
foreach(OPT IN LISTS OPTIONS)
if(${${OPT}})
target_compile_options(manifold PUBLIC -D${OPT})
endif()
endforeach()
target_compile_features(manifold PUBLIC cxx_std_17)
if(MANIFOLD_PAR)
target_compile_options(manifold PUBLIC -DMANIFOLD_PAR)
endif()

install(TARGETS manifold EXPORT manifoldTargets)

# Tracy Support
if(MANIFOLD_DOWNLOADS)
include(FetchContent)
if(TRACY_ENABLE)
include(FetchContent)
FetchContent_Declare(
tracy
GIT_REPOSITORY https://github.com/wolfpld/tracy.git
GIT_TAG v0.10
GIT_SHALLOW TRUE
GIT_PROGRESS TRUE
if(TRACY_ENABLE)
if(NOT MANIFOLD_DOWNLOADS)
message(
WARNING
"Downloading is disabled, but tracy requires download - skipping.\n"
)
FetchContent_MakeAvailable(tracy)
target_link_libraries(manifold INTERFACE TracyClient)
return()
endif()
include(FetchContent)
FetchContent_Declare(
tracy
GIT_REPOSITORY https://github.com/wolfpld/tracy.git
GIT_TAG v0.10
GIT_SHALLOW TRUE
GIT_PROGRESS TRUE
)
FetchContent_MakeAvailable(tracy)
target_link_libraries(manifold INTERFACE TracyClient)
endif()
8 changes: 0 additions & 8 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,6 @@ if(MANIFOLD_CBIND AND NOT EMSCRIPTEN)
target_link_libraries(manifold_test manifoldc)
endif()

if(MANIFOLD_CROSS_SECTION)
target_compile_options(manifold_test PUBLIC -DMANIFOLD_CROSS_SECTION)
endif()

if(MANIFOLD_EXPORT)
target_compile_options(manifold_test PUBLIC -DMANIFOLD_EXPORT)
endif()

target_compile_options(manifold_test PRIVATE ${MANIFOLD_FLAGS})
target_compile_features(manifold_test PUBLIC cxx_std_17)

Expand Down

0 comments on commit 544bfa7

Please sign in to comment.