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

Begin adding windows support #314

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
34 changes: 22 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ set(SMQTK_VERSION_MAJOR ${CMAKE_MATCH_1})
set(SMQTK_VERSION_MINOR ${CMAKE_MATCH_3})
set(SMQTK_VERSION_PATCH ${CMAKE_MATCH_5})

###
# Options
#
option(SMQTK_BUILD_EXAMPLES "Enable building examples." ON)
option(SMQTK_INSTALL_SETUP_SCRIPT "Enable building examples." ON)
mark_as_advanced(SMQTK_INSTALL_SETUP_SCRIPT)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this defaulted to anything somewhere? Maybe we should just not install the setup script when we're on windows?


###
# Determine where to install python things in our install tree
Expand Down Expand Up @@ -58,14 +64,16 @@ add_subdirectory( src )
# File configuration
#
# Environment setup scripts
configure_file("${SMQTK_SOURCE_DIR}/setup_env.build.sh.in"
"${SMQTK_BINARY_DIR}/setup_env.build.sh"
@ONLY
)
configure_file("${SMQTK_SOURCE_DIR}/setup_env.install.sh.in"
"${SMQTK_BINARY_DIR}/setup_env.install.sh"
@ONLY
)
if(SMQTK_INSTALL_SETUP_SCRIPT)
configure_file("${SMQTK_SOURCE_DIR}/setup_env.build.sh.in"
"${SMQTK_BINARY_DIR}/setup_env.build.sh"
@ONLY
)
configure_file("${SMQTK_SOURCE_DIR}/setup_env.install.sh.in"
"${SMQTK_BINARY_DIR}/setup_env.install.sh"
@ONLY
)
endif()


###
Expand All @@ -76,10 +84,12 @@ install(DIRECTORY docs/
)

# Should only be required for users installing to a non-standard location
install(FILES "${SMQTK_BINARY_DIR}/setup_env.install.sh"
DESTINATION .
RENAME setup_smqtk.sh
)
if(SMQTK_INSTALL_SETUP_SCRIPT)
install(FILES "${SMQTK_BINARY_DIR}/setup_env.install.sh"
DESTINATION .
RENAME setup_smqtk.sh
)
endif()

# This is probably not the correct way to be doing this, but when using CPack,
# make sure the CMAKE_INSTALL_PREFIX is clean before constructing packages. If
Expand Down
37 changes: 21 additions & 16 deletions TPL/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,26 @@ option(SMQTK_BUILD_FLANN "Enable building of FLANN." ON)
# libSVM
#
if (SMQTK_BUILD_LIBSVM)
set(libSVM_DIR "${CMAKE_CURRENT_LIST_DIR}/libsvm-3.1-custom")
ExternalProject_Add(libSVM
PREFIX "${TPL_BUILD_PREFIX}"
SOURCE_DIR "${libSVM_DIR}"
CONFIGURE_COMMAND ""
BUILD_IN_SOURCE 1
BUILD_COMMAND $(MAKE) lib
INSTALL_DIR "${TPL_LOCAL_INSTALL}"
INSTALL_COMMAND "${CMAKE_COMMAND}" -E make_directory "${TPL_LOCAL_INSTALL}/lib"
COMMAND "${CMAKE_COMMAND}" -E make_directory "${TPL_LOCAL_INSTALL}/include"
COMMAND "${CMAKE_COMMAND}" -E make_directory "${TPL_PYTHON_SP}"
COMMAND "${CMAKE_COMMAND}" -E copy libsvm.so.2 "${TPL_LOCAL_INSTALL}/lib"
COMMAND "${CMAKE_COMMAND}" -E copy svm.h "${TPL_LOCAL_INSTALL}/include"
COMMAND "${CMAKE_COMMAND}" -E copy python/svm.py "${TPL_PYTHON_SP}"
COMMAND "${CMAKE_COMMAND}" -E copy python/svmutil.py "${TPL_PYTHON_SP}"
)
if (WIN32)
message(FATAL_ERROR "Internal LibSVM build does not support windows")
else()
set(libSVM_DIR "${CMAKE_CURRENT_LIST_DIR}/libsvm-3.1-custom")
ExternalProject_Add(libSVM
PREFIX "${TPL_BUILD_PREFIX}"
SOURCE_DIR "${libSVM_DIR}"
CONFIGURE_COMMAND ""
BUILD_IN_SOURCE 1
BUILD_COMMAND $(MAKE) lib
INSTALL_DIR "${TPL_LOCAL_INSTALL}"
INSTALL_COMMAND "${CMAKE_COMMAND}" -E make_directory "${TPL_LOCAL_INSTALL}/lib"
COMMAND "${CMAKE_COMMAND}" -E make_directory "${TPL_LOCAL_INSTALL}/include"
COMMAND "${CMAKE_COMMAND}" -E make_directory "${TPL_PYTHON_SP}"
COMMAND "${CMAKE_COMMAND}" -E copy libsvm.so.2 "${TPL_LOCAL_INSTALL}/lib"
COMMAND "${CMAKE_COMMAND}" -E copy svm.h "${TPL_LOCAL_INSTALL}/include"
COMMAND "${CMAKE_COMMAND}" -E copy python/svm.py "${TPL_PYTHON_SP}"
COMMAND "${CMAKE_COMMAND}" -E copy python/svmutil.py "${TPL_PYTHON_SP}"
)
endif()
endif()


