Fix cmake

This commit is contained in:
Andrea Bontempi 2018-02-20 16:03:31 +01:00
parent a93410a321
commit 2fd5cb5d36

View File

@ -1,19 +1,26 @@
cmake_minimum_required(VERSION 2.6)
cmake_minimum_required(VERSION 3.0)
project(mandelbrot)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -O2 -ffast-math -fopenmp")
set(EXECUTABLE_NAME "mandelbrot")
set(CMAKE_CXX_STANDARD 11)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif(NOT CMAKE_BUILD_TYPE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -ffast-math -fopenmp")
add_executable(${EXECUTABLE_NAME} main.cpp functions.hpp Fractal.hpp Fractal.cpp)
link_directories(/usr/local/lib)
#Find Boost
set(BOOST_LIBS program_options)
find_package(Boost COMPONENTS ${BOOST_LIBS} REQUIRED)
target_link_libraries (${EXECUTABLE_NAME} ${Boost_LIBRARIES})
target_link_libraries (${EXECUTABLE_NAME} sfml-window)
target_link_libraries (${EXECUTABLE_NAME} sfml-system)
target_link_libraries (${EXECUTABLE_NAME} sfml-graphics)
# Find SFML
set(SFML_LIBS sfml-window sfml-system sfml-graphics)
target_link_libraries (${EXECUTABLE_NAME} ${SFML_LIBS})
install(TARGETS ${EXECUTABLE_NAME} RUNTIME DESTINATION bin)