Skip to content

Commit

Permalink
Some minor cleaning up.
Browse files Browse the repository at this point in the history
  • Loading branch information
agarny committed Nov 3, 2019
1 parent 2be730a commit 5cf3abd
Show file tree
Hide file tree
Showing 18 changed files with 34 additions and 62 deletions.
18 changes: 6 additions & 12 deletions CMakeLists.txt
Expand Up @@ -286,27 +286,21 @@ if(WIN32)
set(EXTERNAL_PACKAGE_DIR debug)
endif()

set(DEST_EXTERNAL_BINARIES_DIR bin)
set(DEST_EXTERNAL_LIBRARIES_DIR bin)
else()
set(EXTERNAL_PACKAGE_DIR .)

if(APPLE)
set(DEST_EXTERNAL_BINARIES_DIR ${CMAKE_PROJECT_NAME}.app/Contents/Frameworks)
set(DEST_EXTERNAL_LIBRARIES_DIR ${CMAKE_PROJECT_NAME}.app/Contents/Frameworks)
else()
set(DEST_EXTERNAL_BINARIES_DIR lib)
set(DEST_EXTERNAL_LIBRARIES_DIR lib)
endif()
endif()

set(FULL_DEST_EXTERNAL_BINARIES_DIR ${PROJECT_BUILD_DIR}/${DEST_EXTERNAL_BINARIES_DIR})
set(FULL_DEST_EXTERNAL_LIBRARIES_DIR ${PROJECT_BUILD_DIR}/${DEST_EXTERNAL_LIBRARIES_DIR})

if(NOT EXISTS ${FULL_DEST_EXTERNAL_BINARIES_DIR})
file(MAKE_DIRECTORY ${FULL_DEST_EXTERNAL_BINARIES_DIR})
endif()

if(APPLE)
set(FULL_DEST_EXTERNAL_BASE_DIR ${FULL_DEST_EXTERNAL_BINARIES_DIR})
else()
set(FULL_DEST_EXTERNAL_BASE_DIR ${PROJECT_BUILD_DIR})
if(NOT EXISTS ${FULL_DEST_EXTERNAL_LIBRARIES_DIR})
file(MAKE_DIRECTORY ${FULL_DEST_EXTERNAL_LIBRARIES_DIR})
endif()

# Some in-house CMake macros
Expand Down
4 changes: 1 addition & 3 deletions clean
@@ -1,5 +1,3 @@
#!/bin/sh

appDir="$(cd "$(dirname "$0")"; pwd)"

${appDir}/scripts/genericclean
"$(cd "$(dirname "$0")"; pwd)/scripts/genericclean"
4 changes: 1 addition & 3 deletions clean.bat
@@ -1,5 +1,3 @@
@ECHO OFF

SET AppDir=%~dp0

CALL "%AppDir%scripts\genericclean"
CALL "%~dp0scripts\genericclean"
4 changes: 1 addition & 3 deletions cleanall
@@ -1,5 +1,3 @@
#!/bin/sh

appDir="$(cd "$(dirname "$0")"; pwd)"

${appDir}/scripts/genericclean all
"$(cd "$(dirname "$0")"; pwd)/scripts/genericclean" all
4 changes: 1 addition & 3 deletions cleanall.bat
@@ -1,5 +1,3 @@
@ECHO OFF

SET AppDir=%~dp0

CALL "%AppDir%scripts\genericclean" all
CALL "%~dp0scripts\genericclean" all
14 changes: 7 additions & 7 deletions cmake/common.cmake
Expand Up @@ -319,12 +319,12 @@ macro(add_plugin PLUGIN_NAME)
copy_file_to_build_dir(${COPY_TARGET} ${ARG_EXTERNAL_BINARIES_DIR} . ${ARG_EXTERNAL_BINARY})
endif()

copy_file_to_build_dir(${COPY_TARGET} ${ARG_EXTERNAL_BINARIES_DIR} ${DEST_EXTERNAL_BINARIES_DIR} ${ARG_EXTERNAL_BINARY})
copy_file_to_build_dir(${COPY_TARGET} ${ARG_EXTERNAL_BINARIES_DIR} ${DEST_EXTERNAL_LIBRARIES_DIR} ${ARG_EXTERNAL_BINARY})

