Skip to content
Open
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
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
Copy Markdown
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: 24 additions & 13 deletions TPL/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,32 @@ option(SMQTK_BUILD_FLANN "Enable building of FLANN." ON)
# TPL_PYTHON_SP - relative path of standarad Python site-packages dir


# Pick "make" executable based on generator chosen or environment variable
# set.
if (CMAKE_GENERATOR MATCHES ".*Makefiles")
set(MAKE_EXECUTABLE "$(MAKE)")
elseif(NOT "#@$ENV{MAKE}" STREQUAL "#@")
set(MAKE_EXECUTABLE $ENV{MAKE})
else()
find_program(MAKE_EXECUTABLE make)
endif()


###
# libSVM
#
if (SMQTK_BUILD_LIBSVM)

# Required a make command to build. Required its existance.
# Pick "make" executable based on generator chosen or environment variable
# set.
if (CMAKE_GENERATOR MATCHES ".*Makefiles")
set(MAKE_EXECUTABLE "$(MAKE)")
elseif(WIN32)
set(MAKE_EXECUTABLE nmake -f Makefile.win)
elseif(NOT "#@$ENV{MAKE}" STREQUAL "#@")
set(MAKE_EXECUTABLE $ENV{MAKE})
else()
find_program(MAKE_EXECUTABLE make)
endif()

# Set the libsvm we want. Can't just use a suffix, since linux uses *.so.2
if(WIN32)
set(LIBSVM_NAME libsvm.dll)
else()
set(LIBSVM_NAME libsvm.so.2)
endif()


if( NOT MAKE_EXECUTABLE )
message( FATAL_ERROR "Could not find 'make', required to build libsvm." )
endif()
Expand All @@ -41,11 +51,11 @@ if (SMQTK_BUILD_LIBSVM)
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 ${LIBSVM_NAME} "${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()


Expand All @@ -71,6 +81,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
Copy Markdown
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
2 changes: 1 addition & 1 deletion TPL/libsvm-3.1-custom/Makefile.win
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ svm.obj: svm.cpp svm.h
$(CXX) $(CFLAGS) -c svm.cpp

lib: svm.cpp svm.h svm.def
$(CXX) $(CFLAGS) -LD svm.cpp -Fe$(TARGET)\libsvm -link -DEF:svm.def
$(CXX) $(CFLAGS) -LD svm.cpp -Felibsvm -link -DEF:svm.def

clean:
-erase /Q *.obj $(TARGET)\.
Expand Down
3 changes: 3 additions & 0 deletions docs/release_notes/pending_release.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ SMQTK Pending Release Notes
Updates / New Features since v0.8.1
-----------------------------------

libSVM

* Can now build libSVM on Windows

Fixes since v0.8.1
------------------