--- CMakeLists.txt.orig 2022-10-12 09:39:16 UTC +++ CMakeLists.txt @@ -279,9 +279,9 @@ FILE(GLOB HEADERS *.h) ADD_LIBRARY(liggghts_obj OBJECT ${SOURCES}) -ADD_LIBRARY(liggghts_static STATIC $) -SET_TARGET_PROPERTIES(liggghts_static PROPERTIES OUTPUT_NAME liggghts) -SET_PROPERTY(TARGET liggghts_static PROPERTY PUBLIC_HEADER ${HEADERS}) +#ADD_LIBRARY(liggghts_static STATIC $) +#SET_TARGET_PROPERTIES(liggghts_static PROPERTIES OUTPUT_NAME liggghts) +#SET_PROPERTY(TARGET liggghts_static PROPERTY PUBLIC_HEADER ${HEADERS}) ADD_LIBRARY(liggghts_shared SHARED $) SET_TARGET_PROPERTIES(liggghts_shared PROPERTIES OUTPUT_NAME liggghts) @@ -296,18 +296,18 @@ IF(ENABLE_MPI) IF(MPI_FOUND) INCLUDE_DIRECTORIES(${MPI_INCLUDE_PATH}) - TARGET_LINK_LIBRARIES(liggghts_static ${MPI_LIBRARIES}) + #TARGET_LINK_LIBRARIES(liggghts_static ${MPI_LIBRARIES}) TARGET_LINK_LIBRARIES(liggghts_shared ${MPI_LIBRARIES}) TARGET_LINK_LIBRARIES(liggghts_bin ${MPI_LIBRARIES}) IF(MPI_COMPILE_FLAGS) - SET_TARGET_PROPERTIES(liggghts_static PROPERTIES COMPILE_FLAGS "${MPI_COMPILE_FLAGS}") + #SET_TARGET_PROPERTIES(liggghts_static PROPERTIES COMPILE_FLAGS "${MPI_COMPILE_FLAGS}") SET_TARGET_PROPERTIES(liggghts_shared PROPERTIES COMPILE_FLAGS "${MPI_COMPILE_FLAGS}") SET_TARGET_PROPERTIES(liggghts_bin PROPERTIES COMPILE_FLAGS "${MPI_COMPILE_FLAGS}") ENDIF() IF(MPI_LINK_FLAGS) - SET_TARGET_PROPERTIES(liggghts_static PROPERTIES LINK_FLAGS "${MPI_LINK_FLAGS}") + #SET_TARGET_PROPERTIES(liggghts_static PROPERTIES LINK_FLAGS "${MPI_LINK_FLAGS}") SET_TARGET_PROPERTIES(liggghts_shared PROPERTIES LINK_FLAGS "${MPI_LINK_FLAGS}") SET_TARGET_PROPERTIES(liggghts_bin PROPERTIES LINK_FLAGS "${MPI_LINK_FLAGS}") ENDIF() @@ -328,7 +328,7 @@ IF(ENABLE_VTK) IF(VTK_FOUND) INCLUDE(${VTK_USE_FILE}) ADD_DEFINITIONS(-DLAMMPS_VTK) - TARGET_LINK_LIBRARIES(liggghts_static ${VTK_LIBRARIES}) + #TARGET_LINK_LIBRARIES(liggghts_static ${VTK_LIBRARIES}) TARGET_LINK_LIBRARIES(liggghts_shared ${VTK_LIBRARIES}) TARGET_LINK_LIBRARIES(liggghts_bin ${VTK_LIBRARIES}) @@ -349,7 +349,7 @@ IF(ENABLE_JPEG) IF(JPEG_FOUND) INCLUDE_DIRECTORIES(${JPEG_INCLUDE_DIR}) ADD_DEFINITIONS(-DLAMMPS_JPEG) - TARGET_LINK_LIBRARIES(liggghts_static jpeg) + #TARGET_LINK_LIBRARIES(liggghts_static jpeg) TARGET_LINK_LIBRARIES(liggghts_shared jpeg) TARGET_LINK_LIBRARIES(liggghts_bin jpeg) SET(ENABLED_OPTIONS "${ENABLED_OPTIONS} JPEG") @@ -367,7 +367,7 @@ IF(ENABLE_PNG) IF(PNG_FOUND) INCLUDE_DIRECTORIES(${PNG_INCLUDE_DIR}) ADD_DEFINITIONS(-DLAMMPS_PNG) - TARGET_LINK_LIBRARIES(liggghts_static ${PNG_LIBRARY}) + #TARGET_LINK_LIBRARIES(liggghts_static ${PNG_LIBRARY}) TARGET_LINK_LIBRARIES(liggghts_shared ${PNG_LIBRARY}) TARGET_LINK_LIBRARIES(liggghts_bin ${PNG_LIBRARY}) SET(ENABLED_OPTIONS "${ENABLED_OPTIONS} PNG") @@ -398,7 +398,7 @@ IF(ENABLE_FFMPEG) ) INCLUDE_DIRECTORIES(${AVCODEC_INCLUDE_DIR} ${AVFORMAT_INCLUDE_DIR} ${AVUTIL_INCLUDE_DIR}) ADD_DEFINITIONS(-DLAMMPS_FFMPEG) - TARGET_LINK_LIBRARIES(liggghts_static ${AVCODEC_LIBRARY} ${AVFORMAT_LIBRARY} ${AVUTIL_LIBRARY}) + #TARGET_LINK_LIBRARIES(liggghts_static ${AVCODEC_LIBRARY} ${AVFORMAT_LIBRARY} ${AVUTIL_LIBRARY}) TARGET_LINK_LIBRARIES(liggghts_shared ${AVCODEC_LIBRARY} ${AVFORMAT_LIBRARY} ${AVUTIL_LIBRARY}) TARGET_LINK_LIBRARIES(liggghts_bin ${AVCODEC_LIBRARY} ${AVFORMAT_LIBRARY} ${AVUTIL_LIBRARY}) @@ -436,7 +436,7 @@ IF(ENABLE_SQ) IF(Boost_FOUND) INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR}) ADD_DEFINITIONS(-DSUPERQUADRIC_ACTIVE_FLAG -DNONSPHERICAL_ACTIVE_FLAG) - TARGET_LINK_LIBRARIES(liggghts_static ${Boost_LIBRARY}) + #TARGET_LINK_LIBRARIES(liggghts_static ${Boost_LIBRARY}) TARGET_LINK_LIBRARIES(liggghts_shared ${Boost_LIBRARY}) TARGET_LINK_LIBRARIES(liggghts_bin ${Boost_LIBRARY}) @@ -494,11 +494,11 @@ MESSAGE(STATUS "Enabled models:${ENABLED_MODELS}") MESSAGE(STATUS "=======================================") #======================================= -INSTALL(TARGETS liggghts_bin liggghts_static liggghts_shared +INSTALL(TARGETS liggghts_bin liggghts_shared RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib - PUBLIC_HEADER DESTINATION include) + PUBLIC_HEADER DESTINATION include/liggghts) IF(WIN32) INSTALL(DIRECTORY WINDOWS DESTINATION include) ENDIF()