CMakeLists.txt 1.62 KB
Newer Older
Lars Kuehne's avatar
Lars Kuehne committed
1
cmake_minimum_required(VERSION 3.9.6)
2
project(dynamicsystems LANGUAGES CXX)
3

Lars Kuehne's avatar
Lars Kuehne committed
4 5
find_package(Boost REQUIRED COMPONENTS program_options)
find_package(PNG REQUIRED)
6

Lars Kuehne's avatar
Lars Kuehne committed
7 8 9 10
add_library(dynamicsystems compute.cpp picture.cpp)
target_link_libraries(dynamicsystems PRIVATE PNG::PNG Boost::boost)
target_link_libraries(dynamicsystems PUBLIC Boost::boost)
target_compile_features(dynamicsystems PUBLIC cxx_std_11)
plgruener's avatar
plgruener committed
11

Lars Kuehne's avatar
Lars Kuehne committed
12 13 14 15
find_package(OpenMP)
if(OPENMP_CXX_FOUND)
  target_link_libraries(dynamicsystems PRIVATE OpenMP::OpenMP_CXX)
endif()
16

Lars Kuehne's avatar
Lars Kuehne committed
17 18
add_executable(dynamicsystems-cli cli.cpp)
target_link_libraries(dynamicsystems-cli PRIVATE dynamicsystems)
plgruener's avatar
plgruener committed
19

Lars Kuehne's avatar
Lars Kuehne committed
20 21 22 23 24 25 26 27
set(FLTK_SKIP_OPENGL TRUE)
set(FLTK_SKIP_FLUID TRUE)
find_package(FLTK)
if(FLTK_FOUND)
add_executable(dynamicsystems-gui gui.cpp)
target_link_libraries(dynamicsystems-gui PRIVATE dynamicsystems)
target_include_directories(dynamicsystems-gui PRIVATE ${FLTK_INCLUDE_DIR})
target_link_libraries(dynamicsystems-gui PRIVATE ${FLTK_LIBRARIES})
28 29 30 31
if (WIN32)
  set_property(TARGET dynamicsystems-gui PROPERTY WIN32_EXECUTABLE TRUE)
endif(WIN32)
endif(FLTK_FOUND)
32

33

Lars Kuehne's avatar
Lars Kuehne committed
34 35 36
target_link_libraries(dynamicsystems-cli PRIVATE Boost::program_options
                                                 Boost::disable_autolinking
                                                 Boost::dynamic_linking)
37

38
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
39
  if (WIN32)
40 41
    target_compile_options(dynamicsystems-cli PRIVATE "/QxHost")
    target_compile_options(dynamicsystems-gui PRIVATE "/QxHost")
42
  else(WIN32)
43 44
    target_compile_options(dynamicsystems-cli PRIVATE "-xhost")
    target_compile_options(dynamicsystems-gui PRIVATE "-xhost")
45
  endif(WIN32)
plgruener's avatar
plgruener committed
46
endif()