Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement shared lib versioning, fix LIBDIR for 64-bit systems, and set correct version in pkgconfig file #11

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,21 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
"MinSizeRel" "RelWithDebInfo")
endif()

project(qcdloop)
project(qcdloop VERSION 2.0.5)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(VERSION "\"2.0.5\"")
set(VERSION "\"${PROJECT_VERSION}\"")
set(CMAKE_CXX_FLAGS "-Wall -Wextra -march=nocona -mtune=haswell -fvisibility-inlines-hidden -fmessage-length=0 -ftree-vectorize -fPIC -fstack-protector-strong -O2 -pipe -fext-numeric-literals")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fsanitize=address -fPIC ${CMAKE_CXX_FLAGS}" CACHE STRING "debug compile flags" FORCE)
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "-fsanitize=address" CACHE STRING "debug linker flags" FORCE)

include(GNUInstallDirs)
set(prefix ${CMAKE_INSTALL_PREFIX})
set(exec_prefix "${prefix}")
set(includedir "${prefix}/include")
set(libdir "${prefix}/lib")
set(libdir ${CMAKE_INSTALL_FULL_LIBDIR})

configure_file(
"${PROJECT_SOURCE_DIR}/src/qcdloop/config.h.in"
Expand Down Expand Up @@ -86,12 +88,14 @@ add_library(qcdloop SHARED src/box.cc
)

target_link_libraries(qcdloop)
set_target_properties(qcdloop PROPERTIES VERSION ${PROJECT_VERSION})
set_target_properties(qcdloop PROPERTIES SOVERSION ${PROJECT_VERSION_MAJOR})
install(FILES ${CMAKE_BINARY_DIR}/src/qcdloop-config
DESTINATION bin PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ
GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
install(FILES ${PROJECT_SOURCE_DIR}/src/qcdloop.pc DESTINATION lib/pkgconfig)
install(FILES ${PROJECT_SOURCE_DIR}/src/qcdloop.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
install(DIRECTORY src/qcdloop DESTINATION include)
install(TARGETS qcdloop DESTINATION lib)
install(TARGETS qcdloop DESTINATION ${CMAKE_INSTALL_LIBDIR})

# enable disable fortran/wrapper (to avoid name conflicts with ql1.x)
option(ENABLE_FORTRAN_WRAPPER "Enable fortran wrapper" ON)
Expand Down
2 changes: 1 addition & 1 deletion src/qcdloop.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ libdir=@libdir@

Name: nnpdf
Description: The qcdloop library
Version: @VERSION@
Version: @PROJECT_VERSION@
Cflags: -I@includedir@ -std=c++11
Libs: -L@libdir@ -lqcdloop