Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Visual Studio folders for 'Examples' and 'UnitTests' #232

Merged
merged 1 commit into from
Jul 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@ endif()
# Don't allow for compiler-specific extensions
set(CMAKE_CXX_EXTENSIONS OFF)

# Use solution folders.
set_property(GLOBAL PROPERTY USE_FOLDERS ON)

# Building
add_subdirectory(src)

Expand Down
5 changes: 4 additions & 1 deletion src/examples/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ else()
endif()

foreach(exampleName IN LISTS ALL_LOG4CXX_EXAMPLES)
set(PROGRAM_NAME "example-${exampleName}")
set(PROGRAM_NAME "${exampleName}")
add_executable(${PROGRAM_NAME} ${exampleName}.cpp)
if(${exampleName} STREQUAL MyApp2)
target_sources(${PROGRAM_NAME} PRIVATE com/foo/config2.cpp com/foo/bar.cpp)
Expand All @@ -44,6 +44,7 @@ foreach(exampleName IN LISTS ALL_LOG4CXX_EXAMPLES)
set_target_properties(${PROGRAM_NAME} PROPERTIES
VS_DEBUGGER_ENVIRONMENT "PATH=${ESCAPED_PATH}"
VS_DEBUGGER_WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
FOLDER Examples
)
endif()
endforeach()
Expand All @@ -57,6 +58,8 @@ if(${fmt_FOUND})
if( WIN32 )
set_target_properties( format-string PROPERTIES
VS_DEBUGGER_ENVIRONMENT "PATH=${ESCAPED_PATH}"
VS_DEBUGGER_WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
FOLDER Examples
)
endif()
endif(${fmt_FOUND})
2 changes: 1 addition & 1 deletion src/examples/cpp/custom-appender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ int main( int argc, char** argv )
{
using namespace log4cxx;

xml::DOMConfigurator::configure( "example-custom-appender.xml" );
xml::DOMConfigurator::configure( "custom-appender.xml" );

LoggerPtr rootLogger = Logger::getRootLogger();
LoggerPtr nullLogger = Logger::getLogger( "NullLogger" );
Expand Down
2 changes: 1 addition & 1 deletion src/site/markdown/extending.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,5 +142,5 @@ to Log4cxx, including(but not limited to):
\example custom-appender.cpp
This example shows how to extend Log4cxx with a new appender.

\example example-custom-appender.xml
\example custom-appender.xml
This example shows how to use a new appender in a configuration file.
2 changes: 1 addition & 1 deletion src/test/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,10 @@ foreach(testName IN LISTS ALL_LOG4CXX_TESTS)
WORKING_DIRECTORY ${UNIT_TEST_WORKING_DIR}
)
set_tests_properties( ${testName} PROPERTIES TIMEOUT 120 )

if(WIN32)
set_target_properties(${testName} PROPERTIES
VS_DEBUGGER_WORKING_DIRECTORY ${UNIT_TEST_WORKING_DIR}
FOLDER UnitTests
)
set_target_properties(${testName} PROPERTIES
VS_DEBUGGER_COMMAND_ARGUMENTS "-v"
Expand Down
Loading