Skip to content

Commit

Permalink
generate version.h for emscripten build (#1055)
Browse files Browse the repository at this point in the history
* generate version.h for emscripten build

* fix

* typo
  • Loading branch information
pca006132 authored Nov 18, 2024
1 parent 182adae commit 125dbd4
Showing 1 changed file with 18 additions and 17 deletions.
35 changes: 18 additions & 17 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,19 @@ add_subdirectory(extras)

include(${PROJECT_SOURCE_DIR}/cmake/info.cmake)

# note that the path ${CMAKE_CURRENT_BINARY_DIR}/include is included when we
# build the manifold target (as ${PROJECT_SOURCE_DIR}/include), so users can
# include manifold/version.h without installing our library.
configure_file(
cmake/version.h.in
${CMAKE_CURRENT_BINARY_DIR}/include/manifold/version.h
@ONLY
)
set_source_files_properties(
${CMAKE_CURRENT_BINARY_DIR}/include/manifold/version.h
PROPERTIES GENERATED TRUE
)

# If it's an EMSCRIPTEN build, we're done
if(EMSCRIPTEN)
return()
Expand Down Expand Up @@ -265,26 +278,14 @@ set(
$<$<BOOL:${MANIFOLD_EXPORT}>:meshIO.h>
)
list(TRANSFORM MANIFOLD_PUBLIC_HDRS PREPEND include/manifold/)

install(
FILES ${MANIFOLD_PUBLIC_HDRS}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/manifold
)

# note that the path ${CMAKE_CURRENT_BINARY_DIR}/include is included when we
# build the manifold target (as ${PROJECT_SOURCE_DIR}/include), so users can
# include manifold/version.h without installing our library.
configure_file(
cmake/version.h.in
${CMAKE_CURRENT_BINARY_DIR}/include/manifold/version.h
@ONLY
)
set_source_files_properties(
list(
APPEND
MANIFOLD_PUBLIC_HDRS
${CMAKE_CURRENT_BINARY_DIR}/include/manifold/version.h
PROPERTIES GENERATED TRUE
)

install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/include/manifold/version.h
FILES ${MANIFOLD_PUBLIC_HDRS}
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/manifold
)

Expand Down

0 comments on commit 125dbd4

Please sign in to comment.