Annotation of imach/CMakeLists.txt, revision 1.48

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)
1.6       brouard     9: set(PACKAGE_NAME "imach")
1.1       brouard    10: SET(IMACH_VERSION_MAJOR 0)
1.48    ! brouard    11: SET(IMACH_VERSION_MINOR 99s4)
1.1       brouard    12: SET(IMACH_VERSION_PATCH 0)
                     13: SET(IMACH_VERSION_NOTE "")
1.38      brouard    14: SET(IMACH_VERSION ${IMACH_VERSION_MAJOR}.${IMACH_VERSION_MINOR})
1.28      brouard    15: SET(@APPNAME@ imach-${IMACH_VERSION_MAJOR}.${IMACH_VERSION_MINOR})
1.5       brouard    16: SET(@NOTINNOREG@ )
                     17: SET(@NOREG@ )
                     18: SET(@IMACHSETUPVERSION@ imach-${IMACH_VERSION_MAJOR}.${IMACH_VERSION_MINOR}-icl-setup)
                     19: SET(@APPCOMPILATIONMODE@ icl)
                     20: SET(@VERSION@ ${IMACH_VERSION_MAJOR}.${IMACH_VERSION_MINOR})
1.11      brouard    21: SET(@GNUPLOTVERSION@ 5.1)
1.5       brouard    22: SET(@INFOBEFOREFILE@ README.txt)
                     23: SET(@LICENSEFILE@ Copying)
                     24: SET(@PACKAGE@ imach)
                     25: SET(@DICTLANG@ en)
                     26: SET(@VERMAJOR@ )
1.48    ! brouard    27: SET(@COPYRIGHT@ "Copyright (C)  2002-2015 EUROREVES-Institut de longevite-Japan Society for the Promotion of Science (Grant-in-Aid for Scientific Research 25293121) 2013-2016- Intel Software 2015-2018 2000-2023 INED")
1.1       brouard    28: #SET(IMACH_VERSION ${IMACH_VERSION_MAJOR}.${IMACH_VERSION_MINOR}.${IMACH_VERSION_PATCH})
                     29: #MATH(EXPR IMACH_VERSION_NUMBER "100000*${IMACH_VERSION_MAJOR} + 100*${IMACH_VERSION_MINOR} + ${IMACH_VERSION_PATCH}")
                     30: 
                     31: # #PROJECT(IMaCh${IMACH_VERSION_MAJOR})
1.48    ! brouard    32: CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11)
1.28      brouard    33: PROJECT (imach)
1.1       brouard    34: 
                     35: 
                     36: CONFIGURE_FILE(
                     37:   "${PROJECT_SOURCE_DIR}/version.h.in"
1.2       brouard    38:   "${PROJECT_SOURCE_DIR}/src/version.h"
1.1       brouard    39:   )
                     40: CONFIGURE_FILE(
                     41:   "${PROJECT_SOURCE_DIR}/config.h.in"
                     42:   "${PROJECT_BINARY_DIR}/config.h"
                     43: )
1.5       brouard    44: # Examples for the documentation
1.4       brouard    45: CONFIGURE_FILE("${PROJECT_SOURCE_DIR}/tests/mypar.imach.in" "html/doc/mypar.imach")
                     46: CONFIGURE_FILE("${PROJECT_SOURCE_DIR}/tests/biaspar.imach.in" "html/doc/biaspar.imach")
                     47: CONFIGURE_FILE("${PROJECT_SOURCE_DIR}/tests/data1.txt" "html/doc/data1.txt" COPYONLY)
                     48: CONFIGURE_FILE("${PROJECT_SOURCE_DIR}/tests/data/mydata.txt" "html/doc/data/mydata.txt" COPYONLY)
1.5       brouard    49: # Test files
                     50: CONFIGURE_FILE("${PROJECT_SOURCE_DIR}/tests/data/data2.txt" "tests/data/data2.txt" COPYONLY)
