Fossil

Check-in [b7430ba1]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix PDB file handling; should apply only for Debug build.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | cmake-ide
Files: files | file ages | folders
SHA3-256:b7430ba100f68f92a876ed79e47a8d79b925c7227633e0654eddec75e0e35343
User & Date: ashepilko 2018-08-04 10:47:47
Context
2018-08-04
10:55
Change the order of extra build flags to allow overrides. check-in: f59ccb03 user: ashepilko tags: cmake-ide
10:47
Fix PDB file handling; should apply only for Debug build. check-in: b7430ba1 user: ashepilko tags: cmake-ide
2018-08-02
11:58
Merge updates from trunk. check-in: b6a0c001 user: mistachkin tags: cmake-ide
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to CMakeLists.txt.

15
16
17
18
19
20
21




22
23
24
25
26
27
28
...
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
...
207
208
209
210
211
212
213



214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
    # Set the possible values of build type for cmake-gui
    set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
        "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
else()
    message(STATUS "'${CMAKE_BUILD_TYPE}' build type")
endif()






## VARIABLES ---------------------------------------------------------------
## Additional parameters can be passed in the following variables which can
## be defined on cmake command line (or in cache).
##
## The parameters correspond to the ones used in the external fossil build
## process (as specified at configure, make, and make test)
................................................................................

## CONFIGURE ---------------------------------------------------------------
##
set(fossil_configure_FLAGS "")
if(configure_FLAGS)
    set(fossil_configure_FLAGS ${configure_FLAGS})
endif()
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
    if(MSVC)
        if(NOT "${fossil_configure_FLAGS}" MATCHES "FOSSIL_DEBUG")
            set(fossil_configure_FLAGS "FOSSIL_DEBUG=1" ${fossil_configure_FLAGS})
        endif()
    else(MSVC)
        if(NOT "${fossil_configure_FLAGS}" MATCHES "--fossil-debug")
            set(fossil_configure_FLAGS "--fossil-debug" ${fossil_configure_FLAGS})
................................................................................
file(WRITE "${CMAKE_BINARY_DIR}/app.c" "int main(){ return 0; }\n")
add_executable(app app.c)

set_target_properties(app PROPERTIES
    OUTPUT_NAME "${app_NAME}"
    RUNTIME_OUTPUT_DIRECTORY "${app_DIR}"
)



if(MSVC)
    set_target_properties(app PROPERTIES
        PDB_NAME "${app_NAME}"
        LINK_FLAGS "/INCREMENTAL:NO /MANIFEST:NO"
    )
endif()
add_custom_command(TARGET app PRE_LINK
    COMMAND "${CMAKE_COMMAND}" -E chdir  "$<TARGET_FILE_DIR:app>"
            "${CMAKE_COMMAND}" -E rename "$<TARGET_FILE_NAME:app>"
                                         "$<TARGET_FILE_NAME:app>-imported"
)
if(MSVC)
    add_custom_command(TARGET app PRE_LINK
        COMMAND "${CMAKE_COMMAND}" -E chdir  "$<TARGET_FILE_DIR:app>"
                "${CMAKE_COMMAND}" -E rename "$<TARGET_PROPERTY:app,PDB_NAME>.pdb"
                                             "$<TARGET_PROPERTY:app,PDB_NAME>.pdb-imported"
    )
endif()
add_custom_command(TARGET app POST_BUILD
    COMMAND "${CMAKE_COMMAND}" -E chdir  "$<TARGET_FILE_DIR:app>"
            "${CMAKE_COMMAND}" -E remove "$<TARGET_FILE_NAME:app>"
    COMMAND "${CMAKE_COMMAND}" -E chdir  "$<TARGET_FILE_DIR:app>"
            "${CMAKE_COMMAND}" -E rename "$<TARGET_FILE_NAME:app>-imported"
                                         "$<TARGET_FILE_NAME:app>"
)
if(MSVC)
    add_custom_command(TARGET app POST_BUILD
        COMMAND "${CMAKE_COMMAND}" -E chdir  "$<TARGET_FILE_DIR:app>"
                "${CMAKE_COMMAND}" -E rename "$<TARGET_PROPERTY:app,PDB_NAME>.pdb-imported"
                                             "$<TARGET_PROPERTY:app,PDB_NAME>.pdb"
    )
endif(MSVC)

add_dependencies(app fossil-exe)


## TEST ---------------------------------------------------------------
##
add_custom_target(test-fossil-setup







>
>
>
>







 







|







 







>
>
>
|


<







|













|





|







15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
...
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
...
211
212
213
214
215
216
217
218
219
220
221
222
223

224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
    # Set the possible values of build type for cmake-gui
    set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
        "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
else()
    message(STATUS "'${CMAKE_BUILD_TYPE}' build type")
endif()

set(isDebugBuild FALSE)
if(CMAKE_BUILD_TYPE MATCHES "[Dd][Ee][Bb][Uu][Gg]" )
    set(isDebugBuild TRUE)
endif()

## VARIABLES ---------------------------------------------------------------
## Additional parameters can be passed in the following variables which can
## be defined on cmake command line (or in cache).
##
## The parameters correspond to the ones used in the external fossil build
## process (as specified at configure, make, and make test)
................................................................................

## CONFIGURE ---------------------------------------------------------------
##
set(fossil_configure_FLAGS "")
if(configure_FLAGS)
    set(fossil_configure_FLAGS ${configure_FLAGS})
endif()
if(isDebugBuild)
    if(MSVC)
        if(NOT "${fossil_configure_FLAGS}" MATCHES "FOSSIL_DEBUG")
            set(fossil_configure_FLAGS "FOSSIL_DEBUG=1" ${fossil_configure_FLAGS})
        endif()
    else(MSVC)
        if(NOT "${fossil_configure_FLAGS}" MATCHES "--fossil-debug")
            set(fossil_configure_FLAGS "--fossil-debug" ${fossil_configure_FLAGS})
................................................................................
file(WRITE "${CMAKE_BINARY_DIR}/app.c" "int main(){ return 0; }\n")
add_executable(app app.c)

set_target_properties(app PROPERTIES
    OUTPUT_NAME "${app_NAME}"
    RUNTIME_OUTPUT_DIRECTORY "${app_DIR}"
)
set_target_properties(app PROPERTIES
    LINK_FLAGS "/INCREMENTAL:NO /MANIFEST:NO"
)
if(MSVC AND isDebugBuild)
    set_target_properties(app PROPERTIES
        PDB_NAME "${app_NAME}"

    )
endif()
add_custom_command(TARGET app PRE_LINK
    COMMAND "${CMAKE_COMMAND}" -E chdir  "$<TARGET_FILE_DIR:app>"
            "${CMAKE_COMMAND}" -E rename "$<TARGET_FILE_NAME:app>"
                                         "$<TARGET_FILE_NAME:app>-imported"
)
if(MSVC AND isDebugBuild)
    add_custom_command(TARGET app PRE_LINK
        COMMAND "${CMAKE_COMMAND}" -E chdir  "$<TARGET_FILE_DIR:app>"
                "${CMAKE_COMMAND}" -E rename "$<TARGET_PROPERTY:app,PDB_NAME>.pdb"
                                             "$<TARGET_PROPERTY:app,PDB_NAME>.pdb-imported"
    )
endif()
add_custom_command(TARGET app POST_BUILD
    COMMAND "${CMAKE_COMMAND}" -E chdir  "$<TARGET_FILE_DIR:app>"
            "${CMAKE_COMMAND}" -E remove "$<TARGET_FILE_NAME:app>"
    COMMAND "${CMAKE_COMMAND}" -E chdir  "$<TARGET_FILE_DIR:app>"
            "${CMAKE_COMMAND}" -E rename "$<TARGET_FILE_NAME:app>-imported"
                                         "$<TARGET_FILE_NAME:app>"
)
if(MSVC AND isDebugBuild)
    add_custom_command(TARGET app POST_BUILD
        COMMAND "${CMAKE_COMMAND}" -E chdir  "$<TARGET_FILE_DIR:app>"
                "${CMAKE_COMMAND}" -E rename "$<TARGET_PROPERTY:app,PDB_NAME>.pdb-imported"
                                             "$<TARGET_PROPERTY:app,PDB_NAME>.pdb"
    )
endif()

add_dependencies(app fossil-exe)


## TEST ---------------------------------------------------------------
##
add_custom_target(test-fossil-setup