star-3dut

Generate meshes of simple geometric shapes
git clone git://git.meso-star.fr/star-3dut.git
Log | Files | Refs | README | LICENSE

commit 68b4d54fc6522c13cab48c6d8a91dd1c1e5f4e17
parent 3d123b64f2cf5a6726b832c28ee5d651550f4d66
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Fri, 25 Nov 2016 09:02:25 +0100

Provide a CMakeList file

Diffstat:
Acmake/CMakeLists.txt | 88+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 88 insertions(+), 0 deletions(-)

diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt @@ -0,0 +1,88 @@ +# Copyright (C) 2016 |Meso|Star> (contact@meso-star.com) +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +cmake_minimum_required(VERSION 2.8) +project(s3dut C) +enable_testing() + +option(NO_TEST "Do not compile the test pograms" OFF) + +set(S3DUT_SOURCE_DIR ${PROJECT_SOURCE_DIR}/../src) + +################################################################################ +# Dependencies +################################################################################ +find_package(RCMake REQUIRED) +find_package(RSys 0.4 REQUIRED) + +include_directories(${RSys_INCLUDE_DIR}) + +set(CMAKE_MODULE_PATH ${RCMAKE_SOURCE_DIR}) +include(rcmake) +include(rcmake_runtime) + +################################################################################ +# Define targets +################################################################################ +set(VERSION_MAJOR 0) +set(VERSION_MINOR 0) +set(VERSION_PATCH 0) +set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}) + +set(S3DUT_FILES_SRC s3dut_mesh.c s3dut_sphere.c) +set(S3DUT_FILES_INC s3dut_mesh.h) +set(S3DUT_FILES_INC_API s3dut.h) +set(S3DUT_FILES_DOC COPYING README.md) + +rcmake_prepend_path(S3DUT_FILES_SRC ${S3DUT_SOURCE_DIR}) +rcmake_prepend_path(S3DUT_FILES_INC ${S3DUT_SOURCE_DIR}) +rcmake_prepend_path(S3DUT_FILES_DOC ${PROJECT_SOURCE_DIR}/../) + +if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_GNUCC) + set(MATH_LIB m) +endif() + +add_library(s3dut SHARED ${S3DUT_FILES_SRC} ${S3DUT_FILES_INC}) +set_target_properties(s3dut PROPERTIES + DEFINE_SYMBOL S3DUT_SHARED_BUILD + VERSION ${VERSION} + SOVERSION ${VERSION_MAJOR}) +target_link_libraries(s3dut RSys ${MATH_LIB}) + +rcmake_setup_devel(s3dut Star3DUT ${VERSION} star/s3dut_version.h) + +################################################################################ +# Define tests +################################################################################ +if(NOT NO_TEST) + + function(new_test _name) + add_executable(${_name} ${S3DUT_SOURCE_DIR}/${_name}.c) + target_link_libraries(${_name} s3dut RSys) + add_test(${_name} ${_name}) + endfunction() + # TODO add tests here +endif() + +################################################################################ +# Install directories +################################################################################ +install(TARGETS s3dut + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib + RUNTIME DESTINATION bin) +install(FILES ${S3DUT_FILES_INC} DESTINATION include/star/) +install(FILES ${S3DUT_FILES_DOC} DESTINATION share/doc/star-3dut/) +