|
1 | 1 | cmake_minimum_required(VERSION 3.0)
|
2 | 2 |
|
3 |
| -if (NOT CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux") |
4 |
| - set(CMAKE_CXX_COMPILER clang++) |
5 |
| -endif() |
6 |
| - |
7 |
| -project(cpptcl_test) |
8 |
| - |
9 |
| -set(TCLSH_VERSION_STRING, "8.6") |
10 |
| - |
11 |
| -set(CMAKE_CXX_STANDARD 14) |
12 |
| -set(CMAKE_CXX_STANDARD_REQUIRED ON) |
13 |
| -set(CMAKE_CXX_EXTENSIONS OFF) |
14 |
| - |
15 |
| -if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") |
16 |
| - list(APPEND OPTS -stdlib=libc++) |
17 |
| - list(APPEND OPTS -Wno-reserved-id-macro) |
18 |
| - list(APPEND OPTS -Wno-padded) |
19 |
| - list(APPEND OPTS -Wno-c++98-compat) |
20 |
| -endif() |
21 |
| - |
22 |
| -include (CTest) |
23 |
| - |
24 |
| -find_path(TCL_INCLUDE_PATH tcl.h PATHS /usr/local/include/tcl8.6 /usr/include/tcl8.6 NO_DEFAULT_PATH) |
25 |
| -find_library(TCL_LIBRARY NAMES tcl8.6 tcl86 PATHS /usr/local/lib /usr/lib) |
26 |
| -find_library(TCL_STUB_LIBRARY NAMES tclstub8.6 tclstub86 PATHS /usr/local/lib /usr/lib) |
27 |
| - |
28 |
| -message(INFO " Tcl include ${TCL_INCLUDE_PATH}") |
29 |
| -message(INFO " Tcl library ${TCL_LIBRARY}") |
30 |
| -message(INFO " Tcl stub library ${TCL_STUB_LIBRARY}") |
31 |
| - |
32 |
| -if(NOT TCL_LIBRARY) |
33 |
| - message(FATAL_ERROR " Tcl library not found") |
34 |
| -endif() |
35 |
| - |
36 |
| -#set(CMAKE_BUILD_TYPE Debug) |
37 |
| -set(CMAKE_BUILD_TYPE Release) |
38 |
| - |
39 |
| -include_directories(${CMAKE_SOURCE_DIR}/.. ${TCL_INCLUDE_PATH}) |
40 |
| - |
41 |
| -add_compile_options(${OPTS}) |
42 |
| - |
43 | 3 | add_executable(test1 test1.cc ../cpptcl.cc)
|
44 | 4 | add_test(test1 test1)
|
45 | 5 | target_link_libraries(test1 PUBLIC ${TCL_LIBRARY} ${TCL_STUB_LIBRARY})
|
@@ -71,5 +31,5 @@ target_link_libraries(test_main PUBLIC ${TCL_LIBRARY} ${TCL_STUB_LIBRARY})
|
71 | 31 | set(TCL_TCLSH tclsh8.6)
|
72 | 32 | add_library(test2 SHARED test2.cc ../cpptcl.cc)
|
73 | 33 | target_link_libraries(test2 PUBLIC ${TCL_LIBRARY} ${TCL_STUB_LIBRARY})
|
74 |
| -add_test(NAME test2 COMMAND ${TCL_TCLSH} ../test2.tcl) |
| 34 | +add_test(NAME test2 COMMAND ${TCL_TCLSH} ${CMAKE_SOURCE_DIR}/test/test2.tcl) |
75 | 35 |
|
0 commit comments