File: CMakeLists.txt

package info (click to toggle)
cppcheck 2.18.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 26,132 kB
  • sloc: cpp: 268,935; python: 20,890; ansic: 8,090; sh: 1,045; makefile: 1,008; xml: 1,005; cs: 291
file content (31 lines) | stat: -rw-r--r-- 1,139 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# TODO: when using ccache and matchcompiler this will accessed before the file was generated and thus the build fails
set(srcs_lib pathmatch.cpp path.cpp utils.cpp)
foreach(file ${srcs_lib})
    if (NOT USE_MATCHCOMPILER_OPT STREQUAL "Off")
        set(src "${CMAKE_BINARY_DIR}/lib/build/mc_${file}")
        set_source_files_properties(${src} PROPERTIES GENERATED TRUE)
    else()
        set(src "${CMAKE_SOURCE_DIR}/lib/${file}")
    endif()
    set(srcs_tools ${srcs_tools} ${src})
endforeach()

add_executable(dmake EXCLUDE_FROM_ALL
        dmake.cpp
        ${CMAKE_SOURCE_DIR}/cli/filelister.cpp
        ${srcs_tools}
        $<TARGET_OBJECTS:simplecpp_objs>
)
target_include_directories(dmake PRIVATE ${CMAKE_SOURCE_DIR}/cli ${CMAKE_SOURCE_DIR}/lib)
target_externals_include_directories(dmake PRIVATE ${CMAKE_SOURCE_DIR}/externals/simplecpp)
if (WIN32 AND NOT BORLAND)
    if(NOT MINGW)
        target_link_libraries(dmake Shlwapi.lib)
    else()
        target_link_libraries(dmake shlwapi)
    endif()
endif()

add_custom_target(run-dmake $<TARGET_FILE:dmake>
        WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
        DEPENDS dmake)