From 87717570114f3285fcd9679c9d50db6a629132d6 Mon Sep 17 00:00:00 2001
From: Alexis Girault <alexis.girault@kitware.com>
Date: Fri, 1 Apr 2016 17:06:47 -0400
Subject: [PATCH] COMP: fix compilation issues on Linux

- Remove PThreads on Linux
- Correct CMake output directories in case of single
configuration type (not MSVC)
---
 Base/Core/CMakeLists.txt              | 3 +++
 Base/Rendering/CMakeLists.txt         | 1 -
 Base/SimulationManager/CMakeLists.txt | 1 -
 CMake/External/CMakeLists.txt         | 6 +++---
 CMakeLists.txt                        | 5 ++++-
 5 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/Base/Core/CMakeLists.txt b/Base/Core/CMakeLists.txt
index d74c3102d..ce33e486a 100644
--- a/Base/Core/CMakeLists.txt
+++ b/Base/Core/CMakeLists.txt
@@ -8,6 +8,9 @@ imstk_add_library( Core
     imstkModule.h
   CPP_FILES
     imstkModule.cpp
+  LIBRARIES
+    Utilities
+    Eigen
   )
 
 #-----------------------------------------------------------------------------
diff --git a/Base/Rendering/CMakeLists.txt b/Base/Rendering/CMakeLists.txt
index 203b921ac..489aa5c56 100644
--- a/Base/Rendering/CMakeLists.txt
+++ b/Base/Rendering/CMakeLists.txt
@@ -17,7 +17,6 @@ imstk_add_library( Rendering
     imstkCubeRenderDelegate.cpp
   LIBRARIES
     ${VTK_LIBRARIES}
-    Core
     Scene
   )
 
diff --git a/Base/SimulationManager/CMakeLists.txt b/Base/SimulationManager/CMakeLists.txt
index dac1c7daf..f50418018 100644
--- a/Base/SimulationManager/CMakeLists.txt
+++ b/Base/SimulationManager/CMakeLists.txt
@@ -10,7 +10,6 @@ imstk_add_library( SimulationManager
   LIBRARIES
     Scene
     Rendering
-    Utilities
   )
   
 #-----------------------------------------------------------------------------
diff --git a/CMake/External/CMakeLists.txt b/CMake/External/CMakeLists.txt
index f0df75836..8f7efe09e 100644
--- a/CMake/External/CMakeLists.txt
+++ b/CMake/External/CMakeLists.txt
@@ -37,13 +37,13 @@ if(NOT CMAKE_CONFIGURATION_TYPES)
   # If we're not doing multi-configuration, just set the three main
   # variables to the correct values.
   if(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
-    set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKES_BINARY_DIR}/${LIB_DIR})
+    set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${LIB_DIR})
   endif()
   if(NOT CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
-    set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKES_BINARY_DIR}/${LIB_DIR})
+    set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${LIB_DIR})
   endif()
   if(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY)
-    set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKES_BINARY_DIR}/${BIN_DIR})
+    set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${BIN_DIR})
   endif()
   list(APPEND CMAKE_OUTPUT_DIRECTORIES
     -DCMAKE_RUNTIME_OUTPUT_DIRECTORY:STRING=${CMAKE_RUNTIME_OUTPUT_DIRECTORY}
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b63b1dc32..f52a1c6d3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -71,11 +71,14 @@ if(${PROJECT_NAME}_USE_Uncrustify)
   imstk_define_dependency(Uncrustify)
 endif()
 
+if(WIN32)
+  imstk_define_dependency(PThreads)
+endif()
+
 imstk_define_dependency(g3log)
 imstk_define_dependency(Eigen)
 imstk_define_dependency(VegaFEM)
 imstk_define_dependency(VTK)
-imstk_define_dependency(PThreads)
 
 #-----------------------------------------------------------------------------
 # SUPERBUILD
-- 
GitLab