From 5893ffa9e314c09db0a7b71ec47d6f7b142ba40f Mon Sep 17 00:00:00 2001 From: Tomasz Sowa Date: Fri, 28 Nov 2014 15:59:08 +0000 Subject: [PATCH] added: CMakeLists.txt files for building samples by using cmake system submitted by Mateusz Loskot git-svn-id: svn://ttmath.org/publicrep/ttmath/trunk@997 e52654a7-88a9-db11-a3e9-0013d4bc506e --- CMakeLists.txt | 6 ++++++ samples/CMakeLists.txt | 16 ++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 CMakeLists.txt create mode 100644 samples/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..a7f3e7a --- /dev/null +++ b/CMakeLists.txt @@ -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) diff --git a/samples/CMakeLists.txt b/samples/CMakeLists.txt new file mode 100644 index 0000000..cf035a8 --- /dev/null +++ b/samples/CMakeLists.txt @@ -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() \ No newline at end of file