Commit bf3b81fd authored by Laurent Belcour's avatar Laurent Belcour

[CMake] CMake works now on GNU/Debian

        Adding OpenMP handling and correcting issues with -fPIC
parent 4aeacd4b
cmake_minimum_required (VERSION 3.2)
project (ALTA CXX)
project (alta CXX)
# Find required packages
find_package(EIGEN3)
find_package(Eigen3 REQUIRED)
find_package(OpenMP)
add_definitions(-DALTA_PLUGIN_DIRECTORY="/usr/lib/alta_plugins")
......@@ -10,6 +11,13 @@ add_definitions(-DALTA_PLUGIN_DIRECTORY="/usr/lib/alta_plugins")
include_directories("external/build" "sources" ${EIGEN3_INCLUDE_DIR})
include_directories("external")
# Update compilation option to include OpenMP if present
if(OPENMP_FOUND)
set (CMAKE_CXX_FLAGS ${OpenMP_CXX_FLAGS})
endif(OPENMP_FOUND)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
#############################
# Helper functions #
#############################
......@@ -44,6 +52,8 @@ add_library(core STATIC sources/core/common.cpp
sources/core/rational_function.cpp)
target_compile_features(core PRIVATE cxx_range_for)
target_link_libraries(core ${CMAKE_DL_LIBS})
#############################
# Plugins #
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment