gmio/benchs/CMakeLists.txt
2015-03-30 16:38:42 +02:00

80 lines
2.7 KiB
CMake

#############################################################################
## GeomIO Library
## Copyright FougSys (2 Mar. 2015)
## contact@fougsys.fr
##
## This software is a reusable library whose purpose is to provide complete
## I/O support for various CAD file formats (eg. STL)
##
## This software is governed by the CeCILL-B license under French law and
## abiding by the rules of distribution of free software. You can use,
## modify and/ or redistribute the software under the terms of the CeCILL-B
## license as circulated by CEA, CNRS and INRIA at the following URL
## "http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html".
#############################################################################
cmake_minimum_required(VERSION 2.6)
project(gmio_benchmark)
#set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
# Options
option(BENCHMARK_ASSIMP "Build benchmark for Assimp" ON)
option(BENCHMARK_OPENCASCADE "Build benchmark for OpenCascade" ON)
set(ASSIMP_DIR ${CMAKE_SOURCE_DIR} CACHE PATH "Directory where the Assimp library resides")
set(OPENCASCADE_DIR ${CMAKE_SOURCE_DIR} CACHE PATH "Directory where the OpenCascade library resides")
set(GMIO_DIR ${CMAKE_SOURCE_DIR} CACHE PATH "Directory where the GeomIO library resides")
# List source files in commons/
file(GLOB COMMONS_FILES commons/*)
set(COMMONS_FILES ${COMMONS_FILES})
# TODO: check if GMIO_HAVE_STDINT_H is required or not
add_definitions(-DGMIO_HAVE_STDINT_H)
include_directories(${GMIO_DIR}/include)
link_libraries(${GMIO_DIR}/lib/gmio.lib)
add_executable(bench_gmio bench_gmio/main.c ${COMMONS_FILES})
if(BENCHMARK_ASSIMP)
add_executable(bench_assimp bench_assimp/main.cpp ${COMMONS_FILES})
target_include_directories(
bench_assimp
PUBLIC ${ASSIMP_DIR}/include)
target_link_libraries(
bench_assimp
${ASSIMP_DIR}/lib64/assimp.lib)
endif()
if(BENCHMARK_OPENCASCADE)
add_executable(bench_occ
bench_occ/main.cpp
${GMIO_DIR}/src/gmio_support/occ_libstl.cpp
${COMMONS_FILES})
target_compile_definitions(
bench_occ
PUBLIC _OCC64 # TODO: define only if target arch is 64b
PUBLIC WNT) # TODO: define only if target OS is Windows
target_include_directories(
bench_occ
PUBLIC ${OPENCASCADE_DIR}/inc)
target_link_libraries(
bench_occ
${OPENCASCADE_DIR}/win64/vc11/lib/TKernel.lib
${OPENCASCADE_DIR}/win64/vc11/lib/TKMath.lib
${OPENCASCADE_DIR}/win64/vc11/lib/TKSTL.lib)
endif()
# Find bit size of the target architecture
math(EXPR GMIO_TARGET_ARCH_BIT_SIZE "8 * ${CMAKE_SIZEOF_VOID_P}")
# Specific flags for Visual C++
if(MSVC)
# Disable deprecation warnings about "non-secure" CRT functions
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
endif()