Commit aef0ecb4 authored by Martin Heistermann's avatar Martin Heistermann

cmake: allow choice of cxx version

parent 49766ee0
......@@ -22,6 +22,10 @@ set(OVM_ENABLE_UNITTESTS ${OVM_STANDALONE_BUILD} CACHE BOOL "Build OpenVolumeMes
set(OVM_ENABLE_EXAMPLES ${OVM_STANDALONE_BUILD} CACHE BOOL "Build OpenVolumeMesh examples in 'all' target")
set(OVM_BUILD_DOCUMENTATION ${OVM_STANDALONE_BUILD} CACHE BOOL "Build OpenVolumeMesh documentation in 'all' target")
set(OVM_CXX_VERSION 14 CACHE STRING "C++ version to use")
set_property(CACHE OVM_CXX_VERSION PROPERTY STRINGS 14 17 20)
if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
if (WIN32)
set (ACG_PROJECT_LIBDIR "lib")
......
......@@ -9,10 +9,11 @@ add_executable(simple_mesh simple_mesh/simple_mesh.cc)
target_link_libraries(simple_mesh OpenVolumeMesh::OpenVolumeMesh)
set_target_properties(simple_mesh PROPERTIES
CXX_STANDARD 14
set_target_properties (simple_mesh PROPERTIES
CXX_STANDARD ${OVM_CXX_VERSION}
CXX_STANDARD_REQUIRED YES
CXX_EXTENSIONS NO)
CXX_EXTENSIONS NO
)
#[[=
if(WIN32)
......
......@@ -111,7 +111,7 @@ generate_export_header(OpenVolumeMesh
set_target_properties (OpenVolumeMesh PROPERTIES
VERSION ${OpenVolumeMesh_VERSION_MAJOR}.${OpenVolumeMesh_VERSION_MINOR}
SOVERSION ${OpenVolumeMesh_VERSION_MAJOR}.${OpenVolumeMesh_VERSION_MINOR}
CXX_STANDARD 14
CXX_STANDARD ${OVM_CXX_VERSION}
CXX_STANDARD_REQUIRED YES
CXX_EXTENSIONS NO
CXX_VISIBILITY_PRESET hidden
......
......@@ -11,21 +11,15 @@ if(Boost_FOUND)
# Add target for first example
add_executable(file_converter EXCLUDE_FROM_ALL ovm_converter.cc)
add_dependencies(file_converter OpenVolumeMesh)
if(NOT WIN32)
# Link against all necessary libraries
set_target_properties (file_converter PROPERTIES
CXX_STANDARD ${OVM_CXX_VERSION}
CXX_STANDARD_REQUIRED YES
CXX_EXTENSIONS NO
)
target_link_libraries(file_converter OpenVolumeMesh)
# Set output directory to ${BINARY_DIR}/FileConverter
if(NOT WIN32)
set_target_properties(file_converter PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/FileConverter)
else()
# Link against all necessary libraries
target_link_libraries(file_converter OpenVolumeMesh)
endif()
else()
......
......@@ -31,7 +31,12 @@ if(GTEST_FOUND)
DESTINATION "${CMAKE_BINARY_DIR}/Unittests"
)
set_target_properties(unittests PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/Unittests)
set_target_properties(unittests PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/Unittests
CXX_STANDARD ${OVM_CXX_VERSION}
CXX_STANDARD_REQUIRED YES
CXX_EXTENSIONS NO
)
#[[=
if ( WIN32 )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment