mirror of
https://github.com/cuberite/TCLAP.git
synced 2025-08-04 02:06:29 -04:00
Enable CMake to build (not test) in 1.2.
This is useful so we can at least check that it compiles on Windows. We don't bother fixing the tests or testing infra (as has been done in 1.4 branch) as we expect most development to happen there. The CMake files will not be included in the distrubution and are used for development/testing only.
This commit is contained in:
parent
e9352c04e3
commit
cce3831403
8
CMakeLists.txt
Normal file
8
CMakeLists.txt
Normal file
@ -0,0 +1,8 @@
|
||||
cmake_minimum_required(VERSION 3.7)
|
||||
|
||||
project(TCLAP VERSION 1.2.2)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 98)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED True)
|
||||
|
||||
add_subdirectory(examples)
|
27
examples/CMakeLists.txt
Normal file
27
examples/CMakeLists.txt
Normal file
@ -0,0 +1,27 @@
|
||||
SET( CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "${OUTPUT_DIRECTORY}")
|
||||
SET( CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE "${OUTPUT_DIRECTORY}")
|
||||
|
||||
SET(gcc_like_cxx "$<OR:$<CXX_COMPILER_ID:ARMClang>,$<CXX_COMPILER_ID:AppleClang>,$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:GNU>>")
|
||||
SET(msvc_cxx "$<CXX_COMPILER_ID:MSVC>")
|
||||
|
||||
function(default_opts target)
|
||||
target_compile_options(${target} PRIVATE
|
||||
"$<${gcc_like_cxx}:$<BUILD_INTERFACE:-Wall;-Wextra;-Weffc++>>"
|
||||
"$<${msvc_cxx}:$<BUILD_INTERFACE:-W3>>"
|
||||
)
|
||||
endfunction(default_opts)
|
||||
|
||||
function(add_example name)
|
||||
add_executable(${name} ${ARGN})
|
||||
target_include_directories(${name} PUBLIC ../include/ ${PROJECT_BINARY_DIR})
|
||||
default_opts(${name})
|
||||
endfunction()
|
||||
|
||||
# Check we don't define any hard symbols in the headers
|
||||
add_example(test-hard test-hard-1.cpp test-hard-2.cpp)
|
||||
|
||||
file(GLOB TEST_FILES test[0-9]*.cpp)
|
||||
foreach(file ${TEST_FILES})
|
||||
get_filename_component(file_basename ${file} NAME_WE)
|
||||
add_example(${file_basename} ${file})
|
||||
endforeach()
|
@ -20,7 +20,7 @@ test13_SOURCES = test13.cpp
|
||||
test14_SOURCES = test14.cpp
|
||||
test15_SOURCES = test15.cpp
|
||||
test16_SOURCES = test16.cpp
|
||||
test17_SOURCES = test17.cpp test17-a.cpp
|
||||
test17_SOURCES = test-hard-1.cpp test-hard-2.cpp
|
||||
test18_SOURCES = test18.cpp
|
||||
test19_SOURCES = test19.cpp
|
||||
test20_SOURCES = test20.cpp
|
||||
|
Loading…
x
Reference in New Issue
Block a user