--- imach/CMakeLists.txt 2019/05/09 15:04:48 1.20 +++ imach/CMakeLists.txt 2019/05/21 15:55:06 1.21 @@ -8,7 +8,7 @@ # SET (CMAKE_CONFIGURATION_TYPES "Debug;RelWithDebinfo" CACHE STRING "" FORCE) set(PACKAGE_NAME "imach") SET(IMACH_VERSION_MAJOR 0) -SET(IMACH_VERSION_MINOR 99r18) +SET(IMACH_VERSION_MINOR 99r19) SET(IMACH_VERSION_PATCH 0) SET(IMACH_VERSION_NOTE "") SET(IMACH_VERSION ${IMACH_VERSION_MAJOR}.${IMACH_VERSION_MINOR}) @@ -54,12 +54,14 @@ CONFIGURE_FILE("${PROJECT_SOURCE_DIR}/te set (imach_SRCS ./src/imach.c) SET( CMAKE_VERBOSE_MAKEFILE on ) -ADD_EXECUTABLE ( IMaCh-${IMACH_VERSION_MAJOR}.${IMACH_VERSION_MINOR} ${imach_SRCS}) +#SET(CMAKE_INSTALL_PREFIX "/usr/local") +ADD_EXECUTABLE (IMaCh-${IMACH_VERSION_MAJOR}.${IMACH_VERSION_MINOR} ${imach_SRCS}) INSTALL(TARGETS IMaCh-${IMACH_VERSION_MAJOR}.${IMACH_VERSION_MINOR} DESTINATION bin COMPONENT binaries ) +#INSTALL(TARGETS imach DESTINATION bin COMPONENT binaries ) ADD_SUBDIRECTORY(html) ADD_SUBDIRECTORY(tests) -ADD_SUBDIRECTORY(src) -ADD_SUBDIRECTORY(distributions) +#ADD_SUBDIRECTORY(src) +#ADD_SUBDIRECTORY(distributions) #if (${WIN32}) #if(APPLE) # set(DOCDIR "${CMAKE_INSTALL_PREFIX}/${PROJECT_NAME}/doc") @@ -69,7 +71,8 @@ if(UNIX) target_link_libraries(IMaCh-${IMACH_VERSION_MAJOR}.${IMACH_VERSION_MINOR} m) set(BINDIR "${CMAKE_INSTALL_PREFIX}/bin") set(DOCDIR "${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME}/doc") - set(MANDIR "${CMAKE_INSTALL_PREFIX}/share/man") + set(TESTDIR "${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME}/tests") + set(MANDIR "${CMAKE_INSTALL_PREFIX}/share/man/man1") #set(EXAMPLE_CONF_DIR ${DOCDIR}) set(XDG_APPS_DIR "${CMAKE_INSTALL_PREFIX}/share/applications") set(APPDATADIR "${CMAKE_INSTALL_PREFIX}/share/appdata") @@ -90,6 +93,10 @@ install(FILES "html/doc/mypar.imach" DES install(FILES "html/doc/data/mydata.txt" DESTINATION "${DOCDIR}/data") install(FILES "html/doc/biaspar.imach" DESTINATION "${DOCDIR}") install(FILES "html/doc/data1.txt" DESTINATION "${DOCDIR}") +install(FILES "src/README.txt" DESTINATION "${DOCDIR}") +install(FILES "distributions/gnulinux/imach.1" DESTINATION "${MANDIR}") +install(FILES "distributions/gnulinux/imach.png" DESTINATION "${ICONDIR}") +install(FILES "distributions/gnulinux/imach.desktop" DESTINATION "${XDG_APPS_DIR}") #not working install(FILES "imach.desktop" DESTINATION "${XDG_APPS_DIR}") #install(FILES "html" DESTINATION "${DOCDIR}") @@ -99,19 +106,45 @@ set(CPACK_PACKAGE_NAME "imach") set(CPACK_PACKAGE_RELEASE 1) set(CPACK_PACKAGE_CONTACT "Nicolas Brouard") set(CPACK_PACKAGE_VENDOR "INED") -SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "IMaCh Interpolated Markov Chain program") SET(CPACK_PACKAGE_VENDOR "IMaCh, INED") -SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README.txt") +SET(CPACK_PACKAGE_LICENSE "GPLv2") SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt") SET(CPACK_PACKAGE_VERSION_MAJOR "${IMACH_VERSION_MAJOR}") SET(CPACK_PACKAGE_VERSION_MINOR "${IMACH_VERSION_MINOR}") SET(CPACK_PACKAGE_VERSION_PATCH "${IMACH_VERSION_PATCH}") SET(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}") +#SET(CPACK_INSTALLED_DIRECTORIES "${PROJECT_SOURCE_DIR}" ".") #SET(CPACK_PACKAGE_EXECUTABLES "IMaCh" "IMaCh") SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "IMaCh program estimates Health Expectancies from Cross-longitudinal surveys.") +#SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README.txt") SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/imach-desc.txt") -#set(CPACK_PACKAGING_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}) -set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_PACKAGE_RELEASE}.${CMAKE_SYSTEM_PROCESSOR}") +set(CPACK_RPM_PACKAGE_URL "http://euroreves.ined.fr/imach") +IF(UNIX) + SET(CPACK_RPM_PACKAGE_LICENSE "GPL") + SET(CPACK_RPM_PACKAGE_GROUP "Applications/Sciences") + SET(CPACK_RPM_PACKAGE_REQUIRES "gnuplot >= 4.2, cmake >= 2.8") + SET(CPACK_GENERATOR "TXZ") + SET(CPACK_SOURCE_GENERATOR "TXZ") + SET(CPACK_SOURCE_TBZ2 "OFF") + SET(CPACK_SOURCE_TGZ "ON") + SET(CPACK_SOURCE_TOPLEVEL_TAG "Linux-src") + SET(CPACK_SOURCE_TXZ "ON") + SET(CPACK_SOURCE_TZ "ON") + SET(CPACK_SOURCE_ZIP "OFF") + #SET(CPACK_RPM_PREFIX "/usr/local") + # SET(CPACK_RPM_PACKAGE_PREFIX "/usr/local") + SET(CPACK_PACKAGING_INSTALL_PREFIX "/usr/local") + # SET(CMAKE_INSTALL_PREFIX "/usr/local") + set(CPACK_RPM_PACKAGE_RELOCATABLE True) + # This a .spec Changelog not an Emacs ChangeLog that you get with C-x v a (vc-update-change-log) + # * Mon May 20 2019 Brouard Nicolas + # ${CMAKE_CURRENT_SOURCE_DIR}/specchangelog") + set(CPACK_RPM_CHANGELOG_FILE "${PROJECT_SOURCE_DIR}/src/Changelog") + SET(CPACK_BINARY_RPM "ON") + SET(CPACK_RPM_PACKAGE_SOURCES "ON") + set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_PACKAGE_RELEASE}.${CMAKE_SYSTEM_PROCESSOR}") + SET(CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_PACKAGE_RELEASE}.src") +ENDIF(UNIX) IF(WIN32 AND NOT UNIX) # There is a bug in NSI that does not handle full unix paths properly. Make @@ -183,13 +216,13 @@ endforeach( parameter_file ) #add_custom_target( CopyParameter ALL DEPENDS ${parameter_files_dest} ) ENABLE_TESTING() -ADD_SUBDIRECTORY(html/doc) -ADD_SUBDIRECTORY(html/doc/data) -install(FILES "${PROJECT_SOURCE_DIR}/html/doc/mypar.imach" DESTINATION "html/doc/mypar.imach") +#ADD_SUBDIRECTORY(html/doc) +#ADD_SUBDIRECTORY(html/doc/data) +#install(FILES "${PROJECT_SOURCE_DIR}/html/doc/mypar.imach" DESTINATION "html/doc") ADD_TEST(testV2.imach IMaCh-${IMACH_VERSION} tests/testV2.imach ) ADD_TEST(testV1V2.imach IMaCh-${IMACH_VERSION} tests/testV1V2.imach ) -ADD_TEST(mypar IMaCh-${IMACH_VERSION} html/doc/mypar.imach ) -ADD_TEST(biaspar IMaCh-${IMACH_VERSION} html/doc/biaspar.imach ) +ADD_TEST(mypar IMaCh-${IMACH_VERSION} local/html/doc/ ) +ADD_TEST(biaspar IMaCh-${IMACH_VERSION} local/html/doc/ ) #SET(FAB "po" CACHE STRING "Some user-specified option") #set_target_properties(TARGET_NAME imach-${VERSION_MAJOR}.${VERSION_MINOR}) #%comspec% /k ""C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\VsDevCmd.bat"" @@ -244,17 +277,17 @@ ADD_TEST(biaspar IMaCh-${IMACH_VERSION} # endif() # Add a target to generate API documentation with Doxygen option(BUILD_DOC "Build documentation" ON) -if(UNIX) +if(UNIXDODOXYGEN) find_package(Doxygen) if(DOXYGEN_FOUND)# set input and output files #set(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/../docs/Doxyfile.in) ~/Documents/imach/cvs/imach/latex/Doxyfile.in set(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/latex/Doxyfile.in) set(DOXYGEN_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile) - + # request to configure the file configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY) message("Doxygen build started") - + # note the option ALL which allows to build the docs together with the application add_custom_target( doc_doxygen ALL COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT} @@ -262,10 +295,9 @@ if(UNIX) COMMENT "Generating API documentation with Doxygen in gnulinux/html/index.html" VERBATIM ) install(DIRECTORY ${CMAKE_BINARY_DIR}/html - DESTINATION share/doc/${CMAKE_PROJECT_NAME}) + DESTINATION local/share/doc/${CMAKE_PROJECT_NAME}) else (DOXYGEN_FOUND) message("Doxygen need to be installed to generate the doxygen documentation") endif (DOXYGEN_FOUND) -else (UNIX) message("Doxygen only in UNIX doxygen documentation") -endif (UNIX) \ No newline at end of file +endif (UNIXDODOXYGEN)