Skip to content

Instantly share code, notes, and snippets.

@faheel
Created December 30, 2017 13:07
Show Gist options
  • Save faheel/f3d7a00a15fd7ce8f7d8dca3845220f0 to your computer and use it in GitHub Desktop.
Save faheel/f3d7a00a15fd7ce8f7d8dca3845220f0 to your computer and use it in GitHub Desktop.
CMake build config for BigInt
cmake_minimum_required(VERSION 3.0)
project(BigInt)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(BINARY_DIR ${CMAKE_SOURCE_DIR}/bin)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_FLAGS "-Wall -Wextra -pedantic-errors")
include_directories(include)
# Test runner
add_library(test_runner STATIC
test/test_runner.cpp)
# Constructors:
add_executable(constructors.test
test/constructors/constructors.test.cpp)
target_link_libraries(constructors.test test_runner)
install(TARGETS
constructors.test
DESTINATION
${BINARY_DIR}/constructors)
# Functions:
add_executable(conversion.test
test/functions/conversion.test.cpp)
target_link_libraries(conversion.test test_runner)
add_executable(math.test
test/functions/math.test.cpp)
target_link_libraries(math.test test_runner)
install(TARGETS
conversion.test
math.test
DESTINATION
${BINARY_DIR}/functions)
# Operators:
add_executable(arithmetic_assignment.test
test/operators/arithmetic_assignment.test.cpp)
target_link_libraries(arithmetic_assignment.test test_runner)
add_executable(assignment.test
test/operators/assignment.test.cpp)
target_link_libraries(assignment.test test_runner)
add_executable(binary_arithmetic.test
test/operators/binary_arithmetic.test.cpp)
target_link_libraries(binary_arithmetic.test test_runner)
add_executable(increment_decrement.test
test/operators/increment_decrement.test.cpp)
target_link_libraries(increment_decrement.test test_runner)
add_executable(relational.test
test/operators/relational.test.cpp)
target_link_libraries(relational.test test_runner)
add_executable(unary_arithmetic.test
test/operators/unary_arithmetic.test.cpp)
target_link_libraries(unary_arithmetic.test test_runner)
install(TARGETS
arithmetic_assignment.test
assignment.test
binary_arithmetic.test
increment_decrement.test
relational.test
unary_arithmetic.test
DESTINATION
${BINARY_DIR}/operators)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment