added: CMakeLists.txt files for building samples by using cmake system

submitted by Mateusz Loskot <mateusz at loskot dot net>


git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@997 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
Tomasz Sowa 2014-11-28 15:59:08 +00:00
parent b862422bd9
commit 5893ffa9e3
2 changed files with 22 additions and 0 deletions

6
CMakeLists.txt Normal file
View File

@ -0,0 +1,6 @@
# CMake configuration for ttmath
cmake_minimum_required (VERSION 3.0)
project(ttmath)
enable_testing()
include_directories(${ttmath_SOURCE_DIR})
add_subdirectory(samples)

16
samples/CMakeLists.txt Normal file
View File

@ -0,0 +1,16 @@
# CMake configuration for ttmath/samples
# Building with Visual C++ x86_64 needs to compile the asm utilities first
if (MSVC AND "x${CMAKE_VS_PLATFORM_NAME}" STREQUAL "xx64")
set(TTMATH_MSVC64_ASM ttmathuint_x86_64_msvc.asm)
enable_language(ASM_MASM)
message(STATUS "Enabled MASM to compile '${TTMATH_MSVC64_ASM}'")
set(TTMATH_SRC_ASM ${ttmath_SOURCE_DIR}/ttmath/${TTMATH_MSVC64_ASM})
endif()
set(SAMPLES big big2 int uint parser)
foreach(sample ${SAMPLES})
add_executable(${sample} ${sample}.cpp ${TTMATH_SRC_ASM})
# Allow to run all utilities at once as a test
add_test(${sample} ${sample})
endforeach()