mirror of
https://github.com/arcan1s/moldyn.git
synced 2025-07-23 02:29:58 +00:00
refactoring
This commit is contained in:
@ -1,23 +1,33 @@
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
cmake_minimum_required (VERSION 2.8)
|
||||
|
||||
project(statgen)
|
||||
cmake_policy(SET CMP0011 NEW)
|
||||
cmake_policy(SET CMP0003 OLD)
|
||||
|
||||
set(MY_CXX_FLAGS "-Wall")
|
||||
set(CMAKE_CXX_FLAGS "-O0 ${MY_CXX_FLAGS}")
|
||||
set(CMAKE_SHARED_LINKER_FLAGS "-lm")
|
||||
# set project name
|
||||
set (PROJECT statgen)
|
||||
# set additional cmake file
|
||||
include (${PROJECT}.cmake)
|
||||
|
||||
set(SOURCE_EXE main.c)
|
||||
set(SOURCE_LIB add_main.c
|
||||
coords.c
|
||||
graph.c
|
||||
int2char.c
|
||||
messages.c
|
||||
stat_print.c
|
||||
stat_select.c
|
||||
stat_sort.c
|
||||
summary_stat.c)
|
||||
|
||||
add_library(stat SHARED ${SOURCE_LIB})
|
||||
add_executable(statgen ${SOURCE_EXE})
|
||||
# additional options
|
||||
OPTION (WITH_DEBUG_MODE "Build with debug mode" ON)
|
||||
OPTION (ADD_INCLUDE "Add include files" ON)
|
||||
|
||||
target_link_libraries(statgen stat)
|
||||
# set libraries
|
||||
set (LIBRARIES)
|
||||
foreach (LIBRARY ${LIBRARIES})
|
||||
find_library ("${LIBRARY}_FOUND" ${LIBRARY})
|
||||
message (STATUS "Check the ${LIBRARY} is installed: " ${${LIBRARY}_FOUND})
|
||||
if ("${${LIBRARY}_FOUND}" STREQUAL "${LIBRARY}_FOUND-NOTFOUND")
|
||||
message (STATUS "Adding library sources")
|
||||
add_subdirectory (../${LIBRARY} lib/${LIBRARY})
|
||||
endif ()
|
||||
endforeach ()
|
||||
|
||||
# additional targets
|
||||
set (TARGETS "")
|
||||
set (HEADERS "")
|
||||
|
||||
message (STATUS "SOURCES: ${SOURCES}")
|
||||
|
||||
add_subdirectory (src)
|
Reference in New Issue
Block a user