Skip to content

Commit

Permalink
Added .DEB build to cmake.
Browse files Browse the repository at this point in the history
  • Loading branch information
angellareo committed Mar 30, 2021
1 parent 2726f72 commit 113037a
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 13 deletions.
9 changes: 9 additions & 0 deletions .Description
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
A model of the electromotor command network and a genetic algorithm
to fit neural network models to temporal output patterns.
It is written in an object oriented fashion with heavily templated C++.

To build it, just type:
> mkdir bin
> cd bin
> cmake ..
> make
22 changes: 14 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 2.8)
project(efish-nmodel CXX)
project(electromotor-nmodel CXX)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake.modules/")

Expand Down Expand Up @@ -32,22 +32,28 @@ add_custom_target(GA COMMAND make lib
)
add_subdirectory(thirdparty/Neun)
add_subdirectory(thirdparty/libStats)
add_subdirectory(include)
add_subdirectory(src)

SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Modeling the variability of the electromotor command system of pulse mormyrids.")
SET(CPACK_PACKAGE_VENDOR "Lareo, A., Varona P. and Rodriguez, FB.")
set(CPACK_PACKAGE_CONTACT "[email protected]")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "Readme.md")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/.Description")
SET(CPACK_PACKAGE_VERSION_MAJOR ${CMake_VERSION_MAJOR})
SET(CPACK_PACKAGE_VERSION_MINOR ${CMake_VERSION_MINOR})
SET(CPACK_PACKAGE_VERSION_PATCH ${CMake_VERSION_PATCH})
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}")

#SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libboost-program-options1.40.0")
#set(CPACK_DEBIAN_PACKAGE_SECTION "science")
#set(CPACK_GENERATOR "DEB")
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "A. Lareo")
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libboost-dev (>= 1.45)")
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libyaml-cpp-dev (>= 0.6.2)")
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libhdf5-dev (>= 1.10.4)")
SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libhdf5-cpp-103 (>= 1.10.4)")
SET(CPACK_DEBIAN_PACKAGE_SECTION "science")
SET(CPACK_GENERATOR "DEB")

#include(CPack)

#configure_file(neun.pc.in neun.pc @ONLY)
#install(FILES neun.pc DESTINATION pkgconfig)
include(CPack)

configure_file(electromotor-nmodel.pc.in ${CMAKE_SOURCE_DIR}/electromotor-nmodel.pc @ONLY)
install(FILES electromotor-nmodel.pc DESTINATION pkgconfig)
10 changes: 10 additions & 0 deletions electromotor-nmodel.pc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
prefix=/usr/local/electromotor-nmodel/0.1.0
exec_prefix=${prefix}
includedir=${prefix}

Name: neun
Description: Modeling the variability of the electromotor command system of pulse mormyrids.
Requires:
Version: 0.1.0
Libs:
Cflags: -I${includedir}
10 changes: 10 additions & 0 deletions electromotor-nmodel.pc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
prefix=@CMAKE_INSTALL_PREFIX@/@PROJECT_NAME@/@PROJECT_VERSION@
exec_prefix=${prefix}
includedir=${prefix}

Name: neun
Description: @CPACK_PACKAGE_DESCRIPTION_SUMMARY@
Requires:
Version: @PROJECT_VERSION@
Libs:
Cflags: -I${includedir}
2 changes: 2 additions & 0 deletions include/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# install(FILES *.h
# DESTINATION ${PROJECT_NAME}/${PROJECT_VERSION}/include)
2 changes: 1 addition & 1 deletion scripts/run-GA.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ outputDir="$vDir/ga-results/${startConfigName}_${run}"
mkdir ${outputDir}

GAParameters="G800_N150_P90"
${vDir}/bin/emmodelGAfit -i ${configFile} -g 800 -n 150 -p 90 \
${vDir}/bin/emmodelGAFit -i ${configFile} -g 800 -n 150 -p 90 \
-s "${outputDir}/${startConfigName}_${run}_${GAParameters}.stats" \
-o "${outputDir}/${startConfigName}_${run}_${GAParameters}.dat"

Expand Down
22 changes: 18 additions & 4 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,22 @@ set ( EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/bin)
add_executable(emmodel emmodel.cpp)
target_link_libraries(emmodel ${YAMLCPP_LIBRARY})

install(TARGETS emmodel
RUNTIME DESTINATION "/usr/bin"
LIBRARY DESTINATION "/usr/lib"
PUBLIC_HEADER DESTINATION "/usr/include"
DESTINATION "/usr/share"
)

link_libraries("-static")
add_executable(emmodelGAfit emmodelGAFit.cpp)
add_dependencies(emmodelGAfit GA)
set_target_properties(emmodelGAfit PROPERTIES LINK_FLAGS "-static" )
target_link_libraries(emmodelGAfit ${YAMLCPP_LIBRARY} ${CMAKE_SOURCE_DIR}/thirdparty/GA/ga/libga.a)
add_executable(emmodelGAFit emmodelGAFit.cpp)
add_dependencies(emmodelGAFit GA)
set_target_properties(emmodelGAFit PROPERTIES LINK_FLAGS "-static" )
target_link_libraries(emmodelGAFit ${YAMLCPP_LIBRARY} ${CMAKE_SOURCE_DIR}/thirdparty/GA/ga/libga.a)

install(TARGETS emmodelGAFit
RUNTIME DESTINATION "/usr/bin"
LIBRARY DESTINATION "/usr/lib"
PUBLIC_HEADER DESTINATION "/usr/include"
DESTINATION "/usr/share"
)

0 comments on commit 113037a

Please sign in to comment.