Move cmdLineArgs lib to external
This commit is contained in:
1
external/CMakeLists.txt
vendored
1
external/CMakeLists.txt
vendored
@@ -0,0 +1 @@
|
||||
add_subdirectory(cmdLineArgs)
|
||||
15
external/cmdLineArgs/CMakeLists.txt
vendored
Normal file
15
external/cmdLineArgs/CMakeLists.txt
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
add_library(cmdLineArgs "")
|
||||
target_sources(cmdLineArgs
|
||||
PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cmdLineArgs.cpp
|
||||
)
|
||||
|
||||
target_include_directories(cmdLineArgs
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_LIST_DIR}
|
||||
${PROJECT_BINARY_DIR}
|
||||
)
|
||||
|
||||
target_compile_options(cmdLineArgs PRIVATE $<$<CONFIG:Debug>:
|
||||
-Wall -Wextra -pedantic-errors -Wconversion -Wsign-conversion
|
||||
>)
|
||||
21
external/cmdLineArgs/debug.hpp
vendored
Normal file
21
external/cmdLineArgs/debug.hpp
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
#pragma once
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include "config.hpp"
|
||||
|
||||
#if enableDebug == 1
|
||||
#define debugln(x) std::cout << "\033[32m" << x << std::endl << "\033[0m";
|
||||
#define debug(x) std::cout << "\033[32m" << x << "\033[0m";
|
||||
#define debugWarn(x) std::cerr << "\033[33m" << x << "\033[0m";
|
||||
#define debugWarnln(x) std::cerr << "\033[33m" << x << std::endl << "\033[0m";
|
||||
#define debugErrorln(x) std::cerr << "\033[31m" << x << std::endl << "\033[0m";
|
||||
#define debugError(x) std::cerr "\033[31m" << x << "\033[0m";
|
||||
#else
|
||||
#define debugln(x)
|
||||
#define debug(x)
|
||||
#define debugWarn(x)
|
||||
#define debugWarnln(x)
|
||||
#define debugErrorln(x)
|
||||
#define debugError(x)
|
||||
#endif
|
||||
@@ -1,28 +1,30 @@
|
||||
add_executable(main main.cpp cmdLineArgs.cpp)
|
||||
add_executable(main main.cpp)
|
||||
|
||||
# tell CMake to generate config.hpp
|
||||
configure_file (
|
||||
configure_file(
|
||||
"${PROJECT_SOURCE_DIR}/config.hpp.in"
|
||||
"${PROJECT_BINARY_DIR}/config.hpp"
|
||||
)
|
||||
)
|
||||
|
||||
add_subdirectory(TopTeamBedrijfssimulaties)
|
||||
#add_subdirectory(initial)
|
||||
#add_subdirectory(io)
|
||||
#add_subdirectory(parser)
|
||||
|
||||
# add_subdirectory(initial)
|
||||
# add_subdirectory(io)
|
||||
# add_subdirectory(parser)
|
||||
target_link_libraries(main
|
||||
PRIVATE
|
||||
TopTeamBedrijfssimulaties
|
||||
)
|
||||
TopTeamBedrijfssimulaties
|
||||
cmdLineArgs
|
||||
)
|
||||
|
||||
target_include_directories(TopTeamBedrijfssimulaties
|
||||
target_include_directories(TopTeamBedrijfssimulaties
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_LIST_DIR}
|
||||
${CMAKE_CURRENT_LIST_DIR}/TopTeamBedrijfssimulaties
|
||||
${PROJECT_BINARY_DIR}
|
||||
)
|
||||
|
||||
target_compile_options(main PRIVATE $<$<CONFIG:Debug>:
|
||||
${CMAKE_MAIN_SOURCE_DIR}/external/**
|
||||
${CMAKE_CURRENT_LIST_DIR}
|
||||
${CMAKE_CURRENT_LIST_DIR}/TopTeamBedrijfssimulaties
|
||||
${PROJECT_BINARY_DIR}
|
||||
)
|
||||
|
||||
target_compile_options(main PRIVATE $<$<CONFIG:Debug>:
|
||||
-Wall -Wextra -pedantic-errors -Wconversion -Wsign-conversion
|
||||
>)
|
||||
@@ -3,11 +3,6 @@ include_directories(${GTEST_INCLUDE_DIR})
|
||||
|
||||
link_directories(${GTEST_LIB_DIR})
|
||||
|
||||
set(LIBS
|
||||
${LIBS}
|
||||
gtest
|
||||
TopTeamBedrijfssimulaties)
|
||||
|
||||
# tests
|
||||
file(GLOB_RECURSE TEST_SOURCES "*.cpp")
|
||||
add_executable(tests ${TEST_SOURCES})
|
||||
@@ -15,4 +10,18 @@ target_link_libraries(tests ${LIBS})
|
||||
|
||||
target_compile_options(tests PRIVATE $<$<CONFIG:Debug>:
|
||||
-Wall -Wextra -pedantic-errors -Wconversion -Wsign-conversion
|
||||
>)
|
||||
>)
|
||||
target_link_libraries(tests
|
||||
PRIVATE
|
||||
TopTeamBedrijfssimulaties
|
||||
cmdLineArgs
|
||||
gtest
|
||||
)
|
||||
|
||||
target_include_directories(tests
|
||||
PUBLIC
|
||||
${CMAKE_MAIN_SOURCE_DIR}/external/**
|
||||
${CMAKE_CURRENT_LIST_DIR}
|
||||
${CMAKE_CURRENT_LIST_DIR}/TopTeamBedrijfssimulaties
|
||||
${PROJECT_BINARY_DIR}
|
||||
)
|
||||
Reference in New Issue
Block a user