benchmarks: put a CMakeLists.txt file per sub-folder
This commit is contained in:
parent
cf05510529
commit
60c1683965
@ -13,9 +13,6 @@
|
||||
## "http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html".
|
||||
#############################################################################
|
||||
|
||||
set(ROOTDIR_ASSIMP ${CMAKE_SOURCE_DIR} CACHE PATH "Directory where the Assimp library resides")
|
||||
set(ROOTDIR_OPENCASCADE ${CMAKE_SOURCE_DIR} CACHE PATH "Directory where the OpenCascade library resides")
|
||||
|
||||
file(GLOB COMMONS_FILES commons/*)
|
||||
set(COMMONS_FILES ${COMMONS_FILES})
|
||||
|
||||
@ -26,93 +23,12 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG)
|
||||
link_libraries(m) # -lm
|
||||
endif()
|
||||
|
||||
add_executable(benchmark_gmio benchmark_gmio/main.c ${COMMONS_FILES})
|
||||
|
||||
function(get_msvc_vernum outVerNum)
|
||||
if(MSVC60)
|
||||
set(${outVerNum} 6 PARENT_SCOPE)
|
||||
elseif(MSVC70)
|
||||
set(${outVerNum} 7 PARENT_SCOPE)
|
||||
elseif(MSVC80)
|
||||
set(${outVerNum} 8 PARENT_SCOPE)
|
||||
elseif(MSVC90)
|
||||
set(${outVerNum} 9 PARENT_SCOPE)
|
||||
elseif(MSVC10)
|
||||
set(${outVerNum} 10 PARENT_SCOPE)
|
||||
elseif(MSVC11)
|
||||
set(${outVerNum} 11 PARENT_SCOPE)
|
||||
elseif(MSVC12)
|
||||
set(${outVerNum} 12 PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
add_subdirectory(benchmark_gmio)
|
||||
|
||||
if(GMIO_BUILD_BENCHMARK_ASSIMP)
|
||||
add_executable(benchmark_assimp benchmark_assimp/main.cpp ${COMMONS_FILES})
|
||||
# Note: we could use target_include_directories() but it's available in cmake > v2.8.10
|
||||
set_property(
|
||||
TARGET benchmark_assimp
|
||||
APPEND PROPERTY INCLUDE_DIRECTORIES ${ROOTDIR_ASSIMP}/include)
|
||||
|
||||
# TODO: choose lib32/lib64 depending on the architecture
|
||||
find_library(
|
||||
LIB_ASSIMP assimp ${ROOTDIR_ASSIMP}/lib64
|
||||
DOC "Path to the assimp import library")
|
||||
target_link_libraries(benchmark_assimp ${LIB_ASSIMP})
|
||||
add_subdirectory(benchmark_assimp)
|
||||
endif()
|
||||
|
||||
if(GMIO_BUILD_BENCHMARK_OPENCASCADE)
|
||||
add_executable(
|
||||
benchmark_opencascade
|
||||
benchmark_opencascade/main.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/gmio_support/stl_occ.cpp
|
||||
${COMMONS_FILES})
|
||||
|
||||
# TODO: define only if target arch is 64b
|
||||
# Note: we could use target_compile_definitions() but it's available in cmake > v2.8.10
|
||||
set_property(
|
||||
TARGET benchmark_opencascade
|
||||
APPEND PROPERTY COMPILE_DEFINITIONS _OCC64)
|
||||
|
||||
if(WIN32)
|
||||
set_property(
|
||||
TARGET benchmark_opencascade
|
||||
APPEND PROPERTY COMPILE_DEFINITIONS WNT)
|
||||
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
set_property(
|
||||
TARGET benchmark_opencascade
|
||||
APPEND PROPERTY COMPILE_DEFINITIONS
|
||||
HAVE_CONFIG_H HAVE_FSTREAM HAVE_IOSTREAM HAVE_IOMANIP HAVE_LIMITS_H)
|
||||
endif()
|
||||
|
||||
# Note: we could use target_include_directories() but it's available in cmake > v2.8.10
|
||||
set_property(
|
||||
TARGET benchmark_opencascade
|
||||
APPEND PROPERTY INCLUDE_DIRECTORIES ${ROOTDIR_OPENCASCADE}/inc)
|
||||
|
||||
# Libs
|
||||
if(MSVC)
|
||||
set(_MSVC_VERNUM_ 0) # Init
|
||||
get_msvc_vernum(_MSVC_VERNUM_)
|
||||
# TODO: choose win32/win64 depending on the architecture
|
||||
set(LIBDIR_OPENCASCADE ${ROOTDIR_OPENCASCADE}/win64/vc${_MSVC_VERNUM_}/lib)
|
||||
elseif((${CMAKE_SYSTEM_NAME} MATCHES "Linux") AND CMAKE_COMPILER_IS_GNUCXX)
|
||||
# TODO: choose lin32/lin64 depending on the architecture
|
||||
set(LIBDIR_OPENCASCADE ${ROOTDIR_OPENCASCADE}/lin64/gcc/lib)
|
||||
endif()
|
||||
#message(STATUS ${ROOTDIR_OPENCASCADE})
|
||||
|
||||
find_library(
|
||||
LIB_OPENCASCADE_TKERNEL TKernel ${LIBDIR_OPENCASCADE}
|
||||
DOC "Path to the TKernel import library")
|
||||
find_library(
|
||||
LIB_OPENCASCADE_TKMATH TKMath ${LIBDIR_OPENCASCADE}
|
||||
DOC "Path to the TKMath import library")
|
||||
find_library(
|
||||
LIB_OPENCASCADE_TKSTL TKSTL ${LIBDIR_OPENCASCADE}
|
||||
DOC "Path to the TKSTL import library")
|
||||
target_link_libraries(
|
||||
benchmark_opencascade
|
||||
${LIB_OPENCASCADE_TKERNEL}
|
||||
${LIB_OPENCASCADE_TKMATH}
|
||||
${LIB_OPENCASCADE_TKSTL})
|
||||
add_subdirectory(benchmark_opencascade)
|
||||
endif()
|
||||
|
27
benchmarks/benchmark_assimp/CMakeLists.txt
Normal file
27
benchmarks/benchmark_assimp/CMakeLists.txt
Normal file
@ -0,0 +1,27 @@
|
||||
#############################################################################
|
||||
## gmio
|
||||
## Copyright Fougue (2 Mar. 2015)
|
||||
## contact@fougue.pro
|
||||
##
|
||||
## 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".
|
||||
#############################################################################
|
||||
|
||||
set(ROOTDIR_ASSIMP ${CMAKE_SOURCE_DIR} CACHE PATH
|
||||
"Directory where the Assimp library resides")
|
||||
|
||||
include_directories(${ROOTDIR_ASSIMP}/include)
|
||||
add_executable(benchmark_assimp main.cpp ${COMMONS_FILES})
|
||||
|
||||
# TODO: choose lib32/lib64 depending on the architecture
|
||||
find_library(
|
||||
LIB_ASSIMP assimp ${ROOTDIR_ASSIMP}/lib64
|
||||
DOC "Path to the assimp import library")
|
||||
|
||||
target_link_libraries(benchmark_assimp ${LIB_ASSIMP})
|
16
benchmarks/benchmark_gmio/CMakeLists.txt
Normal file
16
benchmarks/benchmark_gmio/CMakeLists.txt
Normal file
@ -0,0 +1,16 @@
|
||||
#############################################################################
|
||||
## gmio
|
||||
## Copyright Fougue (2 Mar. 2015)
|
||||
## contact@fougue.pro
|
||||
##
|
||||
## 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".
|
||||
#############################################################################
|
||||
|
||||
add_executable(benchmark_gmio main.c ${COMMONS_FILES})
|
85
benchmarks/benchmark_opencascade/CMakeLists.txt
Normal file
85
benchmarks/benchmark_opencascade/CMakeLists.txt
Normal file
@ -0,0 +1,85 @@
|
||||
#############################################################################
|
||||
## gmio
|
||||
## Copyright Fougue (2 Mar. 2015)
|
||||
## contact@fougue.pro
|
||||
##
|
||||
## 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".
|
||||
#############################################################################
|
||||
|
||||
set(ROOTDIR_OPENCASCADE ${CMAKE_SOURCE_DIR} CACHE PATH
|
||||
"Directory where the OpenCascade library resides")
|
||||
|
||||
# Returns the version number of Visual C++
|
||||
function(get_msvc_vernum outVerNum)
|
||||
if(MSVC60)
|
||||
set(${outVerNum} 6 PARENT_SCOPE)
|
||||
elseif(MSVC70)
|
||||
set(${outVerNum} 7 PARENT_SCOPE)
|
||||
elseif(MSVC80)
|
||||
set(${outVerNum} 8 PARENT_SCOPE)
|
||||
elseif(MSVC90)
|
||||
set(${outVerNum} 9 PARENT_SCOPE)
|
||||
elseif(MSVC10)
|
||||
set(${outVerNum} 10 PARENT_SCOPE)
|
||||
elseif(MSVC11)
|
||||
set(${outVerNum} 11 PARENT_SCOPE)
|
||||
elseif(MSVC12)
|
||||
set(${outVerNum} 12 PARENT_SCOPE)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
add_executable(
|
||||
benchmark_opencascade
|
||||
main.cpp
|
||||
${CMAKE_SOURCE_DIR}/src/gmio_support/stl_occ.cpp
|
||||
${COMMONS_FILES})
|
||||
|
||||
# TODO: define only if target arch is 64b
|
||||
add_definitions(-D_OCC64)
|
||||
|
||||
if(WIN32)
|
||||
add_definitions(-DWNT)
|
||||
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
add_definitions(
|
||||
-DHAVE_CONFIG_H
|
||||
-DHAVE_FSTREAM
|
||||
-DHAVE_IOSTREAM
|
||||
-DHAVE_IOMANIP
|
||||
-DHAVE_LIMITS_H)
|
||||
endif()
|
||||
|
||||
include_directories(${ROOTDIR_OPENCASCADE}/inc)
|
||||
|
||||
# Libs
|
||||
if(MSVC)
|
||||
set(_MSVC_VERNUM_ 0) # Init
|
||||
get_msvc_vernum(_MSVC_VERNUM_)
|
||||
# TODO: choose win32/win64 depending on the architecture
|
||||
set(LIBDIR_OPENCASCADE ${ROOTDIR_OPENCASCADE}/win64/vc${_MSVC_VERNUM_}/lib)
|
||||
elseif((${CMAKE_SYSTEM_NAME} MATCHES "Linux") AND CMAKE_COMPILER_IS_GNUCXX)
|
||||
# TODO: choose lin32/lin64 depending on the architecture
|
||||
set(LIBDIR_OPENCASCADE ${ROOTDIR_OPENCASCADE}/lin64/gcc/lib)
|
||||
endif()
|
||||
#message(STATUS ${ROOTDIR_OPENCASCADE})
|
||||
|
||||
find_library(
|
||||
LIB_OPENCASCADE_TKERNEL TKernel ${LIBDIR_OPENCASCADE}
|
||||
DOC "Path to the TKernel import library")
|
||||
find_library(
|
||||
LIB_OPENCASCADE_TKMATH TKMath ${LIBDIR_OPENCASCADE}
|
||||
DOC "Path to the TKMath import library")
|
||||
find_library(
|
||||
LIB_OPENCASCADE_TKSTL TKSTL ${LIBDIR_OPENCASCADE}
|
||||
DOC "Path to the TKSTL import library")
|
||||
target_link_libraries(
|
||||
benchmark_opencascade
|
||||
${LIB_OPENCASCADE_TKERNEL}
|
||||
${LIB_OPENCASCADE_TKMATH}
|
||||
${LIB_OPENCASCADE_TKSTL})
|
Loading…
Reference in New Issue
Block a user