Skip to content

Commit

Permalink
CMake: added MESHOPT_ prefix for CMake options (zeux#90)
Browse files Browse the repository at this point in the history
  • Loading branch information
corporateshark committed Dec 20, 2019
1 parent 7a2a3ad commit 1676f27
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ endif()

project(meshoptimizer VERSION 0.13 LANGUAGES CXX)

option(BUILD_DEMO "Build demo" OFF)
option(BUILD_TOOLS "Build tools" OFF)
option(BUILD_SHARED_LIBS "Build shared libraries" OFF)
option(MESHOPT_BUILD_DEMO "Build demo" OFF)
option(MESHOPT_BUILD_TOOLS "Build tools" OFF)
option(MESHOPT_BUILD_SHARED_LIBS "Build shared libraries" OFF)

set(SOURCES
src/meshoptimizer.h
Expand Down Expand Up @@ -38,7 +38,7 @@ endif()
add_library(meshoptimizer ${SOURCES})
target_include_directories(meshoptimizer INTERFACE "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>")

if(BUILD_SHARED_LIBS)
if(MESHOPT_BUILD_SHARED_LIBS)
set_target_properties(meshoptimizer PROPERTIES CXX_VISIBILITY_PRESET hidden)
set_target_properties(meshoptimizer PROPERTIES VISIBILITY_INLINES_HIDDEN ON)

Expand All @@ -52,17 +52,17 @@ endif()

set(TARGETS meshoptimizer)

if(BUILD_DEMO)
if(MESHOPT_BUILD_DEMO)
add_executable(demo demo/main.cpp demo/miniz.cpp demo/tests.cpp tools/meshloader.cpp)
target_link_libraries(demo meshoptimizer)
endif()

if(BUILD_TOOLS)
if(MESHOPT_BUILD_TOOLS)
add_executable(gltfpack tools/gltfpack.cpp tools/meshloader.cpp tools/basistoktx.cpp)
target_link_libraries(gltfpack meshoptimizer)
list(APPEND TARGETS gltfpack)

if(BUILD_SHARED_LIBS)
if(MESHOPT_BUILD_SHARED_LIBS)
string(CONCAT RPATH "$ORIGIN/../" ${CMAKE_INSTALL_LIBDIR})
set_target_properties(gltfpack PROPERTIES INSTALL_RPATH ${RPATH})
endif()
Expand Down

0 comments on commit 1676f27

Please sign in to comment.