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

Fix cmake install #3228

Closed
wants to merge 13 commits into from
8 changes: 0 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,6 @@ endif()
enable_language(CXX)

set(PROJECT_VERSION "4.1.0")
string(REGEX
REPLACE "^([1-9]+)\\.[0-9]+.*$"
"\\1"
SOVERSION
"${PROJECT_VERSION}")
if(NOT ${SOVERSION} MATCHES "^[1-9]+$")
message(FATAL_ERROR "Could not determine SOVERSION from ${PROJECT_VERSION}")
endif(NOT ${SOVERSION} MATCHES "^[1-9]+$")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is SOVERSION not needed anymore?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All libraries get to installed in the python site-packages directory and in there so versioning isn’t required anymore. Plus half of the new library miss it anyhow.


#
# CMake internal vars
Expand Down
2 changes: 1 addition & 1 deletion doc/sphinx/conf.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ author = 'C. Holm, F. Weik, R. Weeber'
# The short X.Y version.
version = '@PROJECT_VERSION@'
# The full version, including alpha/beta/rc tags.
release = '@SOVERSION@'
release = '@PROJECT_VERSION@'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
1 change: 0 additions & 1 deletion src/config/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ execute_process(COMMAND ${PYTHON_EXECUTABLE}
add_library(EspressoConfig SHARED config-features.cpp)
add_dependencies(EspressoConfig myconfig check_myconfig generate_config_features)
install(TARGETS EspressoConfig LIBRARY DESTINATION ${PYTHON_INSTDIR}/espressomd)
set_target_properties(EspressoConfig PROPERTIES SOVERSION ${SOVERSION})
target_include_directories(EspressoConfig PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})

# Parse repository info from git if available
Expand Down
1 change: 0 additions & 1 deletion src/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ else(CUDA)
endif(CUDA)

install(TARGETS EspressoCore LIBRARY DESTINATION ${PYTHON_INSTDIR}/espressomd)
set_target_properties(EspressoCore PROPERTIES SOVERSION ${SOVERSION})
target_include_directories(EspressoCore PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
if(WITH_COVERAGE)
target_compile_options(EspressoCore PUBLIC "$<$<CONFIG:Release>:-g>")
Expand Down
1 change: 0 additions & 1 deletion src/core/cluster_analysis/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ set(cluster_analysis_SRC
)
add_library(cluster_analysis SHARED ${cluster_analysis_SRC})
install(TARGETS cluster_analysis LIBRARY DESTINATION ${PYTHON_INSTDIR}/espressomd)
set_target_properties(cluster_analysis PROPERTIES SOVERSION ${SOVERSION})
set_target_properties(cluster_analysis PROPERTIES MACOSX_RPATH TRUE)
target_link_libraries(cluster_analysis PUBLIC EspressoCore PRIVATE EspressoConfig)

Expand Down
1 change: 1 addition & 0 deletions src/core/io/mpiio/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
add_library(mpiio SHARED mpiio.cpp)
target_include_directories(mpiio PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(mpiio PRIVATE EspressoConfig EspressoCore MPI::MPI_CXX)
install(TARGETS mpiio LIBRARY DESTINATION ${PYTHON_INSTDIR}/espressomd)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the purpose of the new install() line here and in the other submodules?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These libraries were missing from the installation and hence made the espressomd module unusable.

1 change: 1 addition & 0 deletions src/core/io/reader/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
add_library(pdbreader SHARED readpdb.cpp)
target_link_libraries(pdbreader PUBLIC EspressoConfig EspressoCore pdbparser)
target_include_directories(pdbreader PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
install(TARGETS pdbreader LIBRARY DESTINATION ${PYTHON_INSTDIR}/espressomd)
1 change: 0 additions & 1 deletion src/core/shapes/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,4 @@ set(Shapes_SRC
)
add_library(Shapes SHARED ${Shapes_SRC})
install(TARGETS Shapes LIBRARY DESTINATION ${PYTHON_INSTDIR}/espressomd)
set_target_properties(Shapes PROPERTIES SOVERSION ${SOVERSION})
target_link_libraries(Shapes PUBLIC EspressoConfig EspressoCore)
1 change: 1 addition & 0 deletions src/pdbparser/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
add_library(pdbparser SHARED ${CMAKE_CURRENT_SOURCE_DIR}/src/PdbParser.cpp)
target_include_directories(pdbparser PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
install(TARGETS pdbparser LIBRARY DESTINATION ${PYTHON_INSTDIR}/espressomd)
if(WITH_UNIT_TESTS)
add_subdirectory(unit_tests)
endif(WITH_UNIT_TESTS)
5 changes: 2 additions & 3 deletions src/python/espressomd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ foreach(cython_file ${cython_SRC})
target_link_libraries(${target} PRIVATE EspressoConfig EspressoCore EspressoScriptInterface)
target_include_directories(${target} SYSTEM PRIVATE ${PYTHON_INCLUDE_DIRS} ${NUMPY_INCLUDE_DIR})
add_dependencies(espressomd ${target})
install(TARGETS ${target} LIBRARY DESTINATION ${PYTHON_INSTDIR}/espressomd)
endif()
endforeach()

Expand All @@ -124,6 +125,4 @@ foreach(auxfile ${cython_AUX})
endforeach(auxfile)

install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} DESTINATION ${PYTHON_INSTDIR}
PATTERN "CMakeFiles" EXCLUDE PATTERN "*.cpp" EXCLUDE
PATTERN "*.cmake" EXCLUDE PATTERN "Makefile" EXCLUDE)

FILES_MATCHING PATTERN "*.py")
1 change: 0 additions & 1 deletion src/script_interface/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ endif()

add_library(EspressoScriptInterface SHARED ${EspressoScriptInterface_SRC})
install(TARGETS EspressoScriptInterface LIBRARY DESTINATION ${PYTHON_INSTDIR}/espressomd)
set_target_properties(EspressoScriptInterface PROPERTIES SOVERSION ${SOVERSION})
target_link_libraries(EspressoScriptInterface PRIVATE EspressoConfig PUBLIC EspressoCore Shapes cluster_analysis mpiio pdbreader)
if(HDF5_FOUND)
target_link_libraries(EspressoScriptInterface PRIVATE H5mdCore)
Expand Down