Annotation of imach/CMakeLists.txt, revision 1.5

1.1       brouard     1: # if(CMAKE_CONFIGURATION_TYPES)
                      2: # #   set(CMAKE_CONFIGURATION_TYPES Debug Release DebugMX31 ReleaseMX31)
                      3: #    set(CMAKE_CONFIGURATION_TYPES Debug Release)
                      4: #    set(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE STRING
                      5: #      "Reset the configurations to what we need"
                      6: #      FORCE)
                      7: #  endif()
                      8: # SET (CMAKE_CONFIGURATION_TYPES "Debug;RelWithDebinfo" CACHE STRING "" FORCE)
                      9: SET(IMACH_VERSION_MAJOR 0)
1.5     ! brouard    10: SET(IMACH_VERSION_MINOR 98r0)
1.1       brouard    11: SET(IMACH_VERSION_PATCH 0)
                     12: SET(IMACH_VERSION_NOTE "")
                     13: SET(IMACH_VERSION ${IMACH_VERSION_MAJOR}.${IMACH_VERSION_MINOR})
1.5     ! brouard    14: SET(@APPNAME@ IMaCh-${IMACH_VERSION_MAJOR}.${IMACH_VERSION_MINOR})
        !            15: SET(@NOTINNOREG@ )
        !            16: SET(@NOREG@ )
        !            17: SET(@IMACHSETUPVERSION@ imach-${IMACH_VERSION_MAJOR}.${IMACH_VERSION_MINOR}-icl-setup)
        !            18: SET(@APPCOMPILATIONMODE@ icl)
        !            19: SET(@VERSION@ ${IMACH_VERSION_MAJOR}.${IMACH_VERSION_MINOR})
        !            20: SET(@GNUPLOTVERSION@ 4.6)
        !            21: SET(@INFOBEFOREFILE@ README.txt)
        !            22: SET(@LICENSEFILE@ Copying)
        !            23: SET(@PACKAGE@ imach)
        !            24: SET(@DICTLANG@ en)
        !            25: SET(@VERMAJOR@ )
        !            26: SET(@COPYRIGHT@ "Copyright (C)  2002-2015 INED-EUROREVES-Institut de longevite-Japan Society for the Promotion of Science (Grant-in-Aid for Scientific Research 25293121) - Intel Software 2015")
1.1       brouard    27: #SET(IMACH_VERSION ${IMACH_VERSION_MAJOR}.${IMACH_VERSION_MINOR}.${IMACH_VERSION_PATCH})
                     28: #MATH(EXPR IMACH_VERSION_NUMBER "100000*${IMACH_VERSION_MAJOR} + 100*${IMACH_VERSION_MINOR} + ${IMACH_VERSION_PATCH}")
                     29: 
                     30: # #PROJECT(IMaCh${IMACH_VERSION_MAJOR})
                     31: PROJECT (IMaCh)
                     32: 
                     33: CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11)
                     34: 
                     35: CONFIGURE_FILE(
                     36:   "${PROJECT_SOURCE_DIR}/version.h.in"
1.2       brouard    37:   "${PROJECT_SOURCE_DIR}/src/version.h"
1.1       brouard    38:   )
                     39: CONFIGURE_FILE(
                     40:   "${PROJECT_SOURCE_DIR}/config.h.in"
                     41:   "${PROJECT_BINARY_DIR}/config.h"
                     42: )
1.5     ! brouard    43: # Examples for the documentation
1.4       brouard    44: CONFIGURE_FILE("${PROJECT_SOURCE_DIR}/tests/mypar.imach.in" "html/doc/mypar.imach")
                     45: CONFIGURE_FILE("${PROJECT_SOURCE_DIR}/tests/biaspar.imach.in" "html/doc/biaspar.imach")
                     46: CONFIGURE_FILE("${PROJECT_SOURCE_DIR}/tests/data1.txt" "html/doc/data1.txt" COPYONLY)
                     47: CONFIGURE_FILE("${PROJECT_SOURCE_DIR}/tests/data/mydata.txt" "html/doc/data/mydata.txt" COPYONLY)
