rsys

Basic data structures and low-level features
git clone git://git.meso-star.fr/rsys.git
Log | Files | Refs | README | LICENSE

commit cf289428c7903b8f6473771fc2da27202cd6c948
parent 103211b3cfe0a78287a01fb662f56b66add4593d
Author: vaplv <vaplv@free.fr>
Date:   Mon,  9 Nov 2015 15:09:48 +0100

Transform the CRLF eol of the cmake script in LF

Diffstat:
Mcmake/CMakeLists.txt | 413+++++++++++++++++++++++++++++++++++++++----------------------------------------
1 file changed, 206 insertions(+), 207 deletions(-)

diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt @@ -1,207 +1,206 @@ -# Copyright (C) 2013-2015 Vincent Forest (vaplv@free.fr) -# -# This CMake script 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 CMake script 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 CMake script. If not, see <http://www.gnu.org/licenses/>. - -cmake_minimum_required(VERSION 2.6) -project(rsys C) -cmake_policy(SET CMP0011 NEW) -enable_testing() - -set(RSYS_SOURCE_DIR ${PROJECT_SOURCE_DIR}/../src) -option(NO_TEST "Disable the test" OFF) - -################################################################################ -# Check dependencies -################################################################################ -find_package(OpenMP) -find_package(RCMake REQUIRED) -find_package(Threads REQUIRED) - -set(CMAKE_MODULE_PATH ${RCMAKE_SOURCE_DIR}) -include(rcmake) - -################################################################################ -# Configure and define targets -################################################################################ -set(VERSION_MAJOR 0) -set(VERSION_MINOR 3) -set(VERSION_PATCH 0) -set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}) - -set(RSYS_FILES_SRC - clock_time.c - cstr.c - float44.c - image.c - library.c - logger.c - mem_allocator.c - quaternion.c - str.c) - -if(CMAKE_USE_PTHREADS_INIT) - set(RSYS_FILES_SRC_THREAD - pthread/pthread_condition.c - pthread/pthread_mutex.c) -elseif(CMAKE_USE_WIN32_THREADS_INIT) - set(RSYS_FILES_SRC_THREAD - win32/win32_condition.c - win32/win32_mutex.c) -endif(CMAKE_USE_PTHREADS_INIT) - -set(RSYS_FILES_INC - io_c99.h) -set(RSYS_FILES_INC_API - binary_heap.h - clock_time.h - condition.h - cstr.h - dynamic_array.h - dynamic_array_char.h - dynamic_array_double.h - dynamic_array_float.h - dynamic_array_uchar.h - dynamic_array_u32.h - dynamic_array_u64.h - dynamic_array_uint.h - dynamic_array_size_t.h - dynamic_array_str.h - floatX.h - float2.h - float3.h - float4.h - floatXY.h - float22.h - float33.h - float44.h - free_list.h - hash.h - hash_table.h - image.h - library.h - list.h - logger.h - math.h - mem_allocator.h - mutex.h - quaternion.h - ref_count.h - rsys.h - signal.h - str.h - stretchy_array.h) - -set(RSYS_FILES_DOC COPYING COPYING.LESSER README.md) - -# Prepend each file in the `_files' list by `_path' -rcmake_prepend_path(RSYS_FILES_SRC ${RSYS_SOURCE_DIR}) -rcmake_prepend_path(RSYS_FILES_SRC_THREAD ${RSYS_SOURCE_DIR}) -rcmake_prepend_path(RSYS_FILES_INC ${RSYS_SOURCE_DIR}) -rcmake_prepend_path(RSYS_FILES_INC_API ${RSYS_SOURCE_DIR}) -rcmake_prepend_path(RSYS_FILES_DOC ${PROJECT_SOURCE_DIR}/../) - -add_library(rsys SHARED - ${RSYS_FILES_SRC} - ${RSYS_FILES_SRC_THREAD} - ${RSYS_FILES_INC} - ${RSYS_FILES_INC_API}) -target_link_libraries(rsys ${CMAKE_THREAD_LIBS_INIT}) -set_target_properties(rsys PROPERTIES - DEFINE_SYMBOL RSYS_SHARED_BUILD - VERSION ${VERSION} - SOVERSION ${VERSION_MAJOR}) - -rcmake_setup_devel(rsys RSys ${VERSION} rsys/rsys_version.h) - -if(CMAKE_COMPILER_IS_GNUCC) - target_link_libraries(rsys m) - if(NOT MINGW) - target_link_libraries(rsys dl) - endif(NOT MINGW) -endif(CMAKE_COMPILER_IS_GNUCC) - -################################################################################ -# Add tests -################################################################################ -if(NOT NO_TEST) - macro(new_test _name) - add_executable(${_name} ${RSYS_SOURCE_DIR}/${_name}.c) - set(_libraries ${ARGN}) - foreach(_lib ${_libraries}) - target_link_libraries(${_name} ${_lib}) - endforeach(_lib) - add_test(${_name} ${_name}) - endmacro(new_test) - - if(CMAKE_COMPILER_IS_GNUCC) - set(MATH_LIB m) - endif(CMAKE_COMPILER_IS_GNUCC) - - new_test(test_atomic) - new_test(test_binary_heap rsys) - new_test(test_cstr rsys) - new_test(test_dynamic_array rsys) - new_test(test_float2 ${MATH_LIB}) - new_test(test_float3 ${MATH_LIB}) - new_test(test_float4 ${MATH_LIB}) - new_test(test_float22) - new_test(test_float33 ${MATH_LIB}) - new_test(test_float44 rsys) - new_test(test_free_list rsys) - new_test(test_hash_table rsys) - new_test(test_library rsys) - new_test(test_list rsys) - new_test(test_logger rsys) - new_test(test_mem_allocator rsys) - new_test(test_math ${MATH_LIB}) - new_test(test_quaternion rsys) - new_test(test_ref) - new_test(test_signal rsys) - new_test(test_str rsys) - new_test(test_stretchy_array rsys) - new_test(test_time rsys) - - add_library(test_lib SHARED ${RSYS_SOURCE_DIR}/test_library.c) - set_target_properties(test_lib PROPERTIES - COMPILE_DEFINITIONS TEST_LIBRARY_BUILD_LIB - DEBUG_POSTFIX "") - - if(NOT OPENMP_FOUND) - message(STATUS "No OpenMP support: multi-threaded tests cannot be generated") - else(NOT OPENMP_FOUND) - new_test(test_mutex rsys) - new_test(test_condition rsys) - - set_target_properties(test_mutex test_condition PROPERTIES - COMPILE_FLAGS ${OpenMP_C_FLAGS}) - - if(CMAKE_COMPILER_IS_GNUCC) - set_target_properties(test_mutex test_condition PROPERTIES - LINK_FLAGS ${OpenMP_C_FLAGS}) - endif(CMAKE_COMPILER_IS_GNUCC) - - endif(NOT OPENMP_FOUND) -endif(NOT NO_TEST) - -################################################################################ -# Define output & install directories -################################################################################ - -install(TARGETS rsys - ARCHIVE DESTINATION bin - LIBRARY DESTINATION lib - RUNTIME DESTINATION bin) -install(FILES ${RSYS_FILES_INC_API} DESTINATION include/rsys) -install(FILES ${RSYS_FILES_DOC} DESTINATION doc/rsys) - +# Copyright (C) 2013-2015 Vincent Forest (vaplv@free.fr) +# +# This CMake script 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 CMake script 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 CMake script. If not, see <http://www.gnu.org/licenses/>. + +cmake_minimum_required(VERSION 2.6) +project(rsys C) +cmake_policy(SET CMP0011 NEW) +enable_testing() + +set(RSYS_SOURCE_DIR ${PROJECT_SOURCE_DIR}/../src) +option(NO_TEST "Disable the test" OFF) + +################################################################################ +# Check dependencies +################################################################################ +find_package(OpenMP) +find_package(RCMake REQUIRED) +find_package(Threads REQUIRED) + +set(CMAKE_MODULE_PATH ${RCMAKE_SOURCE_DIR}) +include(rcmake) + +################################################################################ +# Configure and define targets +################################################################################ +set(VERSION_MAJOR 0) +set(VERSION_MINOR 3) +set(VERSION_PATCH 0) +set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}) + +set(RSYS_FILES_SRC + clock_time.c + cstr.c + float44.c + image.c + library.c + logger.c + mem_allocator.c + quaternion.c + str.c) + +if(CMAKE_USE_PTHREADS_INIT) + set(RSYS_FILES_SRC_THREAD + pthread/pthread_condition.c + pthread/pthread_mutex.c) +elseif(CMAKE_USE_WIN32_THREADS_INIT) + set(RSYS_FILES_SRC_THREAD + win32/win32_condition.c + win32/win32_mutex.c) +endif(CMAKE_USE_PTHREADS_INIT) + +set(RSYS_FILES_INC + io_c99.h) +set(RSYS_FILES_INC_API + binary_heap.h + clock_time.h + condition.h + cstr.h + dynamic_array.h + dynamic_array_char.h + dynamic_array_double.h + dynamic_array_float.h + dynamic_array_uchar.h + dynamic_array_u32.h + dynamic_array_u64.h + dynamic_array_uint.h + dynamic_array_size_t.h + dynamic_array_str.h + floatX.h + float2.h + float3.h + float4.h + floatXY.h + float22.h + float33.h + float44.h + free_list.h + hash.h + hash_table.h + image.h + library.h + list.h + logger.h + math.h + mem_allocator.h + mutex.h + quaternion.h + ref_count.h + rsys.h + signal.h + str.h + stretchy_array.h) + +set(RSYS_FILES_DOC COPYING COPYING.LESSER README.md) + +# Prepend each file in the `_files' list by `_path' +rcmake_prepend_path(RSYS_FILES_SRC ${RSYS_SOURCE_DIR}) +rcmake_prepend_path(RSYS_FILES_SRC_THREAD ${RSYS_SOURCE_DIR}) +rcmake_prepend_path(RSYS_FILES_INC ${RSYS_SOURCE_DIR}) +rcmake_prepend_path(RSYS_FILES_INC_API ${RSYS_SOURCE_DIR}) +rcmake_prepend_path(RSYS_FILES_DOC ${PROJECT_SOURCE_DIR}/../) + +add_library(rsys SHARED + ${RSYS_FILES_SRC} + ${RSYS_FILES_SRC_THREAD} + ${RSYS_FILES_INC} + ${RSYS_FILES_INC_API}) +target_link_libraries(rsys ${CMAKE_THREAD_LIBS_INIT}) +set_target_properties(rsys PROPERTIES + DEFINE_SYMBOL RSYS_SHARED_BUILD + VERSION ${VERSION} + SOVERSION ${VERSION_MAJOR}) + +rcmake_setup_devel(rsys RSys ${VERSION} rsys/rsys_version.h) + +if(CMAKE_COMPILER_IS_GNUCC) + target_link_libraries(rsys m) + if(NOT MINGW) + target_link_libraries(rsys dl) + endif(NOT MINGW) +endif(CMAKE_COMPILER_IS_GNUCC) + +################################################################################ +# Add tests +################################################################################ +if(NOT NO_TEST) + macro(new_test _name) + add_executable(${_name} ${RSYS_SOURCE_DIR}/${_name}.c) + set(_libraries ${ARGN}) + foreach(_lib ${_libraries}) + target_link_libraries(${_name} ${_lib}) + endforeach(_lib) + add_test(${_name} ${_name}) + endmacro(new_test) + + if(CMAKE_COMPILER_IS_GNUCC) + set(MATH_LIB m) + endif(CMAKE_COMPILER_IS_GNUCC) + + new_test(test_atomic) + new_test(test_binary_heap rsys) + new_test(test_cstr rsys) + new_test(test_dynamic_array rsys) + new_test(test_float2 ${MATH_LIB}) + new_test(test_float3 ${MATH_LIB}) + new_test(test_float4 ${MATH_LIB}) + new_test(test_float22) + new_test(test_float33 ${MATH_LIB}) + new_test(test_float44 rsys) + new_test(test_free_list rsys) + new_test(test_hash_table rsys) + new_test(test_library rsys) + new_test(test_list rsys) + new_test(test_logger rsys) + new_test(test_mem_allocator rsys) + new_test(test_math ${MATH_LIB}) + new_test(test_quaternion rsys) + new_test(test_ref) + new_test(test_signal rsys) + new_test(test_str rsys) + new_test(test_stretchy_array rsys) + new_test(test_time rsys) + + add_library(test_lib SHARED ${RSYS_SOURCE_DIR}/test_library.c) + set_target_properties(test_lib PROPERTIES + COMPILE_DEFINITIONS TEST_LIBRARY_BUILD_LIB + DEBUG_POSTFIX "") + + if(NOT OPENMP_FOUND) + message(STATUS "No OpenMP support: multi-threaded tests cannot be generated") + else(NOT OPENMP_FOUND) + new_test(test_mutex rsys) + new_test(test_condition rsys) + + set_target_properties(test_mutex test_condition PROPERTIES + COMPILE_FLAGS ${OpenMP_C_FLAGS}) + + if(CMAKE_COMPILER_IS_GNUCC) + set_target_properties(test_mutex test_condition PROPERTIES + LINK_FLAGS ${OpenMP_C_FLAGS}) + endif(CMAKE_COMPILER_IS_GNUCC) + + endif(NOT OPENMP_FOUND) +endif(NOT NO_TEST) + +################################################################################ +# Define output & install directories +################################################################################ + +install(TARGETS rsys + ARCHIVE DESTINATION bin + LIBRARY DESTINATION lib + RUNTIME DESTINATION bin) +install(FILES ${RSYS_FILES_INC_API} DESTINATION include/rsys) +install(FILES ${RSYS_FILES_DOC} DESTINATION doc/rsys)