File: CMakeLists.txt

package info (click to toggle)
treesheets 1:1.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 4,952 kB
  • sloc: cpp: 31,134; makefile: 66; ansic: 9
file content (55 lines) | stat: -rw-r--r-- 1,777 bytes parent folder | download
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# Sample build with makefile generator
#
#     cd <into-treesheets-source>
#     cmake -H. -Bb -DCMAKE_BUILD_TYPE=Release \
#         -DCMAKE_PROGRAM_PATH=<path-to-wx-config> # not always needed
#     cmake --build b --target install
#
# Sample build with IDE generator, like Xcode
#
#     cd <into-treesheets-source>
#     cmake -H. -Bb -GXcode \
#         -DCMAKE_PROGRAM_PATH=<path-to-wx-config> # not always needed
#     cmake --build b --config Release --target install
#
# Run program:
#
#     ./i/treesheets
#
# Should work on Windows, too. About helping FindwxWidgets to find wxWidgets
# consult: https://cmake.org/cmake/help/latest/module/FindwxWidgets.html

cmake_minimum_required(VERSION 3.1)
# CMAKE_CXX_STANDARD needs v3.1, could be lowered with minor effort

project(treesheets)

# set(CMAKE_CXX_STANDARD 17)  # this doesn't work correctly on all CMake versions :(
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/TS)

find_package(wxWidgets REQUIRED aui adv core xml net)
include(${wxWidgets_USE_FILE})

file(GLOB sources src/*.cpp src/*.h
        lobster/src/builtins.cpp
        lobster/src/compiler.cpp
        lobster/src/file.cpp
        lobster/src/lobsterreader.cpp
        lobster/src/platform.cpp
        lobster/src/vm.cpp
        lobster/src/vmdata.cpp
        lobster/src/vmlog.cpp)
include_directories(lobster/include lobster/src)
add_executable(treesheets ${sources})

target_link_libraries(treesheets PRIVATE ${wxWidgets_LIBRARIES})

install(TARGETS treesheets DESTINATION bin)
install(DIRECTORY TS/ DESTINATION share/treesheets)

set(PACKAGE_VERSION "" CACHE STRING "Package version")
if(PACKAGE_VERSION)
add_definitions('-DPACKAGE_VERSION="${PACKAGE_VERSION}"')
endif(PACKAGE_VERSION)