1.5     ! brouard    48: # Test files
        !            49: CONFIGURE_FILE("${PROJECT_SOURCE_DIR}/tests/data/data2.txt" "tests/data/data2.txt" COPYONLY)
        !            50: CONFIGURE_FILE("${PROJECT_SOURCE_DIR}/tests/testV2.imach" "tests/testV2.imach" COPYONLY)
        !            51: CONFIGURE_FILE("${PROJECT_SOURCE_DIR}/tests/testV1V2.imach" "tests/testV1V2.imach" COPYONLY)
        !            52: 
1.1       brouard    53: 
                     54: set (imach_SRCS ./src/imach.c)
                     55: SET( CMAKE_VERBOSE_MAKEFILE on )
                     56: ADD_EXECUTABLE ( IMaCh-${IMACH_VERSION_MAJOR}.${IMACH_VERSION_MINOR} ${imach_SRCS})
                     57: INSTALL(TARGETS IMaCh-${IMACH_VERSION_MAJOR}.${IMACH_VERSION_MINOR} DESTINATION bin COMPONENT binaries )
                     58: ADD_SUBDIRECTORY(html)
1.4       brouard    59: ADD_SUBDIRECTORY(tests)
1.1       brouard    60: ADD_SUBDIRECTORY(src)
                     61: ADD_SUBDIRECTORY(distributions)
                     62: #if (${WIN32})
1.3       brouard    63: #if(APPLE)
                     64: #  set(DOCDIR "${CMAKE_INSTALL_PREFIX}/${PROJECT_NAME}/doc")
                     65: #endif()
1.1       brouard    66: if(UNIX)
                     67:   #   set(CMAKE_CXX_COMPILER "gcc")
                     68:   target_link_libraries(IMaCh-${IMACH_VERSION_MAJOR}.${IMACH_VERSION_MINOR} m)
                     69:   set(BINDIR "${CMAKE_INSTALL_PREFIX}/bin")
                     70:   set(DOCDIR "${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME}/doc")
                     71:   set(MANDIR "${CMAKE_INSTALL_PREFIX}/share/man")
                     72:   #set(EXAMPLE_CONF_DIR ${DOCDIR})
                     73:   set(XDG_APPS_DIR "${CMAKE_INSTALL_PREFIX}/share/applications")
                     74:   set(APPDATADIR "${CMAKE_INSTALL_PREFIX}/share/appdata")
                     75:   set(ICONDIR "${CMAKE_INSTALL_PREFIX}/share/icons")
                     76: endif()
                     77: if(MSVC)
