mirror of
https://github.com/arcan1s/moldyn.git
synced 2025-07-13 22:05:50 +00:00
refactoring
This commit is contained in:
61
statgen/src/CMakeLists.txt
Normal file
61
statgen/src/CMakeLists.txt
Normal file
@ -0,0 +1,61 @@
|
||||
set ("${PROJECT}_VERSION_MAJOR" 1)
|
||||
set ("${PROJECT}_VERSION_MINOR" 0)
|
||||
set ("${PROJECT}_VERSION_PATCH" 1)
|
||||
set ("${PROJECT}_VERSION" ${${PROJECT}_VERSION_MAJOR}.${${PROJECT}_VERSION_MINOR}.${${PROJECT}_VERSION_PATCH})
|
||||
|
||||
message (STATUS ${${PROJECT}_VERSION})
|
||||
|
||||
## set files
|
||||
# main files
|
||||
set (MAIN_SOURCES main)
|
||||
# not public srcs
|
||||
set (PRIVATE_CLASSES)
|
||||
# headers only files
|
||||
SET (HEADERS_ONLY)
|
||||
# public srcs
|
||||
set (PUBLIC_CLASSES add_main
|
||||
coords
|
||||
graph
|
||||
int2char
|
||||
messages
|
||||
stat_print
|
||||
stat_select
|
||||
stat_sort
|
||||
summary_stat)
|
||||
# public headers
|
||||
set (PUBLIC_HEADERS)
|
||||
# shared libraries
|
||||
if (CMAKE_COMPILER_IS_GNUCXX)
|
||||
set (ADDITIONAL_LIB m)
|
||||
else ()
|
||||
set (ADDITIONAL_LIB)
|
||||
endif()
|
||||
set (SOURCES)
|
||||
|
||||
# append list
|
||||
foreach (class ${PRIVATE_CLASSES})
|
||||
LIST (APPEND SOURCES ${class}.c)
|
||||
LIST (APPEND HEADERS ${class}.h)
|
||||
endforeach ()
|
||||
|
||||
foreach (class ${HEADERS_ONLY})
|
||||
LIST (APPEND HEADERS ${class}.h)
|
||||
endforeach ()
|
||||
|
||||
foreach (class ${PUBLIC_CLASSES})
|
||||
LIST (APPEND SOURCES ${class}.c)
|
||||
LIST (APPEND HEADERS ../include/${PROJECT}/${class}.h)
|
||||
LIST (APPEND PUBLIC_HEADERS ../include/${PROJECT}/${class}.h)
|
||||
endforeach ()
|
||||
|
||||
# link libraries and compile
|
||||
add_executable (${PROJECT} ${MAIN_SOURCES} ${SOURCES})
|
||||
target_link_libraries (${PROJECT} ${ADDITIONAL_LIB})
|
||||
|
||||
# install properties
|
||||
INSTALL (TARGETS ${PROJECT}
|
||||
DESTINATION bin)
|
||||
if (ADD_INCLUDE)
|
||||
INSTALL (FILES ${PUBLIC_HEADERS}
|
||||
DESTINATION include/${PROJECT})
|
||||
endif ()
|
Reference in New Issue
Block a user