build: created separate bin folder for each target.
Changed build process to use an individual bin/<subfolder> for each target. This way each target has its own data folder and its own set of dlls.
This commit is contained in:
+7
-4
@@ -1,7 +1,10 @@
|
||||
/build/
|
||||
/lib/
|
||||
/bin/Debug/
|
||||
/bin/Release/
|
||||
/bin/data/log/
|
||||
/bin/app/Debug/
|
||||
/bin/app/Release/
|
||||
/bin/app/data/log/
|
||||
/bin/lib/
|
||||
/bin/test/Debug/
|
||||
/bin/test/Release/
|
||||
/bin/test/data/log/
|
||||
|
||||
.DS_Store
|
||||
|
||||
+15
-9
@@ -20,22 +20,14 @@ endif()
|
||||
|
||||
# Settings ---------------------------------------------------------------------
|
||||
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/lib)
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/lib)
|
||||
|
||||
if (UNIX)
|
||||
add_definitions(-std=c++11 -Wno-unknown-warning-option)
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/${CMAKE_BUILD_TYPE})
|
||||
else ()
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin)
|
||||
endif ()
|
||||
|
||||
|
||||
# Project ----------------------------------------------------------------------
|
||||
|
||||
project(${PROJECT_NAME})
|
||||
|
||||
|
||||
# Clang ------------------------------------------------------------------------
|
||||
|
||||
find_package(LLVM REQUIRED PATHS "$ENV{CLANG_DIR}/build/share/llvm/cmake")
|
||||
@@ -54,6 +46,8 @@ find_package( Boost 1.55 COMPONENTS system filesystem REQUIRED )
|
||||
|
||||
# Lib --------------------------------------------------------------------------
|
||||
|
||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/lib)
|
||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/lib)
|
||||
|
||||
add_subdirectory(src/lib)
|
||||
add_subdirectory(src/external)
|
||||
@@ -89,6 +83,12 @@ target_link_libraries(${LIB_PROJECT_NAME} ${CLANG_LIBRARIES} ${LLVM_AVAILABLE_LI
|
||||
|
||||
# App --------------------------------------------------------------------------
|
||||
|
||||
if (UNIX)
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/app/${CMAKE_BUILD_TYPE})
|
||||
else ()
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/app/)
|
||||
endif ()
|
||||
|
||||
add_subdirectory(src/app)
|
||||
|
||||
# Find includes in corresponding build directories
|
||||
@@ -129,6 +129,12 @@ set(CMAKE_AUTOMOC OFF)
|
||||
|
||||
# CxxTest ----------------------------------------------------------------------
|
||||
|
||||
if (UNIX)
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/test/${CMAKE_BUILD_TYPE})
|
||||
else ()
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/test/)
|
||||
endif ()
|
||||
|
||||
add_subdirectory(src/test)
|
||||
|
||||
set(CXXTEST_INCLUDE_DIR $ENV{CXX_TEST_DIR})
|
||||
@@ -166,7 +172,7 @@ if (WIN32)
|
||||
add_custom_command(
|
||||
TARGET ${TEST_PROJECT_NAME}
|
||||
POST_BUILD
|
||||
COMMAND cd $(ProjectDir)../bin/\n$(OutDir)$(TargetName)$(TargetExt)
|
||||
COMMAND cd $(ProjectDir)../bin/test/\n$(OutDir)$(TargetName)$(TargetExt)
|
||||
COMMENT "Running unittest code"
|
||||
)
|
||||
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<config>
|
||||
<SourcePath>data/src</SourcePath>
|
||||
</config>
|
||||
+6
-3
@@ -8,8 +8,11 @@ cd $MY_PATH/..
|
||||
|
||||
# Remove folders and contents
|
||||
rm -rf build
|
||||
rm -rf lib
|
||||
rm -rf bin/Debug
|
||||
rm -rf bin/Release
|
||||
rm -rf bin/app/Debug
|
||||
rm -rf bin/app/Release
|
||||
rm -rf bin/lib/Debug
|
||||
rm -rf bin/lib/Release
|
||||
rm -rf bin/test/Debug
|
||||
rm -rf bin/test/Release
|
||||
|
||||
echo -e $SUCCESS "clean complete"
|
||||
|
||||
+1
-1
@@ -6,4 +6,4 @@ MY_PATH=`dirname "$0"`
|
||||
cd $MY_PATH/..
|
||||
|
||||
# Build and run target
|
||||
ninja -C build/Debug "$1" && cd bin && Debug/"$1"
|
||||
ninja -C build/Debug masterproject_"$1" && cd bin/"$1" && Debug/masterproject_"$1"
|
||||
|
||||
+1
-1
@@ -6,4 +6,4 @@ MY_PATH=`dirname "$0"`
|
||||
cd $MY_PATH/..
|
||||
|
||||
# Build and run target
|
||||
ninja -C build/Release "$1" && cd bin && Release/"$1"
|
||||
ninja -C build/Release masterproject_"$1" && cd bin/"$1" && Release/masterproject_"$1"
|
||||
|
||||
+11
-5
@@ -30,15 +30,21 @@ cp .git_pre_commit_hook.sh .git/hooks/pre-commit
|
||||
echo -e $INFO "create build folders"
|
||||
|
||||
mkdir -p build
|
||||
mkdir -p lib
|
||||
mkdir -p bin/Debug
|
||||
mkdir -p bin/Release
|
||||
mkdir -p bin/app/Debug
|
||||
mkdir -p bin/app/Release
|
||||
mkdir -p bin/lib/Debug
|
||||
mkdir -p bin/lib/Release
|
||||
mkdir -p bin/test/Debug
|
||||
mkdir -p bin/test/Release
|
||||
|
||||
# Copy necessary dynamic libraries to bin folder
|
||||
if [ $PLATFORM == "Windows" ]; then
|
||||
echo -e $INFO "copy dynamic libraries"
|
||||
cp -u -r setup/dynamic_libraries/windows/Debug/* bin/Debug
|
||||
cp -u -r setup/dynamic_libraries/windows/Release/* bin/Release
|
||||
cp -u -r setup/dynamic_libraries/windows/app/Debug/* bin/app/Debug
|
||||
cp -u -r setup/dynamic_libraries/windows/app/Release/* bin/app/Release
|
||||
|
||||
cp -u -r setup/dynamic_libraries/windows/test/Debug/* bin/test/Debug
|
||||
cp -u -r setup/dynamic_libraries/windows/test/Release/* bin/test/Release
|
||||
|
||||
echo -e $INFO "copy test_main file"
|
||||
cp -u setup/cxx_test/windows/test_main.cpp build
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -35,6 +35,6 @@ void Application::loadProject()
|
||||
m_componentManager->setup();
|
||||
m_project = Project::create(m_codeAccess, m_graphAccess);
|
||||
|
||||
m_project->loadProjectSettings("data/test_ProjectSettings.xml");
|
||||
m_project->loadProjectSettings("data/ProjectSettings.xml");
|
||||
m_project->parseCode();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user