1.2       brouard    78:   set(DOCDIR "${CMAKE_INSTALL_PREFIX}/${PROJECT_NAME}/doc")
1.1       brouard    79:   set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MTd")
                     80:   set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MT")
                     81:   set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MTd")
                     82:   set(CMAKE_CONFIGURATION_TYPES:STRING=Release)
                     83:   ADD_DEFINITIONS( -DCONSOLE)
                     84:   ADD_DEFINITIONS( -D_CONSOLE)
                     85: endif()
                     86: ADD_DEFINITIONS( -DCROSS=0)
                     87: 
                     88: install(FILES "html/doc/mypar.imach" DESTINATION "${DOCDIR}")
                     89: install(FILES "html/doc/data/mydata.txt" DESTINATION "${DOCDIR}/data")
                     90: install(FILES "html/doc/biaspar.imach" DESTINATION "${DOCDIR}")
                     91: install(FILES "html/doc/data1.txt" DESTINATION "${DOCDIR}")
                     92: #install(FILES "html" DESTINATION "${DOCDIR}")
                     93: 
                     94: set(CPACK_PACKAGE_VERSION ${IMACH_VERSION})
                     95: set(CPACK_PACKAGE_NAME "IMaCh")
                     96: set(CPACK_PACKAGE_RELEASE 2)
                     97: set(CPACK_PACKAGE_CONTACT "Nicolas Brouard")
                     98: set(CPACK_PACKAGE_VENDOR "INED")
                     99: SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "IMaCh Interpolated Markov Chain program")
                    100: SET(CPACK_PACKAGE_VENDOR "IMaCh, INED")
                    101: SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README.txt")
                    102: SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt")
                    103: SET(CPACK_PACKAGE_VERSION_MAJOR "${IMACH_VERSION_MAJOR}")
                    104: SET(CPACK_PACKAGE_VERSION_MINOR "${IMACH_VERSION_MINOR}")
                    105: SET(CPACK_PACKAGE_VERSION_PATCH "${IMACH_VERSION_PATCH}")
                    106: SET(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}")
                    107: #SET(CPACK_PACKAGE_EXECUTABLES "IMaCh" "IMaCh")
                    108: SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "IMaCh program estimates Health Expectancies from Cross-longitudinal surveys.")
                    109: SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/imach-desc.txt")
                    110: #set(CPACK_PACKAGING_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
                    111: set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_PACKAGE_RELEASE}.${CMAKE_SYSTEM_PROCESSOR}")
                    112: 
                    113: IF(WIN32 AND NOT UNIX)
                    114:   # There is a bug in NSI that does not handle full unix paths properly. Make
                    115:   # sure there is at least one set of four (4) backlasshes.
                    116:   SET(CPACK_PACKAGE_ICON "${CMake_SOURCE_DIR}/Utilities/Release\\\\InstallIcon.bmp")
                    117:   SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\imach.exe")
                    118:   SET(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} IMaCh")
                    119:   SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\euroreves.ined.fr/imach/wiki")
                    120:   SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\euroreves.ined.fr/imach")
                    121:   SET(CPACK_NSIS_CONTACT "brouard@ined.fr")
                    122:   SET(CPACK_NSIS_MODIFY_PATH ON)
                    123: ELSE(WIN32 AND NOT UNIX)
                    124:   SET(CPACK_STRIP_FILES "bin/imach")
                    125:   SET(CPACK_SOURCE_STRIP_FILES "")
                    126: ENDIF(WIN32 AND NOT UNIX)
                    127: #SET(CPACK_PACKAGE_EXECUTABLES "IMaCh" "IMaCh")
                    128: INCLUDE(CPack)
                    129: 
                    130:   # set (CMAKE_GENERATOR_TOOLSET "v120_xp" CACHE STRING "BasePlatform toolset" FORCE)
                    131:   # ADD_DEFINITIONS(-D_USING_V110_SDK71_)
                    132:   # ADD_DEFINITIONS( -D_ATL_XP_TARGETING)
                    133:   # SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:CONSOLE,5.01")
                    134:   # set(CMAKE_C_FLAGS "/D_CONSOLE /D_ATL_XP_TARGETING /D_UNICODE")
                    135:   #set(CMAKE_GENERATOR_TOOLSET "v120_xp" CACHE STRING "Platform toolset" FORCE)
                    136:   #set("CMAKE_GENERATOR_TOOLSET", "vc120_xp")
                    137:   # set (CMAKE_GENERATOR_TOOLSET "Intel C++ Compiler XE 15.0" CACHE STRING "Platform Toolset" FORCE)
                    138:   #set (CMAKE_GENERATOR_TOOLSET "v120_xp" CACHE STRING "Platform toolset" FORCE)
                    139:   #set (CMAKE_VS_PLATFORM_TOOLSET "v120_xp" CACHE STRING "Platform toolset" FORCE)
                    140:   ##set (CMAKE_VS_PLATFORM_TOOLSET "v120_xp" CACHE STRING "BasePlatform toolset" FORCE)
                    141: 
                    142:    #https://software.intel.com/en-us/node/522398
                    143:     #    Using the msbuild.exe command line tool, use the /p:PlatformToolset and /p:BasePlatformToolset options. Example: When the Platform Toolset property is already set to use the Intel C++ compiler, to build a project using the Visual Studio 2010 environment use the following command:
                    144: 
                    145:     # Msbuild.exe myproject.vcxproj /p:BasePlatformToolset=v100
                    146: 
                    147:     # Example: To explicitly set the Platform Toolset property to use the Intel C++ compiler and build a project using the Visual Studio 2010 environment use the following command:
                    148: 
                    149:     # Msbuild.exe myproject.vcxproj /p:PlatformToolset=“Intel C++ Compiler XE 15.0” /p:BasePlatformToolset=v100
                    150:     # Msbuild.exe myproject.vcxproj /p:PlatformToolset=“Intel C++ Compiler XE 15.0” /p:BasePlatformToolset=v120_xp
                    151: # <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|Win32'" Label="Configuration">
                    152: #     <ConfigurationType>Application</ConfigurationType>
                    153: #     <UseOfMfc>false</UseOfMfc>
                    154: #     <CharacterSet>MultiByte</CharacterSet>
                    155: #     <PlatformToolset>Intel C++ Compiler XE 15.0</PlatformToolset>
                    156: #     <BasePlatformToolset>v120_xp</BasePlatformToolset>
                    157: #   </PropertyGroup>
                    158: 
                    159:    #set (BASEPLATFORMTOOLSET "v120_xp")
                    160: # set(VERSION_MAJOR "0")
                    161: # set(VERSION_MINOR "7")
                    162: 
                    163: # IF(NOT DEFINED BUILD_VERSION_PATCH)
                    164: #   set(VERSION_PATCH "0")
                    165: # else()
                    166: #   set(VERSION_PATCH "${BUILD_VERSION_PATCH}")
                    167: # ENDIF()