# Strip the external library of all its local symbols, if possible

if(NOT WIN32)
strip_file(${COPY_TARGET} ${FULL_DEST_EXTERNAL_BINARIES_DIR}/${ARG_EXTERNAL_BINARY})
strip_file(${COPY_TARGET} ${FULL_DEST_EXTERNAL_LIBRARIES_DIR}/${ARG_EXTERNAL_BINARY})
endif()

# Link the plugin to the external library
Expand All @@ -338,7 +338,7 @@ macro(add_plugin PLUGIN_NAME)
)
elseif(APPLE)
target_link_libraries(${PROJECT_NAME}
${FULL_DEST_EXTERNAL_BINARIES_DIR}/${ARG_EXTERNAL_BINARY}
${FULL_DEST_EXTERNAL_LIBRARIES_DIR}/${ARG_EXTERNAL_BINARY}
)
else()
target_link_libraries(${PROJECT_NAME}
Expand All @@ -351,13 +351,13 @@ macro(add_plugin PLUGIN_NAME)

if(APPLE)
if("${COPY_TARGET}" STREQUAL "DIRECT")
execute_process(COMMAND install_name_tool -id @rpath/${ARG_EXTERNAL_BINARY} ${FULL_DEST_EXTERNAL_BINARIES_DIR}/${ARG_EXTERNAL_BINARY})
execute_process(COMMAND install_name_tool -id @rpath/${ARG_EXTERNAL_BINARY} ${FULL_DEST_EXTERNAL_LIBRARIES_DIR}/${ARG_EXTERNAL_BINARY})
else()
add_custom_command(TARGET ${COPY_TARGET} POST_BUILD
COMMAND install_name_tool -id @rpath/${ARG_EXTERNAL_BINARY} ${FULL_DEST_EXTERNAL_BINARIES_DIR}/${ARG_EXTERNAL_BINARY})
COMMAND install_name_tool -id @rpath/${ARG_EXTERNAL_BINARY} ${FULL_DEST_EXTERNAL_LIBRARIES_DIR}/${ARG_EXTERNAL_BINARY})
endif()

strip_file(${COPY_TARGET} ${FULL_DEST_EXTERNAL_BINARIES_DIR}/${ARG_EXTERNAL_BINARY})
strip_file(${COPY_TARGET} ${FULL_DEST_EXTERNAL_LIBRARIES_DIR}/${ARG_EXTERNAL_BINARY})
endif()