Expand All @@ -55,6 +59,7 @@ if (SMQTK_BUILD_FLANN)
-DBUILD_MATLAB_BINDINGS:BOOL=OFF
-DBUILD_CUDA_LIB:BOOL=OFF
-DBUILD_PYTHON_BINDINGS:BOOL=OFF
-DBUILD_EXAMPLES:BOOL=${SMQTK_BUILD_EXAMPLES}
#-DLATEX_OUTPUT_PATH:PATH=${CMAKE_CURRENT_LIST_DIR}/flann-1.8.4
-DLATEX_OUTPUT_PATH:PATH=build
"-DCMAKE_INSTALL_PREFIX:PATH=${TPL_LOCAL_INSTALL}"
Expand Down
3 changes: 3 additions & 0 deletions TPL/flann-1.8.4/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CMakeFiles
Makefile
cmake_install.cmake
7 changes: 6 additions & 1 deletion TPL/flann-1.8.4/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ option(BUILD_C_BINDINGS "Build C bindings" ON)
option(BUILD_PYTHON_BINDINGS "Build Python bindings" ON)
option(BUILD_MATLAB_BINDINGS "Build Matlab bindings" ON)
option(BUILD_CUDA_LIB "Build CUDA library" OFF)
option(BUILD_EXAMPLES "Build examples" ON)
option(USE_OPENMP "Use OpenMP multi-threading" ON)
option(USE_MPI "Use MPI" OFF)

Expand Down Expand Up @@ -155,7 +156,11 @@ endif(WIN32)

add_subdirectory( cmake )
add_subdirectory( src )
add_subdirectory( examples )

if(BUILD_EXAMPLES)
add_subdirectory( examples )
endif()

add_subdirectory( test )
add_subdirectory( doc )

Expand Down
3 changes: 3 additions & 0 deletions TPL/flann-1.8.4/src/cpp/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CMakeFiles
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file should be unnecessary due to the .gitignore file two directories up?

Makefile
cmake_install.cmake
4 changes: 3 additions & 1 deletion TPL/flann-1.8.4/src/cpp/flann/util/serialization.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ BASIC_TYPE_SERIALIZER(unsigned long);
BASIC_TYPE_SERIALIZER(float);
BASIC_TYPE_SERIALIZER(double);
BASIC_TYPE_SERIALIZER(bool);

#ifdef _MSC_VER
BASIC_TYPE_SERIALIZER(unsigned __int64);
#endif


// serializer for std::vector
Expand Down