1.24      brouard    51: #CONFIGURE_FILE("${PROJECT_SOURCE_DIR}/tests/testV2.imach" "tests/testV2.imach" COPYONLY)
                     52: #CONFIGURE_FILE("${PROJECT_SOURCE_DIR}/tests/testV1V2.imach" "tests/testV1V2.imach" COPYONLY)
1.5       brouard    53: 
1.1       brouard    54: 
                     55: set (imach_SRCS ./src/imach.c)
                     56: SET( CMAKE_VERBOSE_MAKEFILE on )
1.21      brouard    57: #SET(CMAKE_INSTALL_PREFIX "/usr/local")
1.28      brouard    58: ADD_EXECUTABLE (imach-${IMACH_VERSION_MAJOR}.${IMACH_VERSION_MINOR} ${imach_SRCS})
                     59: INSTALL(TARGETS imach-${IMACH_VERSION_MAJOR}.${IMACH_VERSION_MINOR} DESTINATION bin COMPONENT binaries )
1.21      brouard    60: #INSTALL(TARGETS imach DESTINATION bin COMPONENT binaries )
1.1       brouard    61: ADD_SUBDIRECTORY(html)
1.4       brouard    62: ADD_SUBDIRECTORY(tests)
1.21      brouard    63: #ADD_SUBDIRECTORY(src) 
                     64: #ADD_SUBDIRECTORY(distributions)
1.1       brouard    65: #if (${WIN32})
1.3       brouard    66: #if(APPLE)
                     67: #  set(DOCDIR "${CMAKE_INSTALL_PREFIX}/${PROJECT_NAME}/doc")
                     68: #endif()
1.1       brouard    69: if(UNIX)
                     70:   #   set(CMAKE_CXX_COMPILER "gcc")
1.28      brouard    71:   target_link_libraries(imach-${IMACH_VERSION_MAJOR}.${IMACH_VERSION_MINOR} m)
1.1       brouard    72:   set(BINDIR "${CMAKE_INSTALL_PREFIX}/bin")
                     73:   set(DOCDIR "${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME}/doc")
1.21      brouard    74:   set(TESTDIR "${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME}/tests")
1.22      brouard    75:   set(DATADIR "${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME}/tests/data")
1.21      brouard    76:   set(MANDIR "${CMAKE_INSTALL_PREFIX}/share/man/man1")
1.1       brouard    77:   #set(EXAMPLE_CONF_DIR ${DOCDIR})
                     78:   set(XDG_APPS_DIR "${CMAKE_INSTALL_PREFIX}/share/applications")
                     79:   set(APPDATADIR "${CMAKE_INSTALL_PREFIX}/share/appdata")
                     80:   set(ICONDIR "${CMAKE_INSTALL_PREFIX}/share/icons")
1.24      brouard    81:   install(FILES "distributions/gnulinux/imach.1" DESTINATION "${MANDIR}")
                     82:   install(FILES "distributions/gnulinux/imach.png" DESTINATION "${ICONDIR}")
                     83:   install(FILES "distributions/gnulinux/imach.desktop" DESTINATION "${XDG_APPS_DIR}")
1.1       brouard    84: endif()
                     85: if(MSVC)
1.2       brouard    86:   set(DOCDIR "${CMAKE_INSTALL_PREFIX}/${PROJECT_NAME}/doc")
1.24      brouard    87:   set(TESTDIR "${CMAKE_INSTALL_PREFIX}/${PROJECT_NAME}/tests")
                     88:   set(DATADIR "${CMAKE_INSTALL_PREFIX}/${PROJECT_NAME}/tests/data")
1.1       brouard    89:   set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MTd")
                     90:   set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MT")
                     91:   set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MTd")
                     92:   set(CMAKE_CONFIGURATION_TYPES:STRING=Release)
                     93:   ADD_DEFINITIONS( -DCONSOLE)
                     94:   ADD_DEFINITIONS( -D_CONSOLE)
                     95: endif()
                     96: ADD_DEFINITIONS( -DCROSS=0)
                     97: 
                     98: install(FILES "html/doc/mypar.imach" DESTINATION "${DOCDIR}")
                     99: install(FILES "html/doc/data/mydata.txt" DESTINATION "${DOCDIR}/data")
                    100: install(FILES "html/doc/biaspar.imach" DESTINATION "${DOCDIR}")
                    101: install(FILES "html/doc/data1.txt" DESTINATION "${DOCDIR}")