# Package the external library, if needed
Expand Down Expand Up @@ -517,7 +517,7 @@ macro(add_plugin PLUGIN_NAME)
)
elseif(APPLE)
target_link_libraries(${TEST_NAME}
${FULL_DEST_EXTERNAL_BINARIES_DIR}/${ARG_EXTERNAL_BINARY}
${FULL_DEST_EXTERNAL_LIBRARIES_DIR}/${ARG_EXTERNAL_BINARY}
)
else()
target_link_libraries(${TEST_NAME}
Expand Down
4 changes: 1 addition & 3 deletions distrib/linux/application.in 100755 → 100644
@@ -1,5 +1,3 @@
#!/bin/sh

appDir="$(cd "$(dirname "$0")"; pwd)"

${appDir}/bin/@CMAKE_PROJECT_NAME@ $*
"$(cd "$(dirname "$0")"; pwd)/bin/@CMAKE_PROJECT_NAME@" $*
4 changes: 1 addition & 3 deletions distrib/macos/application.in 100755 → 100644
@@ -1,5 +1,3 @@
#!/bin/sh

appDir="$(cd "$(dirname "$0")"; pwd)"

${appDir}/@CMAKE_PROJECT_NAME@.app/Contents/MacOS/@CMAKE_PROJECT_NAME@ $*
"$(cd "$(dirname "$0")"; pwd)/@CMAKE_PROJECT_NAME@.app/Contents/MacOS/@CMAKE_PROJECT_NAME@" $*
4 changes: 1 addition & 3 deletions distrib/windows/application.bat.in
Expand Up @@ -2,6 +2,4 @@

TITLE Running the ${CMAKE_PROJECT_NAME} environment...

SET AppBase=%~dp0bin\${CMAKE_PROJECT_NAME}

"%AppBase%" %*
"%~dp0bin\${CMAKE_PROJECT_NAME}" %*
4 changes: 1 addition & 3 deletions make
@@ -1,5 +1,3 @@
#!/bin/sh

appDir="$(cd "$(dirname "$0")"; pwd)"

${appDir}/scripts/genericmake Release $*
"$(cd "$(dirname "$0")"; pwd)/scripts/genericmake" Release $*
4 changes: 1 addition & 3 deletions make.bat
@@ -1,5 +1,3 @@
@ECHO OFF

SET AppDir=%~dp0

CALL "%AppDir%scripts\genericmake" Release %*
CALL "%~dp0scripts\genericmake" Release %*
4 changes: 1 addition & 3 deletions maketests
@@ -1,5 +1,3 @@
#!/bin/sh

appDir="$(cd "$(dirname "$0")"; pwd)"

${appDir}/scripts/genericmake Tests $*
"$(cd "$(dirname "$0")"; pwd)/scripts/genericmake" Tests $*
4 changes: 1 addition & 3 deletions maketests.bat
@@ -1,5 +1,3 @@
@ECHO OFF

SET AppDir=%~dp0

CALL "%AppDir%scripts\genericmake" Tests %*
CALL "%~dp0scripts\genericmake" Tests %*
6 changes: 3 additions & 3 deletions run.vbs
@@ -1,13 +1,13 @@
appExe = Left(Wscript.ScriptFullName, Len(Wscript.ScriptFullName)-Len(Wscript.ScriptName))&"build\bin\OpenCOR.exe"
AppExe = Left(Wscript.ScriptFullName, Len(Wscript.ScriptFullName)-Len(Wscript.ScriptName))&"build\bin\OpenCOR.exe"

If CreateObject("Scripting.FileSystemObject").FileExists(appExe) Then
If CreateObject("Scripting.FileSystemObject").FileExists(AppExe) Then
args = ""

For Each arg in WScript.Arguments
args = args&" "&arg
Next

cmd = """"&appExe&args&""""
cmd = """"&AppExe&args&""""

CreateObject("WScript.Shell").Run cmd, 1, False
Else
Expand Down
6 changes: 3 additions & 3 deletions runtests.bat
Expand Up @@ -2,10 +2,10 @@

TITLE Running OpenCOR's tests...

SET appTestsExe=%~dp0build\bin\runtests.exe
SET AppTestsExe=%~dp0build\bin\runtests.exe

IF NOT EXIST %appTestsExe% (
IF NOT EXIST %AppTestsExe% (
ECHO OpenCOR's tests must first be built before being run.
) ELSE (
"%appTestsExe%"
"%AppTestsExe%"
)
2 changes: 1 addition & 1 deletion src/misc/cliutils.cpp
Expand Up @@ -139,7 +139,7 @@ void initPluginsPath(int pArgC, char *pArgV[]) // NOLINT(hicpp-avoid-c-arrays, m

pluginsDir = appDir+"/plugins";
}
#elif defined(Q_OS_MAC)
#else
pluginsDir = appDir+"/../PlugIns";
#endif

Expand Down
Expand Up @@ -449,7 +449,7 @@ void SimulationExperimentViewInformationParametersWidget::populateContextMenu(Ce

mContextMenu->addMenu(mPlotAgainstMenu);

// Initialise our two main menu items
// Initialise our menu items

retranslateContextMenu();

Expand Down
4 changes: 2 additions & 2 deletions src/plugins/support/SimulationSupport/src/simulation.cpp
Expand Up @@ -1732,8 +1732,8 @@ void Simulation::run()
return;
}

// Initialise our worker, if we don't already have one and if the
// simulation settings we were given are sound
// Initialise our worker, if we don't already have one and if the simulation
// settings we were given are sound

if ((mWorker == nullptr) && simulationSettingsOk()) {
// Create and move our worker to a thread
Expand Down

0 comments on commit 5cf3abd

Please sign in to comment.