1.3       brouard   168: file( GLOB_RECURSE parameter_files RELATIVE
                    169: "${CMAKE_CURRENT_SOURCE_DIR}/html/doc" "html/*.imach" )
                    170: foreach( parameter_file ${parameter_files} )
                    171:   add_custom_command(
                    172:     OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${parameter_file}"
                    173:     COMMAND cmake -E copy
                    174: "${CMAKE_CURRENT_SOURCE_DIR}/${parameter_file}"
                    175: "${CMAKE_CURRENT_BINARY_DIR}/${parameter_file}"
                    176:     DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/${parameter_file}"
                    177:   )
                    178:   list( APPEND parameter_files_dest "${parameter_file}" )
                    179: endforeach( parameter_file )
                    180: 
                    181: #add_custom_target( CopyParameter ALL DEPENDS ${parameter_files_dest} )
1.1       brouard   182: ENABLE_TESTING()
1.3       brouard   183: ADD_SUBDIRECTORY(html/doc)
                    184: ADD_SUBDIRECTORY(html/doc/data)
                    185: install(FILES "${PROJECT_SOURCE_DIR}/html/doc/mypar.imach" DESTINATION "html/doc/mypar.imach")
1.5     ! brouard   186: ADD_TEST(testV2.imach  IMaCh-${IMACH_VERSION} tests/testV2.imach )
        !           187: ADD_TEST(testV1V2.imach  IMaCh-${IMACH_VERSION} tests/testV1V2.imach )
