mirror of
https://github.com/aportelli/LatAnalyze.git
synced 2024-11-10 00:45:36 +00:00
cmake comments
This commit is contained in:
parent
cce9faaba6
commit
1c8add56ef
@ -1,14 +1,19 @@
|
|||||||
|
# package config
|
||||||
cmake_minimum_required(VERSION 3.11.0)
|
cmake_minimum_required(VERSION 3.11.0)
|
||||||
project(
|
project(
|
||||||
LatAnalyze
|
LatAnalyze
|
||||||
VERSION 3.6
|
VERSION 3.6
|
||||||
LANGUAGES C CXX)
|
LANGUAGES C CXX)
|
||||||
set(CMAKE_CXX_STANDARD 14)
|
|
||||||
|
|
||||||
|
# includes
|
||||||
include(FetchContent)
|
include(FetchContent)
|
||||||
include(FindPackageMessage)
|
include(FindPackageMessage)
|
||||||
include(GNUInstallDirs)
|
include(GNUInstallDirs)
|
||||||
|
|
||||||
|
# C++ standard
|
||||||
|
set(CMAKE_CXX_STANDARD 14)
|
||||||
|
|
||||||
|
# fetch and create symbolic link to Eigen headers
|
||||||
set(FETCHCONTENT_BASE_DIR ${CMAKE_BINARY_DIR}/deps)
|
set(FETCHCONTENT_BASE_DIR ${CMAKE_BINARY_DIR}/deps)
|
||||||
FetchContent_Declare(
|
FetchContent_Declare(
|
||||||
Eigen3
|
Eigen3
|
||||||
@ -22,6 +27,7 @@ endif()
|
|||||||
file(CREATE_LINK ${eigen3_SOURCE_DIR}/Eigen ${CMAKE_SOURCE_DIR}/lib/LatAnalyze/Eigen
|
file(CREATE_LINK ${eigen3_SOURCE_DIR}/Eigen ${CMAKE_SOURCE_DIR}/lib/LatAnalyze/Eigen
|
||||||
SYMBOLIC)
|
SYMBOLIC)
|
||||||
|
|
||||||
|
# dependencies
|
||||||
find_package(GSL REQUIRED)
|
find_package(GSL REQUIRED)
|
||||||
find_package(HDF5 REQUIRED COMPONENTS C CXX)
|
find_package(HDF5 REQUIRED COMPONENTS C CXX)
|
||||||
find_package(Minuit2)
|
find_package(Minuit2)
|
||||||
@ -44,8 +50,10 @@ else()
|
|||||||
message(STATUS "NLopt not found")
|
message(STATUS "NLopt not found")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# subdirectories
|
||||||
add_subdirectory(lib)
|
add_subdirectory(lib)
|
||||||
|
|
||||||
|
# summary
|
||||||
message(STATUS "---------------------------")
|
message(STATUS "---------------------------")
|
||||||
message(STATUS "LatAnalyze v${PROJECT_VERSION} configured")
|
message(STATUS "LatAnalyze v${PROJECT_VERSION} configured")
|
||||||
message(STATUS "---------------------------")
|
message(STATUS "---------------------------")
|
||||||
|
@ -1,11 +1,15 @@
|
|||||||
|
# rpath config
|
||||||
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
|
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
|
||||||
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_LIBDIR}")
|
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_LIBDIR}")
|
||||||
|
|
||||||
|
# config.h header for package version and name
|
||||||
configure_file(config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h @ONLY)
|
configure_file(config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h @ONLY)
|
||||||
|
|
||||||
|
# find bison & flex
|
||||||
find_package(BISON REQUIRED)
|
find_package(BISON REQUIRED)
|
||||||
find_package(FLEX REQUIRED)
|
find_package(FLEX REQUIRED)
|
||||||
|
|
||||||
|
# ASCII parser
|
||||||
bison_target(
|
bison_target(
|
||||||
AsciiParser LatAnalyze/Io/AsciiParser.ypp
|
AsciiParser LatAnalyze/Io/AsciiParser.ypp
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/AsciiParser.cpp COMPILE_FLAGS "-Wno-deprecated")
|
${CMAKE_CURRENT_BINARY_DIR}/AsciiParser.cpp COMPILE_FLAGS "-Wno-deprecated")
|
||||||
@ -13,6 +17,7 @@ flex_target(AsciiLexer LatAnalyze/Io/AsciiLexer.lpp
|
|||||||
${CMAKE_CURRENT_BINARY_DIR}/AsciiLexer.cpp)
|
${CMAKE_CURRENT_BINARY_DIR}/AsciiLexer.cpp)
|
||||||
add_flex_bison_dependency(AsciiLexer AsciiParser)
|
add_flex_bison_dependency(AsciiLexer AsciiParser)
|
||||||
|
|
||||||
|
# math parser
|
||||||
bison_target(
|
bison_target(
|
||||||
MathParser LatAnalyze/Core/MathParser.ypp
|
MathParser LatAnalyze/Core/MathParser.ypp
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/MathParser.cpp COMPILE_FLAGS "-Wno-deprecated")
|
${CMAKE_CURRENT_BINARY_DIR}/MathParser.cpp COMPILE_FLAGS "-Wno-deprecated")
|
||||||
@ -20,6 +25,7 @@ flex_target(MathLexer LatAnalyze/Core/MathLexer.lpp
|
|||||||
${CMAKE_CURRENT_BINARY_DIR}/MathLexer.cpp)
|
${CMAKE_CURRENT_BINARY_DIR}/MathLexer.cpp)
|
||||||
add_flex_bison_dependency(MathLexer MathParser)
|
add_flex_bison_dependency(MathLexer MathParser)
|
||||||
|
|
||||||
|
# library target
|
||||||
add_library(LatAnalyze SHARED)
|
add_library(LatAnalyze SHARED)
|
||||||
file(GLOB_RECURSE EIGEN_HEADERS LatAnalyze/Eigen/*)
|
file(GLOB_RECURSE EIGEN_HEADERS LatAnalyze/Eigen/*)
|
||||||
target_include_directories(LatAnalyze PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
|
target_include_directories(LatAnalyze PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
|
||||||
|
Loading…
Reference in New Issue
Block a user