Annotation of imach/CMakeLists.txt, revision 1.2

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

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