1.21      brouard   102: install(FILES "src/README.txt" DESTINATION "${DOCDIR}")
1.24      brouard   103: #install(FILES "tests/testV1V2.imach" DESTINATION "${TESTDIR}")
1.22      brouard   104: install(FILES "tests/rtestV1V2.imach" DESTINATION "${TESTDIR}")
                    105: install(FILES "tests/testV2.imach" DESTINATION "${TESTDIR}")
                    106: install(FILES "tests/rtestV2.imach" DESTINATION "${TESTDIR}")
                    107: install(FILES "tests/data/data2.txt" DESTINATION "${DATADIR}")
1.20      brouard   108: #not working install(FILES "imach.desktop" DESTINATION "${XDG_APPS_DIR}")
1.1       brouard   109: #install(FILES "html" DESTINATION "${DOCDIR}")
                    110: 
1.6       brouard   111: 
1.1       brouard   112: set(CPACK_PACKAGE_VERSION ${IMACH_VERSION})
1.6       brouard   113: set(CPACK_PACKAGE_NAME "imach")
1.11      brouard   114: set(CPACK_PACKAGE_RELEASE 1)
1.1       brouard   115: set(CPACK_PACKAGE_CONTACT "Nicolas Brouard")
                    116: set(CPACK_PACKAGE_VENDOR "INED")
                    117: SET(CPACK_PACKAGE_VENDOR "IMaCh, INED")
1.21      brouard   118: SET(CPACK_PACKAGE_LICENSE "GPLv2")
1.23      brouard   119: #SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README.txt")
1.1       brouard   120: SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt")
                    121: SET(CPACK_PACKAGE_VERSION_MAJOR "${IMACH_VERSION_MAJOR}")
                    122: SET(CPACK_PACKAGE_VERSION_MINOR "${IMACH_VERSION_MINOR}")
                    123: SET(CPACK_PACKAGE_VERSION_PATCH "${IMACH_VERSION_PATCH}")
                    124: SET(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}")
1.21      brouard   125: #SET(CPACK_INSTALLED_DIRECTORIES "${PROJECT_SOURCE_DIR}" ".")
1.1       brouard   126: #SET(CPACK_PACKAGE_EXECUTABLES "IMaCh" "IMaCh")
                    127: SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "IMaCh program estimates Health Expectancies from Cross-longitudinal surveys.")
1.21      brouard   128: #SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README.txt")
1.1       brouard   129: SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/imach-desc.txt")
1.21      brouard   130: set(CPACK_RPM_PACKAGE_URL "http://euroreves.ined.fr/imach")
                    131: IF(UNIX)
                    132:   SET(CPACK_RPM_PACKAGE_LICENSE "GPL")
                    133:   SET(CPACK_RPM_PACKAGE_GROUP "Applications/Sciences")
1.28      brouard   134:   SET(CPACK_RPM_PACKAGE_REQUIRES "gnuplot >= 5.0, cmake >= 2.8")
1.21      brouard   135:   SET(CPACK_GENERATOR "TXZ")
                    136:   SET(CPACK_SOURCE_GENERATOR "TXZ")
                    137:   SET(CPACK_SOURCE_TBZ2 "OFF")
                    138:   SET(CPACK_SOURCE_TGZ "ON")
                    139:   SET(CPACK_SOURCE_TOPLEVEL_TAG "Linux-src")
                    140:   SET(CPACK_SOURCE_TXZ "ON")
                    141:   SET(CPACK_SOURCE_TZ "ON")
                    142:   SET(CPACK_SOURCE_ZIP "OFF")
                    143:   #SET(CPACK_RPM_PREFIX "/usr/local")
                    144:   # SET(CPACK_RPM_PACKAGE_PREFIX "/usr/local")
                    145:    SET(CPACK_PACKAGING_INSTALL_PREFIX "/usr/local")
                    146:   # SET(CMAKE_INSTALL_PREFIX "/usr/local")
                    147:   set(CPACK_RPM_PACKAGE_RELOCATABLE True)
                    148:   # This a .spec Changelog not an Emacs ChangeLog that you get with C-x v a (vc-update-change-log)
                    149:   # * Mon May 20 2019  Brouard Nicolas  <brouard@brouard.name>
                    150:   # ${CMAKE_CURRENT_SOURCE_DIR}/specchangelog")
                    151:   set(CPACK_RPM_CHANGELOG_FILE "${PROJECT_SOURCE_DIR}/src/Changelog")
                    152:   SET(CPACK_BINARY_RPM "ON")
1.48    ! brouard   153: # NEW  set(CPACK_RPM_COMPONENT_INSTALL ON)
1.21      brouard   154:   SET(CPACK_RPM_PACKAGE_SOURCES "ON")
                    155:   set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_PACKAGE_RELEASE}.${CMAKE_SYSTEM_PROCESSOR}")
                    156:   SET(CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CPACK_PACKAGE_RELEASE}.src")
                    157: ENDIF(UNIX)
1.1       brouard   158: 
                    159: IF(WIN32 AND NOT UNIX)
                    160:   # There is a bug in NSI that does not handle full unix paths properly. Make
                    161:   # sure there is at least one set of four (4) backlasshes.
                    162:   SET(CPACK_PACKAGE_ICON "${CMake_SOURCE_DIR}/Utilities/Release\\\\InstallIcon.bmp")
                    163:   SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\imach.exe")
                    164:   SET(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} IMaCh")
                    165:   SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\euroreves.ined.fr/imach/wiki")
                    166:   SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\euroreves.ined.fr/imach")
                    167:   SET(CPACK_NSIS_CONTACT "brouard@ined.fr")
                    168:   SET(CPACK_NSIS_MODIFY_PATH ON)
                    169: ELSE(WIN32 AND NOT UNIX)
                    170:   SET(CPACK_STRIP_FILES "bin/imach")
                    171:   SET(CPACK_SOURCE_STRIP_FILES "")
                    172: ENDIF(WIN32 AND NOT UNIX)
                    173: #SET(CPACK_PACKAGE_EXECUTABLES "IMaCh" "IMaCh")
                    174: INCLUDE(CPack)
                    175: 
                    176:   # set (CMAKE_GENERATOR_TOOLSET "v120_xp" CACHE STRING "BasePlatform toolset" FORCE)
                    177:   # ADD_DEFINITIONS(-D_USING_V110_SDK71_)
                    178:   # ADD_DEFINITIONS( -D_ATL_XP_TARGETING)
                    179:   # SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:CONSOLE,5.01")
                    180:   # set(CMAKE_C_FLAGS "/D_CONSOLE /D_ATL_XP_TARGETING /D_UNICODE")
                    181:   #set(CMAKE_GENERATOR_TOOLSET "v120_xp" CACHE STRING "Platform toolset" FORCE)
                    182:   #set("CMAKE_GENERATOR_TOOLSET", "vc120_xp")
                    183:   # set (CMAKE_GENERATOR_TOOLSET "Intel C++ Compiler XE 15.0" CACHE STRING "Platform Toolset" FORCE)
                    184:   #set (CMAKE_GENERATOR_TOOLSET "v120_xp" CACHE STRING "Platform toolset" FORCE)
                    185:   #set (CMAKE_VS_PLATFORM_TOOLSET "v120_xp" CACHE STRING "Platform toolset" FORCE)
                    186:   ##set (CMAKE_VS_PLATFORM_TOOLSET "v120_xp" CACHE STRING "BasePlatform toolset" FORCE)
                    187: 
                    188:    #https://software.intel.com/en-us/node/522398
                    189:     #    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:
                    190: 
                    191:     # Msbuild.exe myproject.vcxproj /p:BasePlatformToolset=v100
                    192: 
                    193:     # 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:
                    194: 
                    195:     # Msbuild.exe myproject.vcxproj /p:PlatformToolset=“Intel C++ Compiler XE 15.0” /p:BasePlatformToolset=v100
                    196:     # Msbuild.exe myproject.vcxproj /p:PlatformToolset=“Intel C++ Compiler XE 15.0” /p:BasePlatformToolset=v120_xp
                    197: # <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|Win32'" Label="Configuration">
                    198: #     <ConfigurationType>Application</ConfigurationType>
                    199: #     <UseOfMfc>false</UseOfMfc>
                    200: #     <CharacterSet>MultiByte</CharacterSet>
                    201: #     <PlatformToolset>Intel C++ Compiler XE 15.0</PlatformToolset>
                    202: #     <BasePlatformToolset>v120_xp</BasePlatformToolset>
                    203: #   </PropertyGroup>
                    204: 
                    205:    #set (BASEPLATFORMTOOLSET "v120_xp")
                    206: # set(VERSION_MAJOR "0")
                    207: # set(VERSION_MINOR "7")
                    208: 
                    209: # IF(NOT DEFINED BUILD_VERSION_PATCH)
                    210: #   set(VERSION_PATCH "0")
                    211: # else()
                    212: #   set(VERSION_PATCH "${BUILD_VERSION_PATCH}")
                    213: # ENDIF()
1.3       brouard   214: file( GLOB_RECURSE parameter_files RELATIVE
1.22      brouard   215: "${CMAKE_CURRENT_SOURCE_DIR}/html/doc" "html/*.imach" "tests/*.imach" )
1.3       brouard   216: foreach( parameter_file ${parameter_files} )
                    217:   add_custom_command(
                    218:     OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${parameter_file}"
                    219:     COMMAND cmake -E copy
                    220: "${CMAKE_CURRENT_SOURCE_DIR}/${parameter_file}"
                    221: "${CMAKE_CURRENT_BINARY_DIR}/${parameter_file}"
                    222:     DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/${parameter_file}"
                    223:   )
                    224:   list( APPEND parameter_files_dest "${parameter_file}" )
                    225: endforeach( parameter_file )
                    226: 
                    227: #add_custom_target( CopyParameter ALL DEPENDS ${parameter_files_dest} )
1.1       brouard   228: ENABLE_TESTING()
1.21      brouard   229: #ADD_SUBDIRECTORY(html/doc)
                    230: #ADD_SUBDIRECTORY(html/doc/data)
                    231: #install(FILES "${PROJECT_SOURCE_DIR}/html/doc/mypar.imach" DESTINATION "html/doc")
1.5       brouard   232: ADD_TEST(testV2.imach  IMaCh-${IMACH_VERSION} tests/testV2.imach )
                    233: ADD_TEST(testV1V2.imach  IMaCh-${IMACH_VERSION} tests/testV1V2.imach )
1.21      brouard   234: ADD_TEST(mypar  IMaCh-${IMACH_VERSION} local/html/doc/ )
                    235: ADD_TEST(biaspar  IMaCh-${IMACH_VERSION} local/html/doc/ )
1.1       brouard   236: #SET(FAB "po" CACHE STRING "Some user-specified option")
                    237: #set_target_properties(TARGET_NAME imach-${VERSION_MAJOR}.${VERSION_MINOR})
                    238: #%comspec% /k ""C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\VsDevCmd.bat""
                    239: #"C:\Program Files (x86)\Intel\Composer XE 2015\bin\ipsxe-comp-vars.bat" ia32 vs2013
                    240: #"C:\Program Files (x86)\Intel\Composer XE 2015\bin\ipsxe-comp-vars.bat" intel64 vs2013
                    241: #cmake ../../src -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS_RELEASE:STRING="/MD /O2 /Ob2 /D NDEBUG"
                    242: #G:\imach\imach-gui\build\icl32> msbuild IMaCh-0.98q3.vcxproj /t:Build /p:Configuration=Release
                    243: #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"
                    244: #"C:\Program Files (x86)\Common Files\Intel\shared files\ia32\Bin
                    245: ##https://tedwvc.wordpress.com/2014/01/01/how-to-target-xp-with-vc2012-or-vc2013-and-continue-to-use-the-windows-8-x-sdk/
                    246: #elseif(MSVC)
                    247: #message(FATAL_ERROR "Fatal error")
                    248: # # set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/bin")
                    249: # # set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/bin")
                    250: # # set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/bin")
                    251: # # set(CMAKE_GENERATOR_TOOLSET "v120_xp" CACHE STRING "Platform toolset" FORCE)
                    252: # # add_subdirectory(src)
                    253: # # add_subdirectory(test)
                    254: #CMAKE_CONFIGURATION_TYPES:STRING=Debug;Release;MinSizeRel;RelWithDebInfo
                    255: # # OPTION(MYPROJECT_DEBUG
                    256: # #   "Build the project using debugging code"
                    257: # #   ON)
                    258: # # IF(MYPROJECT_DEBUG)
                    259: # #   SET_SOURCE_FILE_PROPERTIES(
                    260: # #     imach.c
                    261: # #     COMPILE_FLAGS -DDEBUG)
                    262: # # ENDIF(MYPROJECT_DEBUG)
                    263: # if (${WIN32})
                    264: #   link_directories(
                    265: #   )
                    266:   
                    267: #   add_definitions(
                    268: #     -DDEFINE1
                    269: #   )
                    270: 
                    271: #   target_link_libraries(
                    272: #     ${PROJECT_NAME} 
                    273: #     wsock32.lib 
                    274: #   )
                    275: # endif()
                    276: # if(MSVC OR MSVC_IDE)
                    277: #   if( MSVC_VERSION LESS 1700 )       # VC10-/VS2010-
                    278: #     message(FATAL_ERROR "The project requires C++11 features. "
                    279: #       "You need at least Visual Studio 11 (Microsoft Visual Studio 2012), "
                    280: #       "with Microsoft Visual C++ Compiler Nov 2012 CTP (v120_CTP_Nov2012).")
                    281: #   elseif( MSVC_VERSION EQUAL 1700 )  # VC11/VS2012
                    282: #     message( "VC11: use Microsoft Visual Studio 2012 "
                    283: #       "with Microsoft Visual C++ Compiler Nov 2012 CTP (v120_CTP_Nov2012)" )
                    284: #     set(CMAKE_GENERATOR_TOOLSET "v120_CTP_Nov2012" CACHE STRING "Platform Toolset" FORCE)
                    285: #   else() # VC12+, assuming C++11 supported.
                    286: #   endif()
                    287: # endif()
                    288: # Add a target to generate API documentation with Doxygen
1.20      brouard   289: option(BUILD_DOC "Build documentation" ON)
1.21      brouard   290: if(UNIXDODOXYGEN)
1.8       brouard   291:   find_package(Doxygen)
1.20      brouard   292:   if(DOXYGEN_FOUND)# set input and output files
                    293:     #set(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/../docs/Doxyfile.in) ~/Documents/imach/cvs/imach/latex/Doxyfile.in
                    294:     set(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/latex/Doxyfile.in)
                    295:     set(DOXYGEN_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
1.21      brouard   296:     
1.20      brouard   297:     # request to configure the file
                    298:     configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY)
                    299:     message("Doxygen build started")
1.21      brouard   300:     
1.20      brouard   301:     # note the option ALL which allows to build the docs together with the application
                    302:     add_custom_target( doc_doxygen ALL
                    303:       COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT}
                    304:       WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
                    305:       COMMENT "Generating API documentation with Doxygen in gnulinux/html/index.html"
                    306:       VERBATIM )
                    307:     install(DIRECTORY ${CMAKE_BINARY_DIR}/html 
1.21      brouard   308:       DESTINATION local/share/doc/${CMAKE_PROJECT_NAME})
1.20      brouard   309:   else (DOXYGEN_FOUND)
                    310:     message("Doxygen need to be installed to generate the doxygen documentation")
                    311:   endif (DOXYGEN_FOUND)
                    312:   message("Doxygen only in UNIX doxygen documentation")
1.21      brouard   313: endif (UNIXDODOXYGEN)
1.23      brouard   314: 

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