Annotation of imach/CMakeLists.txt, revision 1.1

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

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