-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
103 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,50 @@ | ||
cmake_minimum_required(VERSION 3.10) | ||
cmake_minimum_required(VERSION 3.11) | ||
|
||
project(causal_sets_explorer VERSION 0.1 LANGUAGES CXX) | ||
project(causal_sets_explorer VERSION 0.1.2 LANGUAGES CXX) | ||
|
||
if (EXISTS ${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) | ||
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) | ||
conan_basic_setup() | ||
else() | ||
message(WARNING "The file conanbuildinfo.cmake doesn't exist, running conan install.") | ||
execute_process(COMMAND conan install .. --build=missing) | ||
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) | ||
message(FATAL_ERROR "Do not build in-source. | ||
Please remove CMakeCache.txt and the CMakeFiles/ directory. Then build out-of-source.") | ||
endif() | ||
|
||
# Activate C++17 support | ||
# Run Conan from CMake | ||
# Download automatically, you can also just copy the conan.cmake file | ||
if(NOT EXISTS "${CMAKE_BINARY_DIR}/conan.cmake") | ||
message(STATUS "Downloading conan.cmake from https://github.com/conan-io/cmake-conan") | ||
file(DOWNLOAD "https://raw.githubusercontent.com/conan-io/cmake-conan/v0.12/conan.cmake" | ||
"${CMAKE_BINARY_DIR}/conan.cmake") | ||
endif() | ||
|
||
include(${CMAKE_BINARY_DIR}/conan.cmake) | ||
conan_cmake_run(CONANFILE conanfile.py # or relative build/conanfile.txt | ||
BASIC_SETUP CMAKE_TARGETS | ||
BUILD missing) | ||
|
||
#Activate C++ 17 support | ||
set(CMAKE_CXX_STANDARD 17) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
set(CMAKE_CXX_EXTENSIONS OFF) | ||
|
||
# Disable CLion generation of RelWithDebInfo and MinSizeRel, et. al | ||
#Disable CLion generation of RelWithDebInfo and MinSizeRel, et.al | ||
set(CMAKE_CONFIGURATION_TYPES "Release" "Debug" CACHE STRING "" FORCE) | ||
|
||
include_directories(src) | ||
file(GLOB_RECURSE PROJECT_SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp") | ||
|
||
#Extra warnings | ||
#add_definitions(-Wall) | ||
|
||
# Exclude main file for library generation, only use it in the final | ||
# executable. This lets us test everything without compiling twice. | ||
set(PROJECT_MAIN "${CMAKE_CURRENT_SOURCE_DIR}/src/main.cpp") | ||
list(REMOVE_ITEM PROJECT_SOURCE ${PROJECT_MAIN}) | ||
|
||
# Build our project with the help of conan. | ||
include_directories(${CONAN_INCLUDE_DIRS}) | ||
add_library(causal_sets_explorerlib STATIC ${PROJECT_SOURCE}) | ||
add_executable(causal_sets_explorer ${PROJECT_MAIN}) | ||
target_link_libraries(causal_sets_explorer causal_sets_explorerlib ${CONAN_LIBS}) | ||
#Build our project with the help of conan. | ||
add_executable(causal_sets_explorer ${PROJECT_SOURCE_DIR}/src/main.cpp) | ||
target_link_libraries(causal_sets_explorer CONAN_PKG::boost CONAN_PKG::catch2) | ||
target_compile_features(causal_sets_explorer PRIVATE cxx_std_17) | ||
|
||
# Now enable our tests | ||
#Now enable our tests | ||
enable_testing() | ||
add_subdirectory(tests) | ||
|
||
#CTest Integration tests | ||
include(CTest) | ||
|
||
# Does the causal_sets_explorer run? | ||
add_test(NAME causal_sets_explorer-Run | ||
COMMAND causal_sets_explorer) | ||
# --config $<CONFIGURATION>) | ||
# --exe $<TARGET_FILE:causal_sets_explorer>) | ||
#Does the causal_sets_explorer run ? | ||
add_test(NAME causal_sets_explorer-Run COMMAND $<TARGET_FILE:causal_sets_explorer>) | ||
set_tests_properties(causal_sets_explorer-Run | ||
PROPERTIES | ||
PASS_REGULAR_EXPRESSION "digraph") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
#!/usr/bin/env bash | ||
rm -rf build/ | ||
mkdir build && cd build | ||
conan install .. --build=missing -s compiler=apple-clang -s compiler.version=9.1 -s compiler.libcxx=libc++ | ||
conan build .. | ||
#cmake -DCMAKE_BUILD_TYPE=Debug .. | ||
#cmake --build . | ||
#cmake --build . --target test | ||
|
||
conan install .. -pr default | ||
conan build .. | ||
ctest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,6 @@ | ||
cmake_minimum_required(VERSION 3.5) | ||
cmake_minimum_required(VERSION 3.11) | ||
|
||
file(GLOB_RECURSE TEST_SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/*.cpp") | ||
add_executable(causal_sets_explorer_test ${PROJECT_SOURCE_DIR}/tests/main.cpp GraphTest.cpp) | ||
target_link_libraries(causal_sets_explorer_test CONAN_PKG::boost CONAN_PKG::catch2) | ||
|
||
add_executable(causal_sets_explorer_test ${TEST_SOURCE}) | ||
target_link_libraries(causal_sets_explorer_test causal_sets_explorerlib ${CONAN_LIBS}) | ||
# We run our test from the source directory, so we can consistently | ||
# load files with known paths. | ||
# I also like color in my verbose output, so I put in a --force-colour flag. | ||
add_test(NAME causal_sets_explorer_tests | ||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} | ||
COMMAND ${CMAKE_BINARY_DIR}/bin/causal_sets_explorer_test --force-colour) | ||
add_test(NAME causal_sets_explorer-Graph COMMAND $<TARGET_FILE:causal_sets_explorer_test>) |