--- CMakeLists.txt_orig 2014-06-18 01:28:14.361212184 -0700
+++ CMakeLists.txt 2014-06-23 22:11:12.124786178 -0700
@@ -1,4 +1,5 @@
cmake_minimum_required (VERSION 2.6)
+SET(CMAKE_POSITION_INDEPENDENT_CODE ON)
################################################################################
# TODO: Add option to build documentation at compile time
@@ -56,10 +57,10 @@
set(TOOLS_PATH ${APBS_ROOT}/tools)
set(APBS_BINARY ${EXECUTABLE_OUTPUT_PATH}/apbs)
-set(LIBRARY_INSTALL_PATH lib)
-set(HEADER_INSTALL_PATH include/apbs)
+set(LIBRARY_INSTALL_PATH ${LIB_INSTALL_DIR})
+set(HEADER_INSTALL_PATH ${INCLUDE_INSTALL_DIR}/apbs)
set(EXECUTABLE_INSTALL_PATH bin)
-set(SHARE_INSTALL_PATH share/apbs)
+set(SHARE_INSTALL_PATH ${SHARE_INSTALL_PREFIX}/apbs)
find_file(
CONTRIB_PATH
@@ -84,14 +85,14 @@
message(STATUS "Setting lookup paths for headers and libraries")
-set(CMAKE_INCLUDE_PATH "${CMAKE_INCLUDE_PATH}")
-list(APPEND CMAKE_INCLUDE_PATH /usr/include)
-list(APPEND CMAKE_INCLUDE_PATH /usr/local/include)
-
-set(SYS_LIBPATHS "")
-list(APPEND SYS_LIBPATHS /usr/lib)
-list(APPEND SYS_LIBPATHS /usr/local/lib)
-list(APPEND SYS_LIBPATHS /lib/x86_64-linux-gnu)
+#set(CMAKE_INCLUDE_PATH "${CMAKE_INCLUDE_PATH}")
+#list(APPEND CMAKE_INCLUDE_PATH /usr/include)
+#list(APPEND CMAKE_INCLUDE_PATH /usr/local/include)
+
+#set(SYS_LIBPATHS "")
+#list(APPEND SYS_LIBPATHS /usr/lib)
+#list(APPEND SYS_LIBPATHS /usr/local/lib)
+#list(APPEND SYS_LIBPATHS /lib/x86_64-linux-gnu)
set(APBS_LIBS "")
@@ -854,29 +855,29 @@
# Set up additional directories to install #
################################################################################
-install(
- DIRECTORY ${APBS_ROOT}/doc
- DESTINATION ${SHARE_INSTALL_PATH}
-)
-
-install(
- DIRECTORY ${APBS_ROOT}/examples
- DESTINATION ${SHARE_INSTALL_PATH}
-)
-
-install(
- DIRECTORY ${APBS_ROOT}/tests
- DESTINATION ${SHARE_INSTALL_PATH}
- FILES_MATCHING
- PATTERN "*.py"
- PATTERN "README"
-)
-
-install(
- DIRECTORY ${APBS_ROOT}/tools
- DESTINATION ${SHARE_INSTALL_PATH}
- PATTERN "CMakeLists.txt" EXCLUDE
-)
+#install(
+# DIRECTORY ${APBS_ROOT}/doc
+# DESTINATION ${SHARE_INSTALL_PATH}
+#)
+
+#install(
+# DIRECTORY ${APBS_ROOT}/examples
+# DESTINATION ${SHARE_INSTALL_PATH}
+#)
+
+#install(
+# DIRECTORY ${APBS_ROOT}/tests
+# DESTINATION ${SHARE_INSTALL_PATH}
+# FILES_MATCHING
+# PATTERN "*.py"
+# PATTERN "README"
+#)
+
+#install(
+# DIRECTORY ${APBS_ROOT}/tools
+# DESTINATION ${SHARE_INSTALL_PATH}
+# PATTERN "CMakeLists.txt" EXCLUDE
+#)
--- src/CMakeLists.txt_orig 2014-06-23 19:57:35.108270115 -0700
+++ src/CMakeLists.txt 2014-06-23 22:25:44.469683936 -0700
@@ -32,10 +32,10 @@
message(STATUS "With external header files ${EXTERNAL_HEADERS}")
message(STATUS "With internal header files ${INTERNAL_HEADERS}")
message(STATUS "With library dependencies ${LIBRARY_DEPENDENCIES}")
- add_library(${LIBRARY_NAME} SHARED ${SOURCES} ${EXTERNAL_HEADERS} ${INTERNAL_HEADERS})
- target_link_libraries(${LIBRARY_NAME} ${LIBRARY_DEPENDENCIES})
+ add_library(${LIBRARY_NAME} OBJECT ${SOURCES} ${EXTERNAL_HEADERS} ${INTERNAL_HEADERS})
+ # target_link_libraries(${LIBRARY_NAME} ${LIBRARY_DEPENDENCIES})
INSTALL(FILES ${EXTERNAL_HEADERS} DESTINATION ${HEADER_INSTALL_PATH}/${LIBRARY})
- INSTALL(TARGETS ${LIBRARY_NAME} DESTINATION ${LIBRARY_INSTALL_PATH})
+ # INSTALL(TARGETS ${LIBRARY_NAME} DESTINATION ${LIBRARY_INSTALL_PATH})
list(APPEND APBS_INTERNAL_LIBS ${LIBRARY_NAME})
set(APBS_INTERNAL_LIBS ${APBS_INTERNAL_LIBS} PARENT_SCOPE)
message(STATUS "Added ${LIBRARY_NAME}")
@@ -46,12 +46,19 @@
add_subdirectory(generic)
add_subdirectory(pmgc)
add_subdirectory(mg)
+add_library(apbs SHARED $<TARGET_OBJECTS:apbs_generic> $<TARGET_OBJECTS:apbs_pmgc> $<TARGET_OBJECTS:apbs_mg>)
+# set a SOVERSION to keep packager happy
+SET_TARGET_PROPERTIES(apbs PROPERTIES SOVERSION "1")
+target_link_libraries(apbs ${LIBRARY_DEPENDENCIES})
+INSTALL(TARGETS apbs LIBRARY DESTINATION ${LIBRARY_INSTALL_PATH})
if(ENABLE_FETK)
add_subdirectory(fem)
endif(ENABLE_FETK)
-add_executable(apbs main.c apbs.h routines.c routines.h)
-target_link_libraries(apbs ${APBS_LIBS} ${APBS_INTERNAL_LIBS})
+add_executable(apbs-bin main.c apbs.h routines.c routines.h)
+# target_link_libraries(apbs ${APBS_LIBS} ${APBS_INTERNAL_LIBS)}
+target_link_libraries(apbs-bin ${APBS_LIBS} apbs)
+SET_TARGET_PROPERTIES(apbs-bin PROPERTIES OUTPUT_NAME apbs)
configure_file(
${APBS_ROOT}/src/config/apbscfg.h.in
@@ -59,4 +66,4 @@
)
INSTALL(FILES apbs.h routines.h DESTINATION ${HEADER_INSTALL_PATH})
-INSTALL(TARGETS apbs DESTINATION ${EXECUTABLE_INSTALL_PATH})
+INSTALL(TARGETS apbs-bin DESTINATION ${EXECUTABLE_INSTALL_PATH})
--- tools/manip/CMakeLists.txt_orig 2014-06-23 20:06:51.205468128 -0700
+++ tools/manip/CMakeLists.txt 2014-06-23 22:17:44.103764752 -0700
@@ -1,9 +1,10 @@
message(STATUS "Building manip")
set(LIBS "")
-list(APPEND LIBS "apbs_generic")
-list(APPEND LIBS "apbs_mg")
-list(APPEND LIBS "apbs_pmgc")
+#list(APPEND LIBS "apbs_generic")
+#list(APPEND LIBS "apbs_mg")
+#list(APPEND LIBS "apbs_pmgc")
+list(APPEND LIBS "apbs")
if(FETK_ENALBED)
list(APPEND LIBS "apbs_fem")
endif(FETK_ENALBED)
@@ -11,7 +12,9 @@
message(STATUS "libraries: ${LIBS}")
add_executable(coulomb coulomb.c)
-target_link_libraries(coulomb ${LIBS})
+target_link_libraries(coulomb ${LIBS} ${APBS_LIBS})
add_executable(born born.c)
-target_link_libraries(born ${LIBS})
+target_link_libraries(born ${LIBS} ${APBS_LIBS})
+
+INSTALL(TARGETS coulomb born DESTINATION ${EXECUTABLE_INSTALL_PATH})
--- tools/mesh/CMakeLists.txt_orig 2014-06-23 19:47:12.897442708 -0700
+++ tools/mesh/CMakeLists.txt 2014-06-23 22:16:27.230896796 -0700
@@ -1,9 +1,10 @@
message(STATUS "Building mesh")
set(LIBS "")
-list(APPEND LIBS "apbs_generic")
-list(APPEND LIBS "apbs_mg")
-list(APPEND LIBS "apbs_pmgc")
+#list(APPEND LIBS "apbs_generic")
+#list(APPEND LIBS "apbs_mg")
+#list(APPEND LIBS "apbs_pmgc")
+list(APPEND LIBS "apbs")
if(FETK_ENALBED)
list(APPEND LIBS "apbs_fem")
endif(FETK_ENALBED)
@@ -11,46 +12,48 @@
message(STATUS "libraries: ${LIBS}")
add_executable(mgmesh mgmesh.c)
-target_link_libraries(mgmesh ${LIBS})
+target_link_libraries(mgmesh ${LIBS} ${APBS_LIBS})
add_executable(smooth smooth.c)
-target_link_libraries(smooth ${LIBS})
+target_link_libraries(smooth ${LIBS} ${APBS_LIBS})
add_executable(dxmath dxmath.c)
-target_link_libraries(dxmath ${LIBS})
+target_link_libraries(dxmath ${LIBS} ${APBS_LIBS})
add_executable(mergedx mergedx.c)
-target_link_libraries(mergedx ${LIBS})
+target_link_libraries(mergedx ${LIBS} ${APBS_LIBS})
add_executable(mergedx2 mergedx2.c)
-target_link_libraries(mergedx2 ${LIBS})
+target_link_libraries(mergedx2 ${LIBS} ${APBS_LIBS})
add_executable(value value.c)
-target_link_libraries(value ${LIBS})
+target_link_libraries(value ${LIBS} ${APBS_LIBS})
add_executable(multivalue multivalue.c)
-target_link_libraries(multivalue ${LIBS})
+target_link_libraries(multivalue ${LIBS} ${APBS_LIBS})
add_executable(benchmark benchmark.c)
-target_link_libraries(benchmark ${LIBS})
+target_link_libraries(benchmark ${LIBS} ${APBS_LIBS})
add_executable(similarity similarity.c)
-target_link_libraries(similarity ${LIBS})
+target_link_libraries(similarity ${LIBS} ${APBS_LIBS})
add_executable(analysis analysis.c)
-target_link_libraries(analysis ${LIBS})
+target_link_libraries(analysis ${LIBS} ${APBS_LIBS})
add_executable(dx2mol dx2mol.c)
-target_link_libraries(dx2mol ${LIBS})
+target_link_libraries(dx2mol ${LIBS} ${APBS_LIBS})
add_executable(dx2uhbd dx2uhbd.c)
-target_link_libraries(dx2uhbd ${LIBS})
+target_link_libraries(dx2uhbd ${LIBS} ${APBS_LIBS})
add_executable(del2dx del2dx.c)
-target_link_libraries(del2dx ${LIBS})
+target_link_libraries(del2dx ${LIBS} ${APBS_LIBS})
add_executable(tensor2dx tensor2dx.c)
-target_link_libraries(tensor2dx ${LIBS})
+target_link_libraries(tensor2dx ${LIBS} ${APBS_LIBS})
add_executable(uhbd_asc2bin uhbd_asc2bin.c)
-target_link_libraries(uhbd_asc2bin ${LIBS})
+target_link_libraries(uhbd_asc2bin ${LIBS} ${APBS_LIBS})
+
+INSTALL(TARGETS mgmesh smooth dxmath mergedx mergedx2 value multivalue benchmark similarity analysis dx2mol dx2uhbd del2dx tensor2dx uhbd_asc2bin DESTINATION ${EXECUTABLE_INSTALL_PATH})