Skip to content

Instantly share code, notes, and snippets.

@andrefreitas
Last active September 24, 2015 22:27
Show Gist options
  • Save andrefreitas/f472b63533dabe4dbf23 to your computer and use it in GitHub Desktop.
Save andrefreitas/f472b63533dabe4dbf23 to your computer and use it in GitHub Desktop.
cmake_minimum_required(VERSION 3.1)
project(hello)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
set(SOURCE_FILES
hello.h
hello.cpp
main.cpp
)
set(CMAKE_MODULE_PATH
${CMAKE_SOURCE_DIR}/cmake
)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/build)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/build)
find_package(Boost REQUIRED COMPONENTS date_time filesystem system)
find_package(MPFR 2.3.0)
find_package(GMP)
if(Boost_FOUND AND MPFR_FOUND AND GMP_FOUND)
include_directories(${Boost_INCLUDE_DIRS})
add_executable(hello ${SOURCE_FILES})
add_library(hello SHARED ${SOURCE_FILES})
target_link_libraries(hello ${Boost_LIBRARIES} ${MPFR_LIBRARIES} ${GMP_LIBRARIES})
target_link_libraries(hello ${Boost_LIBRARIES} ${MPFR_LIBRARIES} ${GMP_LIBRARIES})
endif()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment