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