1.1       brouard   188: ADD_TEST(mypar  IMaCh-${IMACH_VERSION} html/doc/mypar.imach )
                    189: ADD_TEST(biaspar  IMaCh-${IMACH_VERSION} html/doc/biaspar.imach )
                    190: #SET(FAB "po" CACHE STRING "Some user-specified option")
                    191: #set_target_properties(TARGET_NAME imach-${VERSION_MAJOR}.${VERSION_MINOR})
                    192: #%comspec% /k ""C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\VsDevCmd.bat""
                    193: #"C:\Program Files (x86)\Intel\Composer XE 2015\bin\ipsxe-comp-vars.bat" ia32 vs2013
                    194: #"C:\Program Files (x86)\Intel\Composer XE 2015\bin\ipsxe-comp-vars.bat" intel64 vs2013
                    195: #cmake ../../src -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS_RELEASE:STRING="/MD /O2 /Ob2 /D NDEBUG"
                    196: #G:\imach\imach-gui\build\icl32> msbuild IMaCh-0.98q3.vcxproj /t:Build /p:Configuration=Release
                    197: #G:\imach\imach-gui\build\vs32>"C:\Program Files (x86)\Common Files\Intel\shared files\ia32\Bin\ICProjConvert150" IMaCh.vcxproj /IC:"Intel C++ Compiler XE 15.0"
                    198: #"C:\Program Files (x86)\Common Files\Intel\shared files\ia32\Bin
                    199: ##https://tedwvc.wordpress.com/2014/01/01/how-to-target-xp-with-vc2012-or-vc2013-and-continue-to-use-the-windows-8-x-sdk/
                    200: #elseif(MSVC)
                    201: #message(FATAL_ERROR "Fatal error")
                    202: # # set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/bin")
                    203: # # set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/bin")
                    204: # # set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/bin")
                    205: # # set(CMAKE_GENERATOR_TOOLSET "v120_xp" CACHE STRING "Platform toolset" FORCE)
                    206: # # add_subdirectory(src)
                    207: # # add_subdirectory(test)
                    208: #CMAKE_CONFIGURATION_TYPES:STRING=Debug;Release;MinSizeRel;RelWithDebInfo
                    209: # # OPTION(MYPROJECT_DEBUG
                    210: # #   "Build the project using debugging code"
                    211: # #   ON)
                    212: # # IF(MYPROJECT_DEBUG)
                    213: # #   SET_SOURCE_FILE_PROPERTIES(
                    214: # #     imach.c
                    215: # #     COMPILE_FLAGS -DDEBUG)
                    216: # # ENDIF(MYPROJECT_DEBUG)
                    217: # if (${WIN32})
                    218: #   link_directories(
                    219: #   )
                    220:   
                    221: #   add_definitions(
                    222: #     -DDEFINE1
                    223: #   )
                    224: 
                    225: #   target_link_libraries(
                    226: #     ${PROJECT_NAME} 
                    227: #     wsock32.lib 
                    228: #   )
                    229: # endif()
                    230: # if(MSVC OR MSVC_IDE)
                    231: #   if( MSVC_VERSION LESS 1700 )       # VC10-/VS2010-
                    232: #     message(FATAL_ERROR "The project requires C++11 features. "
                    233: #       "You need at least Visual Studio 11 (Microsoft Visual Studio 2012), "
                    234: #       "with Microsoft Visual C++ Compiler Nov 2012 CTP (v120_CTP_Nov2012).")
                    235: #   elseif( MSVC_VERSION EQUAL 1700 )  # VC11/VS2012
                    236: #     message( "VC11: use Microsoft Visual Studio 2012 "
                    237: #       "with Microsoft Visual C++ Compiler Nov 2012 CTP (v120_CTP_Nov2012)" )
                    238: #     set(CMAKE_GENERATOR_TOOLSET "v120_CTP_Nov2012" CACHE STRING "Platform Toolset" FORCE)
                    239: #   else() # VC12+, assuming C++11 supported.
                    240: #   endif()
                    241: # endif()
                    242: # Add a target to generate API documentation with Doxygen
                    243: find_package(Doxygen)
                    244: if(DOXYGEN_FOUND)
                    245: configure_file(${CMAKE_CURRENT_SOURCE_DIR}/latex/Doxyfile.in
                    246: ${CMAKE_CURRENT_BINARY_DIR}/latex/Doxyfile @ONLY)
                    247: add_custom_target(doc
                    248: ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/latex/Doxyfile
                    249: WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/latex
                    250: COMMENT "Generating IMaCh documentation with Doxygen" VERBATIM
                    251: )
                    252: endif()

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>