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